3 ms·
Internationalization, usually. Word order differs between languages, and this kind of format allows reordering the inserted values.
by Animats 10y ago
Internationalization, usually. Word order differs between languages, and this kind of format allows reordering the inserted values.
- zbraniecki 10y agoInternationalization should never use arbitrary string or system level formatting. Look at MessageFormat or L20n. Yeah, I know that it's more complex than what you think you need (I've hear the "let's just use JS template literals" so many times) but you actually do.
- coldtea 10y agoYes, but that's meant for trusted translators of the UI, nor arbitrary users, right?
- icebraining 10y agoIn some applications, users can change the their own translations, which are stored in the DB, to allow for easier customization.
- coldtea 10y agoStill, no reason to save them in the platforms native string format and with full reign over native strings.
- azernik 10y agoIn practice, translators are often externally contracted; the amount of work required to translate any given language is not large enough to make these full-time positions. So only trusted so far.
- Manishearth 10y agoA lot of folks do use lang format strings for i18n, but they really shouldn't. They won't be able to handle pluralization and other oddities.