help($argv); } function updateTranslations($argv) { $input = new lmbCliInput('t|test'); $input->read($argv, false); $dry_run = $input->isOptionPresent('t'); $input_dir = realpath($input->getArgument(0, '.')); if(!$input_dir) $this->_error('Input directory is not valid'); $output_dir = realpath($input->getArgument(1, $input_dir . '/i18n/translations')); if(!$output_dir) $this->_error('Output directory is not valid'); $qt = new lmbQtDictionaryBackend(); $qt->setSearchPath($output_dir); $util = new lmbDictionaryUpdater($qt, $this->output); if($dry_run) $util->dryrun($input_dir); else $util->updateTranslations($input_dir); return 0; } function ut($argv) { return $this->updateTranslations($argv); } function help($argv) { $txt = <<] [] Updates all translation dictionaries with new untranslated entries(currently only Qt dictionaries supported). Parses PHP and WACT templates sources in (current dir . by default) and updates dictionaries in (./i18n/translations by default) Options: -t, --test performs 'dry-run' without updating dictionaries, useful for previewing updates EOD; echo $txt; } } ?>