diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-10-31 10:57:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-31 10:57:14 +0300 |
commit | 45c91eb78b46011eb6688ac6b8fa10bae570e52d (patch) | |
tree | 4cdd97a9393766f2f296783815f625e29d2b94ac | |
parent | 8109b94ba1735548365aebb7d5dc88e64c15c1c0 (diff) | |
parent | 33beb897e4152895109f1657272d5346701863a2 (diff) |
Merge pull request #458 from nextcloud/fix-t-vue-extract
Fix extract translatables from vue files
-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..8f4e82f 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]); |