-
-
Notifications
You must be signed in to change notification settings - Fork 4
Internationalization and localization
Note: To change the sheet you need a google account and get permission. For this reach out to me via discord, Github, e-mail,...
To manage localizations a google sheets document is used.
When first opening the sheet you will see an overview sheet. This sheet indicates in which other sheets which language needs to be worked on. An explanation is also provided there. While translating please use the English version as a reference.
While adding / updating a translation a few things regarding the syntax are important to know.
syntax | Meaning |
---|---|
@:link | Link to a different i18n translation element. |
[text which users sees](url) | A link where the part in [] is the text the users sees. And () is the URL which the user will be redirected when clicking on it. |
{WORDS_IN_CAPS_WITH_UNDERSCORE} | Those are variables which will be replaced by a value at runtime. They should not be changed while translating. |
<b>"This is normal text and should be translated"<b/> | Some parts of DaKanji (for example the Manual) use a subset of HTML syntax using the simple_html_css-package. Those HTML tags should not be modified but maybe their content. For example the content of a bold tag should be translated but not the tag itself. |
If your desired language is not set up, add a column with its language code (list of language codes, please use 639-1). Then fill all the cells you want (thank you so much!). Finally drop me a message on GitHub, discord, or via e-mail, and then your contribution will be included in the next release of DaKanji.
Important: do not forget to add the new locales in:
ios/Runner/Info.plist
pubspec.yaml -> msix_config
globals.dart → SUPPORTED_LANGUAGES = ...
To generate language files from the google docs document, install the google sheets addon Export Sheet Data. Using this addon export “DaKanji_localization” as a .json file and store it in adssets\translations\localizations.json
. Now run localization.py
in the root of the DaKanji project folder.