diff --git a/modules/translation/application/clicommands/TestCommand.php b/modules/translation/application/clicommands/TestCommand.php index 3e395286e..347c2c9f8 100644 --- a/modules/translation/application/clicommands/TestCommand.php +++ b/modules/translation/application/clicommands/TestCommand.php @@ -6,7 +6,8 @@ namespace Icinga\Module\Translation\Clicommands; use Icinga\Date\DateFormatter; use Icinga\Module\Translation\Cli\ArrayToTextTableHelper; use Icinga\Module\Translation\Cli\TranslationCommand; -use Icinga\Util\Translator; +use ipl\I18n\GettextTranslator; +use ipl\I18n\StaticTranslator; /** * Timestamp test helper @@ -89,12 +90,19 @@ class TestCommand extends TranslationCommand foreach ($this->params->getAllStandalone() as $l) { $this->locales[] = $l; } - // TODO: get from to environment by default? + + if (empty($this->locales)) { + /** @var GettextTranslator $translator */ + $translator = StaticTranslator::$instance; + $this->locales = $translator->listLocales(); + } } - protected function callTranslated($callback, $arguments, $locale = 'C') + protected function callTranslated($callback, $arguments, $locale = 'en_US') { - Translator::setupLocale($locale); + /** @var GettextTranslator $translator */ + $translator = StaticTranslator::$instance; + $translator->setLocale($locale); return call_user_func_array($callback, $arguments); } diff --git a/modules/translation/library/Translation/Util/GettextTranslationHelper.php b/modules/translation/library/Translation/Util/GettextTranslationHelper.php index 90b8f1104..d1e6ac287 100644 --- a/modules/translation/library/Translation/Util/GettextTranslationHelper.php +++ b/modules/translation/library/Translation/Util/GettextTranslationHelper.php @@ -235,8 +235,12 @@ class GettextTranslationHelper '--language=PHP', '--keyword=translate', '--keyword=translate:1,2c', + '--keyword=translateInDomain:2', + '--keyword=translateInDomain:2,3c', '--keyword=translatePlural:1,2', '--keyword=translatePlural:1,2,4c', + '--keyword=translatePluralInDomain:2,3', + '--keyword=translatePluralInDomain:2,3,5c', '--keyword=mt:2', '--keyword=mt:2,3c', '--keyword=mtp:2,3',