News for hackers. Stuff that matters.
Re:Internationalization (i18n) best practices for front-end ... by worklaptopacct on Friday August 11, 2023 @08:44AM (#37088074)
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 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.
Re:Internationalization (i18n) best practices for front-end ... by Etheryte on Friday August 11, 2023 @09:13AM (#37088306)
Most 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#Con...

[1] https://formatjs.io/docs/intl/#message-descriptor

Re:Internationalization (i18n) best practices for front-end ... by holoduke on Friday August 11, 2023 @02:59PM (#37092487)
If 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.
Re:Internationalization (i18n) best practices for front-end ... by Kerrick on Friday August 11, 2023 @10:57AM (#37089412)
For 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.
Re:Internationalization (i18n) best practices for front-end ... by fjkdlsjflkds on Friday August 11, 2023 @11:11AM (#37089571)
Yes, 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").

Re:Internationalization (i18n) best practices for front-end ... by p3rls on Friday August 11, 2023 @12:16PM (#37090406)
In 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)
Re:Internationalization (i18n) best practices for front-end ... by dejj on Friday August 11, 2023 @01:19PM (#37091207)
What does PIEish mean?
Re:Internationalization (i18n) best practices for front-end ... by mablopoule on Friday August 11, 2023 @01:48PM (#37091597)
Not op, but I think it stands for Proto-Indo-European language.