3 ms·
My weapon of choice is i18next, which elegantly handles inline markup, even nested translations really well (although this example has less than ideal keys)
by Cthulhu_ 3y ago
My weapon of choice is i18next, which elegantly handles inline markup, even nested translations really well (although this example has less than ideal keys)
<Trans i18nKey="userMessagesUnread" count={count}>
Hello <strong title={t('nameTitle')}>{{name}}</strong>, you have {{count}} unread message. <Link to="/msgs">Go to messages</Link>.
</Trans>
- thanatropism 3y agoMy biggest issue with i18n is not the grammar. It's the sheer uncanny valley of it. There are translations to "Hello" in Portuguese but I'd cringe at being greeted with them by a webmail client instead of the more formal Good Morning/Afternoon. The formal/informal gradient is very culture-bound and even hard to pin to a scalar space of possibilities. In a work environment people will fluently code-switch too -- say, between ranks or in the middle of a tiresome meeting when everyone takes five minutes to kick back and comment on lighter matters. It's hard to situate a computer in this social context.