In general a good short rule of thumb is to always always _always_ write out the full sentence you want to translate and use the tooling to interpolate everything you want to put in it. That way the translator always sees the full context and you make it harder (although not impossible) for yourself to shoot yourself in the foot. Another recommendation I would add is to use two meta locales in development in addition…
Lessons From Linguistics: i18n Best Practices for Front-End Developers
31–40 of 102 posts
Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#32In general a good short rule of thumb is to always always _always_ write out the full sentence you want to translate and use the tooling to interpolate everything you want to put in it. That way the translator always sees the full context and you make it harder (although not impossible) for yourself to shoot yourself in the foot. Another recommendation I would add is to use two meta locales in development in addition…
Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#33In general a good short rule of thumb is to always always _always_ write out the full sentence you want to translate and use the tooling to interpolate everything you want to put in it. That way the translator always sees the full context and you make it harder (although not impossible) for yourself to shoot yourself in the foot. Another recommendation I would add is to use two meta locales in development in addition…
Common translation tools would benefit from the ability to input some domain information. Typing in an entire sentence is a sensible start, but oftentimes a lone sentence does not carry enough context. Example: in my language, the term "fresh water" translates to "fresh water" or "sweet water". "Sweet water" is the opposite of saltwater, while "fresh water" would only be used in a context like "water in a tank has be…
[0] https://www.gnu.org/software/gettext/manual/gettext.html#Con...
Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#34Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#35Eg, a notification like "Alice is online" in some languages requires knowing Alice's gender. Which may be something that's not even stored anywhere in the system. There's probably some language out there that requires some other piece of personal info for a correct translation.
To make things tricky, try having a multitude of items that you refer to: "You're holding a dagger". Now you need to have a serious discussion with your translators, because this is going to get all kinds of tricky, as the maker of Obra Dinn discovered: https://www.youtube.com/watch?v=OMi6xgdSbMA
And to make things extra-tricky, allow users to create content. "Alice gave you a banana", where "banana" is a custom object Alice made herself.
Most translation efforts seem to give up at this point and resort to something stilted like "Alice: online"
Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#36RTL, plural depending on the number, non-latin char behavior, font issues, UI broken by longer translation, context dependent translation, etc. Every time I start a project or think about it I'm sweating.
Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#37Translation/Internationalisation is one of the hardest problem that is not going to be solved by technology only. RTL, plural depending on the number, non-latin char behavior, font issues, UI broken by longer translation, context dependent translation, etc. Every time I start a project or think about it I'm sweating.
Buttons are gonna look jacked up in German because all their words are 45 letters long. RTL plays havoc with the layout. Referring to Taiwan the wrong way is a Defcon 2 political crisis. And on and on and on, it never fucking ends.
Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#38I've found that I need to support localization from the very start. I never display a quoted string. I always use Apple's tokenization (or create my own, if doing server code). Apple has terrific support for localization, which puts the onus on us, to honor it. I have some basic extensions that I use to support localization in my coding[0-2], but there's also just stuff I need to keep in mind, all the time. There has…
The code example should rather be an example of what not to do. This method of concatenating different parts of sentences would fall short for any language where the adjective and noun change the form depending on each other and the context (ex. cases). Most Slavic languages make heavy use of this concept. The solution is to just have the full sentence as a single string and let the translation team write it out in i…
print("The white horse")
I would gently suggest taking the spirit of our Ts and Cs into account, when critiquing others.I was simply sharing a quick technique that may not be known by some folks (the "$" in sprintf). It can definitely have uses.
I've been writing localized software for over thirty years. I worked for a Japanese corporation that localized into more than 20 languages (including RTL and up/down). Pretty much everything I write is localized up the yin-yang. Even my test harnesses are usually localized, as I like to keep the habit of writing localized software. I've written systems that have been adopted worldwide, in many different languages, and are still in use (and expanding), many, many years later.
There's a teensy little chance that I may have something valid to contribute to the topic.
Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#39With formatjs [0], you don't have to split the sentence for interpolation. The same example as in the article can be implemented as: const message = defineMessage({ defaultMessage: 'Learn more about supported images .', description: 'Footer text containing a hyperlink', }) and the anchor element can be interpolated as: formatMessage(message, { a: (chunks: ReactNode) => {chunks} , }) [0]: https://formatjs.io
My weapon of choice is i18next, which elegantly handles inline markup, even nested translations really well (although this example has less than ideal keys) Hello {{name}} , you have {{count}} unread message. Go to messages .
There are translations to "Hello" in Portuguese but I'd cringe at being greeted with them by a webmail client instead of the more formal Good Morning/Afternoon.
The formal/informal gradient is very culture-bound and even hard to pin to a scalar space of possibilities. In a work environment people will fluently code-switch too -- say, between ranks or in the middle of a tiresome meeting when everyone takes five minutes to kick back and comment on lighter matters. It's hard to situate a computer in this social context.
Re: Lessons From Linguistics: i18n Best Practices for Front-End Developers
#40Translation/Internationalisation is one of the hardest problem that is not going to be solved by technology only. RTL, plural depending on the number, non-latin char behavior, font issues, UI broken by longer translation, context dependent translation, etc. Every time I start a project or think about it I'm sweating.