Ask HN: How to Translate Your App?
We don't know if in 2024 we need to keep the translation in the source code, use translation software(like Weglot), or build something custom.
What's your experience?
We don't know if in 2024 we need to keep the translation in the source code, use translation software(like Weglot), or build something custom.
What's your experience?
* Right to Left languages need effort, as they redefine the UI
* Longer languages (German) need thought/character limits
* When defining user-visible lists, you need to decide whether the language defines the order, or the order is fixed
* Does the start of the week matter?
* Is your use of colors intuitive cross-culturally [Chinese stock market]
* Is your use of flags offensive? [Windows doesn't have flag emoji for a reason]
* Are you accepting CJK text? Be aware of Han Unification
* Some languages don't have spaces, so splitting on " " would fail
* Turkish i problem and .toUpper/toLower - when to use invariant locales
* Fonts may not be able to display all your required characters
* Translators need context when translating: try a mix of glossary, string description, or screenshots
* Images need work if they're not SVG
Familiarise yourself with CLDR tables/rules: https://www.unicode.org/cldr/charts/45/supplemental/language...
Currently using CrowdIn's open source plan [100+ languages, 40+ reasonably translated], would STRONGLY recommend: [https://crowdin.com/project/ankidroid].
====
As a process:
* Find & setup a translation frontend library to use + define a translation function. For the following rough example, I'll assume React syntax + json
* extract strings, plurals, images etc..: `<span>Hello World</span>` -> `<span>{t("home.greeting")}</span>`
* Upload `en.json` to translation provider
* Upload contextual information/screenshots/glossary
* Find translators and track progress
* Proofread if necessary
* Either use a SDK for live translations, or download `[fr/de].json` and include them alongside `en.json`
* Send app off for verification
We're looking at formatjs.io for the react librairy.
1) They've incorrectly documented most of their plural rules, it's like they didn't bother to read the spec (and it's an easy spec to read).
> one: This category is used for languages that have grammar specialized specifically for one item. Many languages, but not all, use this plural category. (Many popular Asian languages, such as Chinese and Japanese, do not use this category.)
https://formatjs.io/docs/core-concepts/icu-syntax#plural-for...
> These categories are only mnemonics -- the names don't necessarily imply the exact contents of the category.
> This is worth emphasizing: A common mistake is to think that "one" is only for only the number 1. Instead, "one" is a category for any number that behaves like 1. So in some languages, for example, one → numbers that end in "1" (like 1, 21, 151) but that don't end in 11 (like "11, 111, 10311).
https://cldr.unicode.org/index/cldr-spec/plural-rules#h.ukir...
2) That example is trivial. They've only bothered with 8 languages and most are uninteresting.
3) Using currency as the standard numerical example is correct, but questionable.
For now as a POC we simply are using the t() function with a translation file. We'll see which features are important for us and we'll deep dive when needs be.
Thank you for your insight, I understand that translation is hard :)