Forum

Christian
Participant
    6 years, 4 months ago #16318
    Up
    0
    Down
    ::

    And yet another question: When writing translatable strings in script code, the translation systems usually have two more features on top of just plain fixed strings. One, replacements are possible (as discussed above, Example: “Should the element {0} be deleted?”)

    The second important feature for high-quality translations from script code is support for plural forms. Example: “Should 1 element be deleted” vs. “Should 2 elements be deleted”, where the number argument must be used for choosing among several possible plural forms. Between English and German this seems to be easy, because by coincidence both languages have exactly two forms (singular/plural) with the same rules. Other languages may have completely different rules and forms (e.g. Arabic has six plural forms). Hence, the translation system must enable some way of specifying this situation. See e.g. here for how Angular solves this topic: https://angular.io/guide/i18n#translating-plural-and-select-expressions which isn’t particularly elegant either but at least some usable solution.

    What do you suggest here? Also, I would kindly ask you to extend your “Language” chapter in the documentation to describe the translations from script code, because right now it is still not mentioned there how to do this. Once you’re at it, please remember to also mention the two features discussed here (replacements and plural forms). Thanks!