| Total Complexity | 65 |
| Total Lines | 557 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
Complex classes like GettextCommand often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use GettextCommand, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 30 | class GettextCommand extends Command |
||
| 31 | { |
||
| 32 | /** |
||
| 33 | * The Po results |
||
| 34 | * |
||
| 35 | * @var array |
||
| 36 | */ |
||
| 37 | protected $poResult = []; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * The template paths |
||
| 41 | * |
||
| 42 | * @var array |
||
| 43 | */ |
||
| 44 | protected $templatePaths = []; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * The locale path |
||
| 48 | * |
||
| 49 | * @var string |
||
| 50 | */ |
||
| 51 | protected $localePath = null; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * The name of default domain if not specified. Used for pot and po file names. |
||
| 55 | * |
||
| 56 | * @var string |
||
| 57 | */ |
||
| 58 | protected $defaultDomain = 'default'; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @inheritDoc |
||
| 62 | */ |
||
| 63 | public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser |
||
| 64 | { |
||
| 65 | return parent::buildOptionParser($parser) |
||
| 66 | ->setDescription([ |
||
| 67 | 'Create or update i18n po/pot files', |
||
| 68 | '', |
||
| 69 | '`bin/cake gettext`: update files for current app', |
||
| 70 | '`bin/cake gettext -app <app path>`: update files for the app', |
||
| 71 | '`bin/cake gettext -plugin <plugin name>`: update files for the plugin', |
||
| 72 | ]) |
||
| 73 | ->addOption('app', [ |
||
| 74 | 'help' => 'The app path, for i18n update.', |
||
| 75 | 'short' => 'a', |
||
| 76 | 'required' => false, |
||
| 77 | ]) |
||
| 78 | ->addOption('plugin', [ |
||
| 79 | 'help' => 'The plugin name, for i18n update.', |
||
| 80 | 'short' => 'p', |
||
| 81 | 'required' => false, |
||
| 82 | ]); |
||
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * Get po result. |
||
| 87 | * |
||
| 88 | * @return array |
||
| 89 | */ |
||
| 90 | public function getPoResult(): array |
||
| 91 | { |
||
| 92 | return $this->poResult; |
||
| 93 | } |
||
| 94 | |||
| 95 | /** |
||
| 96 | * Get templatePaths. |
||
| 97 | * |
||
| 98 | * @return array |
||
| 99 | */ |
||
| 100 | public function getTemplatePaths(): array |
||
| 101 | { |
||
| 102 | return $this->templatePaths; |
||
| 103 | } |
||
| 104 | |||
| 105 | /** |
||
| 106 | * Get localePath |
||
| 107 | * |
||
| 108 | * @return string |
||
| 109 | */ |
||
| 110 | public function getLocalePath(): string |
||
| 111 | { |
||
| 112 | return $this->localePath; |
||
| 113 | } |
||
| 114 | |||
| 115 | /** |
||
| 116 | * Update gettext po files. |
||
| 117 | * |
||
| 118 | * @param \Cake\Console\Arguments $args The command arguments. |
||
| 119 | * @param \Cake\Console\ConsoleIo $io The console io |
||
| 120 | * @return null|void|int The exit code or null for success |
||
| 121 | */ |
||
| 122 | public function execute(Arguments $args, ConsoleIo $io) |
||
| 123 | { |
||
| 124 | $resCmd = []; |
||
| 125 | exec('which msgmerge 2>&1', $resCmd); |
||
| 126 | if (empty($resCmd[0])) { |
||
| 127 | $io->abort('ERROR: msgmerge not available. Please install gettext utilities.'); |
||
| 128 | } |
||
| 129 | |||
| 130 | $io->out('Updating .pot and .po files...'); |
||
| 131 | |||
| 132 | $this->setupPaths($args); |
||
| 133 | foreach ($this->templatePaths as $path) { |
||
| 134 | $io->out(sprintf('Search in: %s', $path)); |
||
| 135 | $this->parseDir($path); |
||
| 136 | } |
||
| 137 | |||
| 138 | $io->out('Creating master .pot file'); |
||
| 139 | $this->writeMasterPot($io); |
||
| 140 | $this->ttagExtract($args, $io); |
||
| 141 | |||
| 142 | $io->hr(); |
||
| 143 | $io->out('Merging master .pot with current .po files'); |
||
| 144 | $io->hr(); |
||
| 145 | |||
| 146 | $this->writePoFiles($io); |
||
| 147 | |||
| 148 | $io->out('Done'); |
||
| 149 | |||
| 150 | return null; |
||
| 151 | } |
||
| 152 | |||
| 153 | /** |
||
| 154 | * Setup template paths and locale path |
||
| 155 | * |
||
| 156 | * @param \Cake\Console\Arguments $args The command arguments. |
||
| 157 | * @return void |
||
| 158 | */ |
||
| 159 | private function setupPaths(Arguments $args): void |
||
| 160 | { |
||
| 161 | $appTemplates = (array)Configure::read('App.paths.templates'); |
||
| 162 | $plugin = $args->getOption('plugin'); |
||
| 163 | if ($plugin) { |
||
| 164 | $f = new Folder(sprintf('%s%s', (string)Configure::read('App.paths.plugins.0'), $plugin)); |
||
| 165 | $basePath = $f->path; |
||
| 166 | $this->defaultDomain = $plugin; |
||
| 167 | $this->templatePaths = [$basePath . '/src', $basePath . '/config']; |
||
| 168 | $appTemplatePath = (string)Hash::get($appTemplates, '1'); |
||
| 169 | if (strpos($appTemplatePath, $basePath . '/src') === false) { |
||
| 170 | $this->templatePaths[] = $appTemplatePath; |
||
| 171 | } |
||
| 172 | $this->localePath = (string)Configure::read('App.paths.locales.1'); |
||
| 173 | |||
| 174 | return; |
||
| 175 | } |
||
| 176 | $app = $args->getOption('app') ?? getcwd(); |
||
| 177 | $f = new Folder($app); |
||
| 178 | $basePath = $f->path; |
||
| 179 | $this->templatePaths = [$basePath . '/src', $basePath . '/config']; |
||
| 180 | $appTemplatePath = (string)Hash::get($appTemplates, '0'); |
||
| 181 | if (strpos($appTemplatePath, $basePath . '/src') === false) { |
||
| 182 | $this->templatePaths[] = $appTemplatePath; |
||
| 183 | } |
||
| 184 | $this->localePath = (string)Configure::read('App.paths.locales.0'); |
||
| 185 | } |
||
| 186 | |||
| 187 | /** |
||
| 188 | * Write `master.pot` file |
||
| 189 | * |
||
| 190 | * @param \Cake\Console\ConsoleIo $io The console io |
||
| 191 | * @return void |
||
| 192 | */ |
||
| 193 | private function writeMasterPot(ConsoleIo $io): void |
||
| 194 | { |
||
| 195 | foreach ($this->poResult as $domain => $poResult) { |
||
| 196 | $potFilename = sprintf('%s/%s.pot', $this->localePath, $domain); |
||
| 197 | $io->out(sprintf('Writing new .pot file: %s', $potFilename)); |
||
| 198 | $pot = new File($potFilename, true); |
||
| 199 | $pot->write($this->header('pot')); |
||
| 200 | sort($poResult); |
||
| 201 | foreach ($poResult as $res) { |
||
| 202 | if (!empty($res)) { |
||
| 203 | $pot->write(sprintf('%smsgid "%s"%smsgstr ""%s', "\n", $res, "\n", "\n")); |
||
| 204 | } |
||
| 205 | } |
||
| 206 | $pot->close(); |
||
| 207 | } |
||
| 208 | } |
||
| 209 | |||
| 210 | /** |
||
| 211 | * Write `.po` files |
||
| 212 | * |
||
| 213 | * @param \Cake\Console\ConsoleIo $io The console io |
||
| 214 | * @return void |
||
| 215 | */ |
||
| 216 | private function writePoFiles(ConsoleIo $io): void |
||
| 217 | { |
||
| 218 | $header = $this->header('po'); |
||
| 219 | $locales = array_keys((array)Configure::read('I18n.locales', [])); |
||
| 220 | foreach ($locales as $loc) { |
||
| 221 | $potDir = $this->localePath . DS . $loc; |
||
| 222 | if (!file_exists($potDir)) { |
||
| 223 | mkdir($potDir); |
||
| 224 | } |
||
| 225 | $io->out(sprintf('Language: %s', $loc)); |
||
| 226 | |||
| 227 | foreach (array_keys($this->poResult) as $domain) { |
||
| 228 | $potFilename = sprintf('%s/%s.pot', $this->localePath, $domain); |
||
| 229 | $poFile = sprintf('%s/%s.po', $potDir, $domain); |
||
| 230 | if (!file_exists($poFile)) { |
||
| 231 | $newPoFile = new File($poFile, true); |
||
| 232 | $newPoFile->write($header); |
||
| 233 | $newPoFile->close(); |
||
| 234 | } |
||
| 235 | $io->out(sprintf('Merging %s', $poFile)); |
||
| 236 | $mergeCmd = sprintf('msgmerge --backup=off -N -U %s %s', $poFile, $potFilename); |
||
| 237 | exec($mergeCmd); |
||
| 238 | $this->analyzePoFile($poFile, $io); |
||
| 239 | $io->hr(); |
||
| 240 | } |
||
| 241 | } |
||
| 242 | } |
||
| 243 | |||
| 244 | /** |
||
| 245 | * Header lines for po/pot file |
||
| 246 | * |
||
| 247 | * @param string $type The file type (can be 'po', 'pot') |
||
| 248 | * @return string |
||
| 249 | * @codeCoverageIgnore |
||
| 250 | */ |
||
| 251 | private function header(string $type = 'po'): string |
||
| 252 | { |
||
| 253 | $result = sprintf('msgid ""%smsgstr ""%s', "\n", "\n"); |
||
| 254 | $contents = [ |
||
| 255 | 'po' => [ |
||
| 256 | 'Project-Id-Version' => 'BEdita 4', |
||
| 257 | 'POT-Creation-Date' => date('Y-m-d H:i:s'), |
||
| 258 | 'PO-Revision-Date' => '', |
||
| 259 | 'Last-Translator' => '', |
||
| 260 | 'Language-Team' => 'BEdita I18N & I10N Team', |
||
| 261 | 'Language' => '', |
||
| 262 | 'MIME-Version' => '1.0', |
||
| 263 | 'Content-Transfer-Encoding' => '8bit', |
||
| 264 | 'Plural-Forms' => 'nplurals=2; plural=(n != 1);', |
||
| 265 | 'Content-Type' => 'text/plain; charset=utf-8', |
||
| 266 | ], |
||
| 267 | 'pot' => [ |
||
| 268 | 'Project-Id-Version' => 'BEdita 4', |
||
| 269 | 'POT-Creation-Date' => date('Y-m-d H:i:s'), |
||
| 270 | 'MIME-Version' => '1.0', |
||
| 271 | 'Content-Transfer-Encoding' => '8bit', |
||
| 272 | 'Language-Team' => 'BEdita I18N & I10N Team', |
||
| 273 | 'Plural-Forms' => 'nplurals=2; plural=(n != 1);', |
||
| 274 | 'Content-Type' => 'text/plain; charset=utf-8', |
||
| 275 | ], |
||
| 276 | ]; |
||
| 277 | foreach ($contents[$type] as $k => $v) { |
||
| 278 | $result .= sprintf('"%s: %s \n"', $k, $v) . "\n"; |
||
| 279 | } |
||
| 280 | |||
| 281 | return $result; |
||
| 282 | } |
||
| 283 | |||
| 284 | /** |
||
| 285 | * Analyze po file and translate it |
||
| 286 | * |
||
| 287 | * @param string $filename The po file name |
||
| 288 | * @param \Cake\Console\ConsoleIo $io The console io |
||
| 289 | * @return void |
||
| 290 | */ |
||
| 291 | private function analyzePoFile($filename, ConsoleIo $io): void |
||
| 292 | { |
||
| 293 | $lines = file($filename); |
||
| 294 | $numItems = $numNotTranslated = 0; |
||
| 295 | foreach ($lines as $k => $l) { |
||
| 296 | if (strpos($l, 'msgid "') === 0) { |
||
| 297 | $numItems++; |
||
| 298 | } |
||
| 299 | if (strpos($l, 'msgstr ""') === 0) { |
||
| 300 | if (!isset($lines[$k + 1])) { |
||
| 301 | $numNotTranslated++; |
||
| 302 | } elseif (strpos($lines[$k + 1], '"') !== 0) { |
||
| 303 | $numNotTranslated++; |
||
| 304 | } |
||
| 305 | } |
||
| 306 | } |
||
| 307 | $translated = $numItems - $numNotTranslated; |
||
| 308 | $percent = 0; |
||
| 309 | if ($numItems > 0) { |
||
| 310 | $percent = number_format($translated * 100. / $numItems, 1); |
||
| 311 | } |
||
| 312 | $io->out(sprintf('Translated %d of %d items - %s %%', $translated, $numItems, $percent)); |
||
| 313 | } |
||
| 314 | |||
| 315 | /** |
||
| 316 | * "fix" string - strip slashes, escape and convert new lines to \n |
||
| 317 | * |
||
| 318 | * @param string $str The string |
||
| 319 | * @return string The new string |
||
| 320 | */ |
||
| 321 | private function fixString($str): string |
||
| 322 | { |
||
| 323 | $str = stripslashes($str); |
||
| 324 | $str = str_replace('"', '\"', $str); |
||
| 325 | $str = str_replace("\n", '\n', $str); |
||
| 326 | $str = str_replace('|||||', "'", $str); // special sequence used in parseContent to temporarily replace "\'" |
||
| 327 | |||
| 328 | return $str; |
||
| 329 | } |
||
| 330 | |||
| 331 | /** |
||
| 332 | * Parse file and rips gettext strings |
||
| 333 | * |
||
| 334 | * @param string $file The file name |
||
| 335 | * @param string $extension The file extension |
||
| 336 | * @return void |
||
| 337 | */ |
||
| 338 | private function parseFile($file, $extension) |
||
| 339 | { |
||
| 340 | if (!in_array($extension, ['php', 'twig'])) { |
||
| 341 | return; |
||
| 342 | } |
||
| 343 | $content = file_get_contents($file); |
||
| 344 | if (empty($content)) { |
||
| 345 | return; |
||
| 346 | } |
||
| 347 | |||
| 348 | $functions = [ |
||
| 349 | '__' => 0, // __( string $singular , ... $args ) |
||
| 350 | '__n' => 0, // __n( string $singular , string $plural , integer $count , ... $args ) |
||
| 351 | '__d' => 1, // __d( string $domain , string $msg , ... $args ) |
||
| 352 | '__dn' => 1, // __dn( string $domain , string $singular , string $plural , integer $count , ... $args ) |
||
| 353 | '__x' => 1, // __x( string $context , string $singular , ... $args ) |
||
| 354 | '__xn' => 1, // __xn( string $context , string $singular , string $plural , integer $count , ... $args ) |
||
| 355 | '__dx' => 2, // __dx( string $domain , string $context , string $msg , ... $args ) |
||
| 356 | '__dxn' => 2, // __dxn( string $domain , string $context , string $singular , string $plural , integer $count , ... $args ) |
||
| 357 | ]; |
||
| 358 | |||
| 359 | // temporarily replace "\'" with "|||||", fixString will replace "|||||" with "\'" |
||
| 360 | // this fixes wrongly matched data in the following regexp |
||
| 361 | $content = str_replace("\'", '|||||', $content); |
||
| 362 | |||
| 363 | $options = [ |
||
| 364 | 'open_parenthesis' => preg_quote('('), |
||
| 365 | 'quote' => preg_quote("'"), |
||
| 366 | 'double_quote' => preg_quote('"'), |
||
| 367 | ]; |
||
| 368 | |||
| 369 | foreach ($functions as $fname => $singularPosition) { |
||
| 370 | if ($singularPosition === 0) { |
||
| 371 | $this->parseContent($fname, $content, $options); |
||
| 372 | } elseif ($singularPosition === 1) { |
||
| 373 | $this->parseContentSecondArg($fname, $content, $options); |
||
| 374 | } elseif ($singularPosition === 2) { |
||
| 375 | $this->parseContentThirdArg($fname, $content, $options); |
||
| 376 | } |
||
| 377 | } |
||
| 378 | } |
||
| 379 | |||
| 380 | /** |
||
| 381 | * Parse file content and put i18n data in poResult array |
||
| 382 | * |
||
| 383 | * @param string $start The starting string to search for, the name of the translation method |
||
| 384 | * @param string $content The file content |
||
| 385 | * @param array $options The options |
||
| 386 | * @return void |
||
| 387 | */ |
||
| 388 | private function parseContent($start, $content, $options): void |
||
| 389 | { |
||
| 390 | // phpcs:disable |
||
| 391 | $rgxp = '/' . |
||
| 392 | "${start}\s*{$options['open_parenthesis']}\s*{$options['double_quote']}" . "([^{$options['double_quote']}]*)" . "{$options['double_quote']}" . |
||
| 393 | '|' . |
||
| 394 | "${start}\s*{$options['open_parenthesis']}\s*{$options['quote']}" . "([^{$options['quote']}]*)" . "{$options['quote']}" . |
||
| 395 | '/'; |
||
| 396 | // phpcs:enable |
||
| 397 | $matches = []; |
||
| 398 | preg_match_all($rgxp, $content, $matches); |
||
| 399 | |||
| 400 | $domain = $this->defaultDomain; |
||
| 401 | |||
| 402 | $limit = count($matches[0]); |
||
| 403 | for ($i = 0; $i < $limit; $i++) { |
||
| 404 | $item = $this->fixString($matches[1][$i]); |
||
| 405 | if (empty($item)) { |
||
| 406 | $item = $this->fixString($matches[2][$i]); |
||
| 407 | } |
||
| 408 | |||
| 409 | if (!array_key_exists($domain, $this->poResult)) { |
||
| 410 | $this->poResult[$domain] = []; |
||
| 411 | } |
||
| 412 | |||
| 413 | if (!in_array($item, $this->poResult[$domain])) { |
||
| 414 | $this->poResult[$domain][] = $item; |
||
| 415 | } |
||
| 416 | } |
||
| 417 | } |
||
| 418 | |||
| 419 | /** |
||
| 420 | * Parse file content and put i18n data in poResult array |
||
| 421 | * |
||
| 422 | * @param string $start The starting string to search for, the name of the translation method |
||
| 423 | * @param string $content The file content |
||
| 424 | * @param array $options The options |
||
| 425 | * @return void |
||
| 426 | */ |
||
| 427 | private function parseContentSecondArg($start, $content, $options): void |
||
| 428 | { |
||
| 429 | // phpcs:disable |
||
| 430 | $rgxp = |
||
| 431 | '/' . "${start}\s*{$options['open_parenthesis']}\s*{$options['double_quote']}" . '([^{)}]*)' . "{$options['double_quote']}" . |
||
| 432 | '|' . "${start}\s*{$options['open_parenthesis']}\s*{$options['quote']}" . '([^{)}]*)' . "{$options['quote']}" . |
||
| 433 | '/'; |
||
| 434 | // phpcs:enable |
||
| 435 | $matches = []; |
||
| 436 | preg_match_all($rgxp, $content, $matches); |
||
| 437 | |||
| 438 | $limit = count($matches[0]); |
||
| 439 | for ($i = 0; $i < $limit; $i++) { |
||
| 440 | $str = $matches[2][$i]; |
||
| 441 | // context not handled yet |
||
| 442 | $domain = strpos($start, '__x') === 0 ? $this->defaultDomain : substr(trim($str), 0, strpos($str, ',') - 1); |
||
| 443 | if (substr_count($matches[2][0], ',') === 1) { |
||
| 444 | $str = substr(trim(substr($str, strpos($str, ',') + 1)), 1); |
||
| 445 | } elseif (substr_count($matches[2][0], ',') === 2) { |
||
| 446 | $str = trim(substr($str, strpos($str, ',') + 1)); |
||
| 447 | $str = trim(substr($str, 0, strpos($str, ','))); |
||
| 448 | $str = substr($str, 1, -1); |
||
| 449 | } |
||
| 450 | $item = $this->fixString($str); |
||
| 451 | |||
| 452 | if (!array_key_exists($domain, $this->poResult)) { |
||
| 453 | $this->poResult[$domain] = []; |
||
| 454 | } |
||
| 455 | |||
| 456 | if (!in_array($item, $this->poResult[$domain])) { |
||
| 457 | $this->poResult[$domain][] = $item; |
||
| 458 | } |
||
| 459 | } |
||
| 460 | } |
||
| 461 | |||
| 462 | /** |
||
| 463 | * Parse file content and put i18n data in poResult array |
||
| 464 | * |
||
| 465 | * @param string $start The starting string to search for, the name of the translation method |
||
| 466 | * @param string $content The file content |
||
| 467 | * @param array $options The options |
||
| 468 | * @return void |
||
| 469 | */ |
||
| 470 | private function parseContentThirdArg($start, $content, $options): void |
||
| 471 | { |
||
| 472 | // phpcs:disable |
||
| 473 | $rgxp = |
||
| 474 | '/' . "${start}\s*{$options['open_parenthesis']}\s*{$options['double_quote']}" . '([^{)}]*)' . "{$options['double_quote']}" . |
||
| 475 | '|' . "${start}\s*{$options['open_parenthesis']}\s*{$options['quote']}" . '([^{)}]*)' . "{$options['quote']}" . |
||
| 476 | '/'; |
||
| 477 | // phpcs:enable |
||
| 478 | $matches = []; |
||
| 479 | preg_match_all($rgxp, $content, $matches); |
||
| 480 | |||
| 481 | $domain = $this->defaultDomain; // domain and context not handled yet |
||
| 482 | |||
| 483 | $limit = count($matches[0]); |
||
| 484 | for ($i = 0; $i < $limit; $i++) { |
||
| 485 | $str = $matches[2][$i]; |
||
| 486 | $pos = $this->strposX($str, ',', 2); |
||
| 487 | $str = trim(substr($str, $pos + 1)); |
||
| 488 | if (strpos($str, ',') > 0) { |
||
| 489 | $str = substr($str, 1, strpos($str, ',') - 2); |
||
| 490 | } else { |
||
| 491 | $str = substr($str, 1); |
||
| 492 | } |
||
| 493 | $item = $this->fixString($str); |
||
| 494 | |||
| 495 | if (!array_key_exists($domain, $this->poResult)) { |
||
| 496 | $this->poResult[$domain] = []; |
||
| 497 | } |
||
| 498 | |||
| 499 | if (!in_array($item, $this->poResult[$domain])) { |
||
| 500 | $this->poResult[$domain][] = $item; |
||
| 501 | } |
||
| 502 | } |
||
| 503 | } |
||
| 504 | |||
| 505 | /** |
||
| 506 | * Calculate nth ($number) position of $needle in $haystack. |
||
| 507 | * |
||
| 508 | * @param string $haystack The haystack where to search |
||
| 509 | * @param string $needle The needle to search |
||
| 510 | * @param int $number The nth position to retrieve |
||
| 511 | * @return int|false |
||
| 512 | */ |
||
| 513 | private function strposX($haystack, $needle, $number = 0) |
||
| 520 | ); |
||
| 521 | } |
||
| 522 | |||
| 523 | /** |
||
| 524 | * Parse a directory |
||
| 525 | * |
||
| 526 | * @param string $dir The directory |
||
| 527 | * @return void |
||
| 528 | */ |
||
| 529 | private function parseDir($dir): void |
||
| 530 | { |
||
| 531 | $folder = new Folder($dir); |
||
| 532 | $tree = $folder->tree($dir, false); |
||
| 533 | foreach ($tree as $files) { |
||
| 534 | foreach ($files as $file) { |
||
| 535 | if (!is_dir($file)) { |
||
| 536 | $f = new File($file); |
||
| 537 | $info = $f->info(); |
||
| 538 | if (isset($info['extension'])) { |
||
| 539 | $this->parseFile($file, $info['extension']); |
||
| 540 | } |
||
| 541 | } |
||
| 542 | } |
||
| 543 | } |
||
| 544 | } |
||
| 545 | |||
| 546 | /** |
||
| 547 | * Extract translations from javascript files using ttag, if available. |
||
| 548 | * |
||
| 549 | * @param \Cake\Console\Arguments $args The command arguments. |
||
| 550 | * @param \Cake\Console\ConsoleIo $io The console io |
||
| 551 | * @return void |
||
| 552 | * @codeCoverageIgnore |
||
| 553 | */ |
||
| 554 | private function ttagExtract(Arguments $args, ConsoleIo $io): void |
||
| 587 | } |
||
| 588 | } |
||
| 589 |