You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As KristWeb v2 is becoming more mature, I'm now ready to begin accepting translations again. In terms of completion, I'd say en.json contains around 75% of the keys that a 2.0 release needs. While that means that translations contributed now will still need to be updated again before release, updating them now provides a lot of time to work on them. Shipping with full translations is not necessary for release, but I think it would be a great added bonus for the maturity of the application, as well as accessibility.
Contributing translations is entirely voluntary, but your help in updating them would be much appreciated.
Updating your translations
I haven't yet made a tool to merge locale JSON files, however there is a CSV containing each language and the keys/missing keys. The missing keys (sourced from en_GB, ignoring plurals) are merged into each language. As well as this, there is always the en.json file as a reference.
I tried to keep the pre-existing translations as stable as possible during the rewrite, however a few now-unused keys were removed due to a change in features. From today onwards, all existing keys are considered stable, and will not be removed. Any text that requires changing will instead receive a new key (e.g. intro2 to replace intro).
The following keys have been removed from en.json:
sidebar.guestIndicator - The 'guest' system has been removed
masterPassword.browseAsGuest - The 'guest' system has been removed
masterPassword.intro - The master password system was reworked. Superseded by masterPassword.intro2.
masterPassword.dontForgetPassword - The text is no longer relevant, though a new key with similar text may be added in the future.
masterPassword.loginIntro - No longer relevant.
masterPassword.helpWalletStorage - The text was outdated, and a new key with similar text will be added in the future.
There's a few things to note about the translation system:
Localised numbers (new!)
Interpolated numbers can now be localised directly in the locale file. Almost every number in KristWeb uses this function now, so that numbers will be formatted with thousands-separators in English (e.g. 1000 -> 1,000). The behaviour of this localisation will depend on the system, not on the chosen language (may change in the future). A localised number interpolation may look like this:
You're likely already familiar with this, but across the locale files, there are substitutions that look like <1 /> or <1>Contents</1>. These refer to React components that are part of the translation string. You are allowed to re-order them, place text before or after them, etc., but do not change the numbering. The number is part of the source code. Additionally, the tags may optionally contain contents; you are allowed to translate this. Examples:
"blockValueBaseValue": "Base value (<1></1>)",
"blockValueNextDecrease": "Decreases by <1></1> in <3>{{count, number}} block</3>",
"blockValueNextDecrease_plural": "Decreases by <1></1> in <3>{{count, number}} blocks</3>",
"blockDifficultyHashRate": "Approx. <1 />",
Locale files and languages.json moved
The locale files are now located in public/locales/{lang}.json, instead of in a subdirectory for each language. The languages.json file, which contains a list of all languages, is now located in src/__data__/languages.json. You no longer need to editutils/i18n.ts to add a language.
Testing your translations
If you have access to the KristWeb v2 private beta, then you can test the translations directly on the live beta. Head to Settings -> Debug settings -> Translations to see the i18n debug page, which allows you to track the progress for each language. Then, click Import JSON or drag a locale file anywhere on the page to import your locale file. The existing locale will be replaced, though your language will revert back to English on the next page reload.
If you really need hot-reloading, and don't mind spending some time compiling the project, then check the private repo in tmpim for installation instructions (DM me on Discord for further information).
As usual, when you are done, you can either send me the updated translations file, send a PR, or push straight to master. Feel free to ask any questions here, or on Discord.
The text was updated successfully, but these errors were encountered:
As KristWeb v2 is becoming more mature, I'm now ready to begin accepting translations again. In terms of completion, I'd say en.json contains around 75% of the keys that a 2.0 release needs. While that means that translations contributed now will still need to be updated again before release, updating them now provides a lot of time to work on them. Shipping with full translations is not necessary for release, but I think it would be a great added bonus for the maturity of the application, as well as accessibility.
Contributing translations is entirely voluntary, but your help in updating them would be much appreciated.
Updating your translations
I haven't yet made a tool to merge locale JSON files, however there is a CSV containing each language and the keys/missing keys. The missing keys (sourced from
en_GB
, ignoring plurals) are merged into each language. As well as this, there is always the en.json file as a reference.I tried to keep the pre-existing translations as stable as possible during the rewrite, however a few now-unused keys were removed due to a change in features. From today onwards, all existing keys are considered stable, and will not be removed. Any text that requires changing will instead receive a new key (e.g.
intro2
to replaceintro
).The following keys have been removed from
en.json
:sidebar.guestIndicator
- The 'guest' system has been removedmasterPassword.browseAsGuest
- The 'guest' system has been removedmasterPassword.intro
- The master password system was reworked. Superseded bymasterPassword.intro2
.masterPassword.dontForgetPassword
- The text is no longer relevant, though a new key with similar text may be added in the future.masterPassword.loginIntro
- No longer relevant.masterPassword.helpWalletStorage
- The text was outdated, and a new key with similar text will be added in the future.There's a few things to note about the translation system:
Localised numbers (new!)
Interpolated numbers can now be localised directly in the locale file. Almost every number in KristWeb uses this function now, so that numbers will be formatted with thousands-separators in English (e.g.
1000
->1,000
). The behaviour of this localisation will depend on the system, not on the chosen language (may change in the future). A localised number interpolation may look like this:<Trans> substitutions
You're likely already familiar with this, but across the locale files, there are substitutions that look like
<1 />
or<1>Contents</1>
. These refer to React components that are part of the translation string. You are allowed to re-order them, place text before or after them, etc., but do not change the numbering. The number is part of the source code. Additionally, the tags may optionally contain contents; you are allowed to translate this. Examples:Locale files and languages.json moved
The locale files are now located in
public/locales/{lang}.json
, instead of in a subdirectory for each language. Thelanguages.json
file, which contains a list of all languages, is now located insrc/__data__/languages.json
. You no longer need to editutils/i18n.ts
to add a language.Testing your translations
If you have access to the KristWeb v2 private beta, then you can test the translations directly on the live beta. Head to Settings -> Debug settings -> Translations to see the i18n debug page, which allows you to track the progress for each language. Then, click Import JSON or drag a locale file anywhere on the page to import your locale file. The existing locale will be replaced, though your language will revert back to English on the next page reload.
If you really need hot-reloading, and don't mind spending some time compiling the project, then check the private repo in tmpim for installation instructions (DM me on Discord for further information).
As usual, when you are done, you can either send me the updated translations file, send a PR, or push straight to master. Feel free to ask any questions here, or on Discord.
The text was updated successfully, but these errors were encountered: