Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Include the new language locale (using the first 2 letters of it) in the locales array located in the i18next-parser.config.js which looks like this. In the case of a dialect, please concatenate the language and the locality, for example ‘pt-br’ ‘pt’ for Portuguese Brazil.

    Code Block
      locales: ['en', 'es', 'pt', 'fr']
  2. Run npm run i18n which should create a new folder with 2 several files lang/[your_locale]/[translation_namespace].json and lang/[your_locale]/common.json. some of the current namespaces are: common, geneder, message, role, translation, etc..

  3. Under this new folder, replace the en folder contents with the newly created folder contents. With this you will make sure you have all of the current namespaces, and will provide context on what you are translating.

  4. In your newly created file, change usages of the word english to your new language e.g portuguese

  5. Modify the lang/i18n.js file, to include the new locale in the app.

    1. Import both files in the beginning on the file doing the index you modified doing (using pt as example)

      Code Block
      import [your_locale]portuguese from './[your_locale]/translation.json';
      import [your_locale]_common from './[your_locale]/common.json'pt;

    2. Include the new locale in the resources object, like so:

      Code Block
      fr:{
        translation: fr,
        common: fr_common
      }, french,
       //INCLUDE THE CODE BELOW
      [your_locale]:{
        translation: [your_locale],
        common: [your_locale]_common
      }pt:portuguese

  6. After that you can proceed to translate the files that were created and making a PR on our repo as described in the next section

...