-
New
Gettext\GettextTranslator
to use the gettext extension of php with the same api thanGettext\Translator
.$translator = new Gettext\GettextTranslator(); $translator->loadDomain('messages', 'myApp/Locale'); echo $translator->gettext('hello world');
-
New method
Translator::register()
to ease the registry of the translator in the global functions://before: Gettext\Translator::initGettextFunctions($translator); //now: $translator->register();
-
New magic methods
addFrom[Extractor][File/String]
to add translations easily:$translations = Gettext\Translations::fromPoFile('locales.po'); $translations->addFromPhpCodeFile('template.php'); $translations->addFromJsCodeFile('app.js');