Page History
...
Instructions to start the script have been updated.TODO update the documentation at Localization L10n
Early DSpace 7 Documentation is now available at Multilingual Support
Volunteer!
Please list your name, email address alongside any of the languages to which you wish to contribute. Also feel free to join the channel #translation on the DuraSpace DSpace Slack for assistance and discussion around DSpace 7 translations.
...
Spanish (es.json5)
Eva Braña Arvo Consultores for Version 7.3 )
Emilio Lorenzo (Arvo Consultores for Version 7.3 )
Brazilian Portuguese (pt-BR.json5)
...
Latvian (lv.json5)
Translator documentation
...
Polish (pl.json5)
Michał Dykas (PCG Academia)
Translator documentation
The authoritative English master file (en.json5)
The The catalogs can be found in src/assets/i18n
...
Code Block |
---|
yarn run sync-i18n -s en.json5 -i -t fr.json5 |
or
Code Block |
---|
json5OR
ts-node --project ../../../tsconfig.ts-node.json ../../../scripts/sync-i18n-files.ts -s en.json5 -i -t fr.json5 |
where en.json5 is the "source" language file where the original keys will be retrieved, and fr.json5 is the catalog of the new language for which you want to start a translation. If you receive an the error that environment.ts can not be found, try running "yarn run config:dev" before you execute the sync-i18n-files script.
The file should now be filled with all of the English messages, that are now present both The file should now be filled with all of the English messages, that are now present both as comments, as well as message, for you to translate.
...
4. Activate the new language in environment./src/config/default.js-app-config.ts (look for the "LangConfig[]" array)
Code Block |
---|
{languages: LangConfig[] = [ ... { 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 | ||
---|---|---|
| ||
yarn json5 --validate ./resourcessrc/assets/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 --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 by adding "--fix" to the same command:
Code Block |
---|
yarn lint --lint-file-patterns src/assets/i18n/*.json5 --fix |
NOTE: currently, "--fix" is unable to add missing commas on the end of each line. Every new line (which is not a comment) MUST end in a comma. However, if you have a missing comma, you'll see 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!
...