3 ms·
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 everythi
by Etheryte 3y ago
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 to whatever you need to support otherwise: id and pseudo. The id locale should be an identity function so you (and the translator and everyone else) can open up a page and see what keys are used on that page. The pseudo locale should be either random or pseudorandom text and is good for both ensuring you haven't accidentally left something hardcoded as well as checking how your layout plays with different length strings. These ideas alone will get you most of the way most of the time, and they have the added benefit that they're straightforward to teach to juniors.
- worklaptopacct 3y agoCommon 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 been replaced". The translations in Cities: Skylines use the literal translation and this has always irked me; if the translator accepted "plumbing" as a context, it would have produced a correct translation.
- Etheryte 3y agoMost common translation tools already support this. From GNU gettext where it's called context [0], to FormatJS where it's called a description [1], all translation tools worth their salt support providing additional information about the usage. The problem is generally not on the tooling side but on the awareness side, if the person implementing the feature only speaks one language it's easy to overlook issues that wouldn't occur in their native language. [0] https://www.gnu.org/software/gettext/manual/gettext.html#Contexts https://www.gnu.org/software/gettext/manual/gettext.html#Con... [1] https://formatjs.io/docs/intl/#message-descriptor https://formatjs.io/docs/intl/#message-descriptor
- holoduke 3y agoIf you can tell me how to provide context in the google translation api i would be very happy. Dont think it exists. Only in the web version.
- Kerrick 3y agoFor what it's worth, the term "fresh water" has each of those separate connotations in American English too, and it can be just as context-dependent. Both "These fish belong in fresh water, not salt water" and "I put fresh water in the ice trays because the old stuff was stale" are valid contextually and linguistically.
- fjkdlsjflkds 3y agoYes, but it does not necessarily have those two connotations in other languages (which is the issue here). In Portuguese, if you want to say "fresh water" (as in, "low-salinity water"), you use the term "sweet water", rather than "fresh water" ("fresh water" can only be interpreted either as "cold water" or "non-stale water", but never as "low-salinity water").
- p3rls 3y agoIn English we have the term potable to designate drinkable water, which comes from an old PIEish verb meaning to drink that no one uses anymore and so it's often confused with "pottable" i.e., to be put into a pot, as in a game of pool (a non-aquatic table sport fyi)
- dejj 3y agoWhat does PIEish mean?
- mablopoule 3y agoNot op, but I think it stands for Proto-Indo-European language.
- atoav 3y agoFor special terminology an invaluable trick is to search for the wikipedia article in your language and switch the language if possible. Of course this has to be used with caution, but it can help you find the right variant of a word.
- Cicero22 3y agoA third dev locale worth considering is one which consists of random emojis. Makes it very easy to find hardcoded strings.
- the_imp 3y agoImplementing something like an "id" locale is a great idea. Just don't call it that; it's the locale code for Indonesian. Using a word that's longer than three characters like "identity" will help ensure that it won't conflict with a real locale.