Hacker News new | past | comments | ask | show | jobs | submit login

> An interesting point about i18n that is quite independent from the tool selection is how you write your message identifiers. You can basically use labels (i.e, an ID for the string) or use the "original" string.

> Here's the tradeoff: if you use an ID, you must reference the application constantly to understand what the translation should say (and in any non trivial application, this is a huge burden for translators), and there is either no string reuse (because places with the same intended content have used different IDs), or the need for an anal curator to go around chastising developers ("the OK button should always be ACTION_BUTTON_LABEL_OK!! fix it!!"). On the other hand, if you use original strings in English you will find that you experience language collisions (two places where the original string in English is the same, but the translated one is not), so you end up resorting to introducing artificial differences to make them unique (i.e "Request (verb)" and "Request (substantive)" instead of just "Request").

The PO format uses the field "context" to differentiate among the various uses of a word/phrase. You should also add a comment for your translators in this case.

Also, using an ID messes with the PO format itself. E.g., fallbacks in case of a missing translation will not work.

But there are other formats that are ID-based, like .properties in Java.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: