Versions Compared

Key

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

...

4. Activate the new language in environment.common.ts ./src/config/default-app-config.ts (look for the "LangConfig[]" array)

Code Block
languages: LangConfig[] = [
  ...
  { 
Code Block
{
    code: 'nl',
    label: 'Nederlands',
    active: true},
}  ...
];

Where code is the two letter code for your language, also used as the filename for your translated catalog. 

...

Code Block
titlejson5 validate
yarn json5 --validate ./src/resourcesassets/i18n/es.json5

Examples of possible errors you might get:

...

This particular mistake occurred where there was an extra space between \ and " in the \" combination used to escape the "

Checking your files syntax via "lint"

Lint is a tool we use to ensure files are correctly formatted, and have no extra characters (e.g. extra spaces at the end of each line can make the file large in size, which take longer for users to download).  This simple command will check your file's syntax (run this from the root folder):

Code Block
yarn lint

(NOTE: Warnings shown by lint can be ignored.  Errors are the only thing that require cleanup)


If that throws errors, most can be automatically cleaned up via:

Code Block
yarn run lint-fix

NOTE: currently, "lint-fix" is unable to add missing commas on the end of a line.  Every new line (which is not a comment) MUST end in a comma.  However, if one is missing, then it'll be obvious... you'll see errors in the UI when selecting that language.

Your first translation pull request!

...