Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/docker-ci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-02-13 02:46:41 +0300
committerMorris Jobke <hey@morrisjobke.de>2018-02-13 02:46:41 +0300
commit425a0a06dfff1eb225c67259cb9203ccda1d666c (patch)
tree60f4d9d9575952289ae1a87f203bfacba0329909
parentf1675ae85d3855be77af98cd2430eb1d842c6359 (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.php21
-rwxr-xr-xtranslations/translationtool/translationtool.pharbin387058 -> 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
index 46aa8fe..a882b14 100755
--- a/translations/translationtool/translationtool.phar
+++ b/translations/translationtool/translationtool.phar
Binary files differ