Best practices for internationalizing web applications?

前端 未结 4 1530
情深已故
情深已故 2021-01-30 04:10

Internationalizing web apps always seems to be a chore. No matter how much you plan ahead for pluggable languages, there\'s always issues with encoding, funky phrasing that doe

4条回答
  •  忘掉有多难
    2021-01-30 04:58

    In my company all our strings are stored in *.properties files. Our build tools build a "test languange" copy of the properties files, which replace a string like this:

    Click here
    

    with something like this:

    [~~ Çļïčк н∑ѓё ~~ タウ ~~]
    

    Now, when we set the language to "test" in our config files, these properties files are used. (And of course we don't ship the test language files).

    This allows us to:

    1. Make sure that Unicode characters are displayed correctly, including Japanese/Chinese/Korean.
    2. Make sure that the layout scales appropriately for languages with longer words (German in particular has longer words on average than English).
    3. Spot any hard-coded strings (as they will be in plain-English).

    As for the actual translation, this is done by professional translators, not developers.

提交回复
热议问题