How to Provide a Translation for the Squidex API and Management UI.
There are several translation files in the repository but the files used by the API or the Management UI are automated using the translation tool. To use it, you only have to update the files under
The file structure for source translation files
There are separate files for frontend and backend, one for each language.
The master language is English (
If you want to add a new language you have to complete a few manual steps:
- 6.Translate everything.
- 7.Run the translator.
- 8.Provide a PR.
To update the translation for a language you need to complete the following steps:
- 1.Fork the source code.
- 2.Edit the corresponding JSON files with an editor.
- 3.Run the
translate.shfile depending on the operation system.
- 4.Create a pull request.
In the future, the
translate.batfile will be executed by the build server but it is not quite ready yet.
As you can see, the file executes the self-developed translation tool which consists of the following:
dotnet run translate check-backend ..\..
dotnet run translate check-frontend ..\..
dotnet run translate gen-frontend ..\..
dotnet run translate gen-backend ..\..
The first step is to compare the translation files which do the following:
- 1.The translator tool will loop over all code files (
*.html, *.cshtml, *.cs, *.ts) to analyze which strings are not translated yet. You can try to fix these errors but you'll need a lot of in-depth knowledge about the source code and architecture.
- 2.The translator tool will extract all used keys from the code files and compare the keys with the keys from the master language files. It prints all keys that don't exist in the master language (missing keys) or that exist in the master language file but not in the code files (unused keys). You can try to fix these errors, but you will need a lot of knowledge about user experience.
- 3.The translator tool compares all the translation files for all other languages with the master language and outputs all keys that do not exist in the language file (missing keys) or exist in the language file but not in the master language file (unused keys). Please try to fix all errors.
- 1.Key is missing: Get the English text from
frontend_en.jsonand translate the text into your language.
- 2.Key is unused: Just remove the label and the translation.
Sometimes, the keys are renamed, but it's easy to spot them when you see errors such as these:
You can just fix all these errors by replacing the prefix
The translator tool will also create the final files. It will take all translations for for all languages and add missing translations from the master language files.
The frontend files are also generated as JSON files under
Final frontend files
The backend translations are generated as RESX files under
Final backend files