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 updater
|
|
|
|
*
|
2021-05-28 13:55:03 +02:00
|
|
|
* This command will create a new or update any existing gettext catalog of a module.
|
2014-01-30 10:51:10 +01:00
|
|
|
*
|
2021-05-28 13:55:03 +02:00
|
|
|
* Once a catalog has been created/updated one can open it with a editor for
|
2014-01-30 10:51:10 +01:00
|
|
|
* PO-files and start with the actual translation.
|
|
|
|
*/
|
|
|
|
class RefreshCommand extends TranslationCommand
|
|
|
|
{
|
|
|
|
/**
|
2021-05-28 13:55:03 +02:00
|
|
|
* Generate or update a module gettext catalog
|
2014-01-30 10:51:10 +01:00
|
|
|
*
|
2021-05-28 13:55:03 +02:00
|
|
|
* This will create/update the PO-file 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 refresh module <module> <locale>
|
2014-01-30 10:51:10 +01:00
|
|
|
*
|
|
|
|
* EXAMPLES:
|
|
|
|
*
|
2021-05-28 13:55:03 +02:00
|
|
|
* icingacli translation refresh module demo de_DE
|
|
|
|
* icingacli translation refresh module 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->updateModuleTranslations($module);
|
|
|
|
}
|
|
|
|
}
|