gettext() equivalent in Intl library?

后端 未结 3 753
梦如初夏
梦如初夏 2020-12-31 09:35

I\'m looking for a way to to do i18n and l10n.

I\'ve used gettext before and it was good: I would simply create .mo files in different languages and ever

3条回答
  •  抹茶落季
    2020-12-31 10:01

    That advise wasn't very truthful. The intl functions can be used in conjunction to gettext, not as replacement.

    MessageFormatter is what people have in mind when they associate INTL with text translations. The examples suggest so. But in reality it's just a sprintf on steroids. It injects numbers into existing strings. (I'm not even sure how the locale support is of any use there, as it just serves as internal switch.)

提交回复
热议问题