Open
Description
This is a replacement for #136 - without the discussion about how to implement it...
Historically, we used the locale
module for translations (http://www.espruino.com/Bangle.js+Locale) but this only provided extremely basic translation (yes/no/etc). While more translations could have been added, these would use up memory and would make apps run slowly.
We are now moving towards translating apps automatically in the app loader during the upload process
It works pretty simply:
- In the
app.js
file, write any text in English and put/*LANG*/
in front of any text string that should be translated - Upon upload, the app is scanned for these strings, and they are replaced if they are found in the translation file in the
lang
folder, for instance https://github.com/espruino/BangleApps/blob/master/lang/de_DE.json
Current status:
- It works. 'Translations' is added to the settings in the About page of the App Loader
- About the only app with
/*LANG*/
entries in at the moment is Settings - we need more apps with the LANG tag added - Translations for different languages are very lacking - run
bin/language_scan.js
to get an idea. we need more translations! Maybe we want to try doing translations automatically so we have some placeholders? - Translations are not 'smart'. While they are aware of punctuation at the beginning and end they're not aware of capitalisation - perhaps if this worked better we could get away with less translations required.
Any help that can be provided is hugely welcome! This has been requested a lot so I've done what I can, but my language of non-english languages is seriously lacking.