2014-01-30 10:51:10 +01:00
|
|
|
<?php
|
2016-02-08 15:41:00 +01:00
|
|
|
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
|
2014-01-30 10:51:10 +01:00
|
|
|
|
|
|
|
namespace Icinga\Module\Translation\Clicommands;
|
|
|
|
|
|
|
|
use Icinga\Module\Translation\Cli\TranslationCommand;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Translation compiler
|
|
|
|
*
|
2021-05-28 13:55:03 +02:00
|
|
|
* This command will compile gettext catalogs of modules.
|
2014-01-30 10:51:10 +01:00
|
|
|
*
|
2021-05-28 13:55:03 +02:00
|
|
|
* Once a catalog is compiled its content is used by Icinga Web 2 to display
|
2014-01-30 10:51:10 +01:00
|
|
|
* messages in the configured language.
|
|
|
|
*/
|
|
|
|
class CompileCommand extends TranslationCommand
|
|
|
|
{
|
|
|
|
/**
|
2021-05-28 13:55:03 +02:00
|
|
|
* Compile a module gettext catalog
|
2014-01-30 10:51:10 +01:00
|
|
|
*
|
2021-05-28 13:55:03 +02:00
|
|
|
* This will compile the catalog of the given module and locale.
|
2014-01-30 10:51:10 +01:00
|
|
|
*
|
|
|
|
* USAGE:
|
|
|
|
*
|
2014-03-19 17:25:53 +01:00
|
|
|
* icingacli translation compile <module> <locale>
|
2014-01-30 10:51:10 +01:00
|
|
|
*
|
|
|
|
* EXAMPLES:
|
|
|
|
*
|
2021-05-28 13:55:03 +02:00
|
|
|
* icingacli translation compile demo de_DE
|
|
|
|
* icingacli translation compile demo fr_FR
|
2014-01-30 10:51:10 +01:00
|
|
|
*/
|
|
|
|
public function moduleAction()
|
|
|
|
{
|
|
|
|
$module = $this->validateModuleName($this->params->shift());
|
|
|
|
$locale = $this->validateLocaleCode($this->params->shift());
|
|
|
|
|
2015-07-30 15:47:35 +02:00
|
|
|
$helper = $this->getTranslationHelper($locale);
|
2014-01-30 10:51:10 +01:00
|
|
|
$helper->compileModuleTranslation($module);
|
|
|
|
}
|
|
|
|
}
|