diff options
author | zorn-v <zorn7@yandex.ru> | 2022-10-30 14:25:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-30 14:25:37 +0300 |
commit | df9c8b92bbf2340f8be9f33c59d51f4071b5847b (patch) | |
tree | e67b88134a0e0acd7db27d75a30291eb6d7ca471 | |
parent | 8109b94ba1735548365aebb7d5dc88e64c15c1c0 (diff) |
Fix extract translatables from vue files
Fixes https://github.com/nextcloud/docker-ci/issues/457
Signed-off-by: zorn-v <zorn7@yandex.ru>
-rw-r--r-- | translations/translationtool/src/translationtool.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/translations/translationtool/src/translationtool.php b/translations/translationtool/src/translationtool.php index 684da01..ce0976f 100644 --- a/translations/translationtool/src/translationtool.php +++ b/translations/translationtool/src/translationtool.php @@ -327,9 +327,9 @@ class TranslatableApp { } // t - preg_match_all("/\Wt\s*\(\s*'([\w]+)',\s*'(.+)'/", $vueSource, $singleQuoteMatches); - preg_match_all("/\Wt\s*\(\s*\"([\w]+)\",\s*\"(.+)\"/", $vueSource, $doubleQuoteMatches); - preg_match_all("/\Wt\s*\(\s*\'([\w]+)\'\s*,\s*\`(.+)\`\s*\)/msU", $vueSource, $templateQuoteMatches); + preg_match_all("/\Wt\s*\(\s*'?([\w]+)'?,\s*'(.+)'/", $vueSource, $singleQuoteMatches); + preg_match_all("/\Wt\s*\(\s*\"?([\w]+)\"?,\s*\"(.+)\"/", $vueSource, $doubleQuoteMatches); + preg_match_all("/\Wt\s*\(\s*\'?([\w]+)\'?\s*,\s*\`(.+)\`\s*\)/msU", $vueSource, $templateQuoteMatches); $matches0 = array_merge($singleQuoteMatches[0], $doubleQuoteMatches[0], $templateQuoteMatches[0]); $matches2 = array_merge($singleQuoteMatches[2], $doubleQuoteMatches[2], $templateQuoteMatches[2]); foreach (array_keys($matches2) as $k) { @@ -339,9 +339,9 @@ class TranslatableApp { } // n - preg_match_all("/\Wn\s*\(\s*'([\w]+)',\s*'(.+)'\s*,\s*'(.+)'\s*(.+)/", $vueSource, $singleQuoteMatches); - preg_match_all("/\Wn\s*\(\s*\"([\w]+)\",\s*\"(.+)\"\s*,\s*\"(.+)\"\s*(.+)/", $vueSource, $doubleQuoteMatches); - preg_match_all("/\Wn\s*\(\s*\'([\w]+)\'\s*,\s*\`(.+)\`\s*,\s*\`(.+)\`\s*\)/msU", $vueSource, $templateQuoteMatches); + preg_match_all("/\Wn\s*\(\s*'?([\w]+)'?,\s*'(.+)'\s*,\s*'(.+)'\s*(.+)/", $vueSource, $singleQuoteMatches); + preg_match_all("/\Wn\s*\(\s*\"?([\w]+)\"?,\s*\"(.+)\"\s*,\s*\"(.+)\"\s*(.+)/", $vueSource, $doubleQuoteMatches); + preg_match_all("/\Wn\s*\(\s*\'?([\w]+)\'?\s*,\s*\`(.+)\`\s*,\s*\`(.+)\`\s*\)/msU", $vueSource, $templateQuoteMatches); $matches0 = array_merge($singleQuoteMatches[0], $doubleQuoteMatches[0], $templateQuoteMatches[0]); $matches2 = array_merge($singleQuoteMatches[2], $doubleQuoteMatches[2], $templateQuoteMatches[2]); $matches3 = array_merge($singleQuoteMatches[3], $doubleQuoteMatches[3], $templateQuoteMatches[3]); |