diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-02-13 02:46:41 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-02-13 02:46:41 +0300 |
commit | 425a0a06dfff1eb225c67259cb9203ccda1d666c (patch) | |
tree | 60f4d9d9575952289ae1a87f203bfacba0329909 | |
parent | f1675ae85d3855be77af98cd2430eb1d842c6359 (diff) |
Allow to use vue/ts/tsx/jsx files with l10n stringstranslations-20
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r-- | translations/translationtool/src/translationtool.php | 21 | ||||
-rwxr-xr-x | translations/translationtool/translationtool.phar | bin | 387058 -> 387210 bytes |
2 files changed, 13 insertions, 8 deletions
diff --git a/translations/translationtool/src/translationtool.php b/translations/translationtool/src/translationtool.php index 31fe249..6639e22 100644 --- a/translations/translationtool/src/translationtool.php +++ b/translations/translationtool/src/translationtool.php @@ -55,17 +55,17 @@ class TranslatableApp { $output = '--output=' . escapeshellarg($pathToPotFile); $keywords = ''; - if (substr($entry, -3) === '.js') { - $keywords = '--keyword=t:2 --keyword=n:2,3'; - } else { + if (substr($entry, -4) === '.php') { $keywords = '--keyword=t --keyword=n:1,2'; + } else { + $keywords = '--keyword=t:2 --keyword=n:2,3'; } $language = '--language='; - if (substr($entry, -3) === '.js') { - $language .= 'Javascript'; - } else { + if (substr($entry, -4) === '.php') { $language .= 'PHP'; + } else { + $language .= 'Javascript'; } $joinexisting = ''; @@ -162,11 +162,16 @@ class TranslatableApp { if (in_array($newPath, $this->ignoreFiles)) { continue; } - if (is_dir($newRealPath) && $entry != 'l10n') { + if (is_dir($newRealPath) && $entry != 'l10n' && $entry != 'node_modules') { $this->findTranslatableFiles($newPath); } if (is_file($newRealPath)) { - if (substr($entry, -4) === '.php' || (substr($entry, -3) === '.js' && substr($entry, -7) !== '.min.js')) { + if (substr($entry, -4) === '.php' || + (substr($entry, -3) === '.js' && substr($entry, -7) !== '.min.js') || + substr($entry, -4) === '.vue' || + substr($entry, -4) === '.jsx' || + substr($entry, -3) === '.ts' || + substr($entry, -4) === '.tsx') { $this->translatableFiles[] = $newRealPath; } } diff --git a/translations/translationtool/translationtool.phar b/translations/translationtool/translationtool.phar Binary files differindex 46aa8fe..a882b14 100755 --- a/translations/translationtool/translationtool.phar +++ b/translations/translationtool/translationtool.phar |