3 ms·
> Even if you're looking up strings based on IDs in another file (which is a good pattern) […] putting printf format strings also as localized data. AFAIK loca
by masklinn 9y ago
> Even if you're looking up strings based on IDs in another file (which is a good pattern) […] putting printf format strings also as localized data.
AFAIK localising "formatting literals" is the more normal method, it avoids redundancies as you don't need two different systems (ids and format strings) and provide more flexibility with respect to e.g. cardinalities. Most ID-based systems bundle formatting support as well, if you're using an ID-based system you basically shouldn't call the language's string formatting functions.
Furthermore translating literal sections individually (without formatting context) will often yield an incorrect result as the entire phrase needs to be shuffled around, or words need to be inflected, or a literal translation suitable for "standalone" expressions does not work for the entire phrase.
More granular is generally worse for translations.
- TeMPOraL 9y ago> AFAIK localising "formatting literals" is the more normal method, it avoids redundancies as you don't need two different systems I never understood why people think this is a good idea. The exact same sequence of letters in an English phrase, which you would like to use instead of IDs, can mean two different things in two different places - and those two different meaning could have different forms in other languages. Denormalizing translation database like that seems semantically incorrect (and strikes me as programmer laziness). I agree that in general, more granular is worse for translations - there's too much risk your split will pierce the contextual whole that's required for some translations.
- rocqua 9y agoI'd expect this to happen when there is a split in the original case as well. E.g. you need to translate the template and the names. They are split in the original already, so they are translated as a split. The same contextual issue then arises in the original, but apparently the designers thought the trade-of was worth it.
- masklinn 9y ago> I never understood why people think this is a good idea. It makes for a more readable, comprehensible source and searchable source. It's also often possible to dispatch on location additionally to text (PO files store both).