gettext() equivalent in Intl library?

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 everything that needed to be translated would be in this notation:

echo __('string to be translated');

I know that there is Intl library built into PHP now, and I've been told that I should use it instead of gettext().

After reading through everything there is about Intl on php.net, I see that it has some nice features like locale handling, string comparison, number formatting, etc.

What I can't figure out is how I would handle regular string to string translation using Intl library. Any ideas?

12
задан BryanH 11 December 2012 в 17:30
поделиться