Translations, documentation and ideas

Posted on
  • Hi,
    https://www.espruino.com/Bangle.js+Locale is still refering to:

    You can run bin/language_scan.js to get a list of all the missing translations.

    After some digging i found that current approach should be as in https://github.com/espruino/BangleApps/blob/master/lang/README.md

    core/tools

    Also I would like to have tool to search for app that is using certain translation to put it in context. I've done quick and dirty setup as proof of concept

    cat pl_PL.json | jq 'del(.GLOBAL."//") | .GLOBAL | to_entries[] | "\(.key)"' | sed -e 's/^/\/\\*LANG\\*\//' > strings.in 
    grep -r -E -f strings.in ../apps
    

    It would be better to prepare something like this in js as this would be agnostic tool.
    HTH

  • I think the only change is that the folder name changed? You just run core/tools/language_scan.js - I'll update the docs.

    Also I would like to have tool to search for app that is using certain translation to put it in context.

    When you run language_scan, you get lines like:

    Missing GLOBAL translation for {"str":"Black","uses":5,"files":["apps/dragboard/settings.js","apps/draguboard/settings.js","apps/ffcniftyb/settings.js","apps/rebbleagenda/settings.js","apps/slopeclockpp/settings.js"]}
    

    Which I think does what you want already? And it even has the option to do the translations for you if you get API login details for Deepl.

  • I saw that my language is done mostly via translator. But having context of what I am trying to translate would help a lot.
    Right now i have manually search for string to check for its context
    I.E.:

    "circle 1": "krąg 1",
    "circle 3": "krąg 3",
    "circle count": "liczenie okręgów",
    

    Which could be valid but in this case is wrong. In this case only one app is using those so finding this is easy.
    For other strings I have to take a look in all occurrences to decide if those need to be addressed separately.
    Tool you mentioned above helps with finding non-translated strings.

    Hope this clarify my use-case a bit.

  • Ahh, ok - I see what you mean. The tool does at least have everything in there needed to figure out where strings are used, so it should be trivial to extend it if you want to allow it to show information about where specific text is used from

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Translations, documentation and ideas

Posted by Avatar for bb5 @bb5

Actions