4 ms·
Message identifiers force you to confront the fact that two messages which sound the same in English might not sound the same in other languages. I used an app
by miki123211 3y ago
Message identifiers force you to confront the fact that two messages which sound the same in English might not sound the same in other languages.
I used an app that used Gettext for translation and had this problem. The string "banned" appeared in two places, once as a filter (to only show online / moderator / banned users) and once as a status indicator on the list of users (to indicate that a given user is banned). In English, the word "banned" is the same regardless of whether you're referring to a single user or a group of users, but that isn' true in other languages.
If you're developing with Gettext, you usually get this wrong and then translators have all sorts of issues. If you use something like Fluent, the natural thing to do is to give the first string an identifier like `user_list_filter_banned` and the second an identifier of `user_status_banned`.
As far as I understand, Fluent also lets you pass seemingly extraneous data to translation strings (like the user's gender), which, in some languages, might be necessary to translate something like "%s has just sent you a new message."
- Gare 3y agoNot just gender, but also supports plural rules for numbers which is great even if you have just one language (for example "no user/one user/2 users"). No more hacky string manipulation in programming language!