Skip to content

Latest commit

 

History

History
68 lines (43 loc) · 1.5 KB

CONTRIBUTING.md

File metadata and controls

68 lines (43 loc) · 1.5 KB

Contributing to the Phiswap ecosystem

Thanks for taking the time to contribute ! You can start by reading our Contribution guidelines first.

Setup

Install the dependencies

yarn
yarn start

Don't forget to setup your IDE with eslint and prettier.

Change PHI network

To change the PHI network from test net, modify the REACT_APP_CHAIN_ID value in .env.

  • MAIN NET 4181

Tests

Firstly, if you need to install cypress

yarn cypress install

Then to run the Cypress suite in CLI

yarn cypress run

Or, to run Cypress with its GUI

yarn cypress open

Localisation

In order for the Crowdin API queries to work - you will need REACT_APP_CROWDIN_APIKEY & REACT_APP_CROWDIN_PROJECTID env variables set in your root .env.development.local file

Adding translations

A hook expose the function you need to translate content.

import useI18n from 'hooks/useI18n'
...
const TranslateString = useI18n()
...
TranslateString(id, 'fallback')
  • id is the crowdin id of the string you want to translate.
  • fallback is a string fallback used if the id cannot be found.

Variables

The translation component can handle variables being passed in from Crowdin, with no code changes.

It will only work if there is only one variable passed in, and if that variable within Crowdin is wrapped in % signs, i.e.:

Translation in crowdin: %asset% Earned link