From 05b1901fcdbb051077d12f776980484d3b782970 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 4 Nov 2017 21:17:08 +0100 Subject: Move translation tools into the cli folder (#1673) Translation tools must be used on cli. It is better to have them in the cli folder. --- cli/manipulate.translation.php | 79 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 cli/manipulate.translation.php (limited to 'cli/manipulate.translation.php') diff --git a/cli/manipulate.translation.php b/cli/manipulate.translation.php new file mode 100644 index 000000000..aace5723a --- /dev/null +++ b/cli/manipulate.translation.php @@ -0,0 +1,79 @@ +load(); + +switch ($argv[1]) { + case 'add_language' : + $i18nData->addLanguage($argv[2]); + break; + case 'add_key' : + if (3 === $argc) { + help(); + } + $i18nData->addKey($argv[2], $argv[3]); + break; + case 'duplicate_key' : + $i18nData->duplicateKey($argv[2]); + break; + case 'delete_key' : + $i18nData->removeKey($argv[2]); + break; + default : + help(); +} + +if ($i18nData->hasChanged()) { + $i18nFile->dump($i18nData); +} + +/** + * Output help message. + */ +function help() { + $help = <<