Versions Compared

Key

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

...

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 --lint-file-patterns src/assets/i18n/*.json5

(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 viaby adding "--fix" to the same command:

Code Block
yarn runlint --lint-file-patterns src/assets/i18n/*.json5 --fix


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

Code Block
# This error is a sign that you have a missing comma on the line just BEFORE [some translation key]
Parsing error: Unexpected token [some translation key]


Your first translation pull request!

...