diff options
author | sgiehl <stefan@piwik.org> | 2015-09-30 21:53:13 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-09-30 21:53:13 +0300 |
commit | 40afd5b4d4ddca2dded6ce2bd6327830ca580567 (patch) | |
tree | dddcf04edbc83b1985ebe9c8f1d56d456a7cb119 | |
parent | 7bd71513ede7a02a6697373cc2f0514c2013118a (diff) |
fixes bug in automatic translation update
- languages with splitted language codes (e.g. pt-br, zh-cn, ...) were not included in the pull request description
- added TranslatorName to dev language to avoid notices when using the TranslationManager API in development mode
-rw-r--r-- | lang/dev.json | 3 | ||||
-rw-r--r-- | plugins/LanguagesManager/Commands/CreatePull.php | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lang/dev.json b/lang/dev.json index 2c63c08510..26cb4e32d4 100644 --- a/lang/dev.json +++ b/lang/dev.json @@ -1,2 +1,5 @@ { + "General": { + "TranslatorName": "Piwik Development Team" + } } diff --git a/plugins/LanguagesManager/Commands/CreatePull.php b/plugins/LanguagesManager/Commands/CreatePull.php index 95a57e591f..e9c16ccf0c 100644 --- a/plugins/LanguagesManager/Commands/CreatePull.php +++ b/plugins/LanguagesManager/Commands/CreatePull.php @@ -113,7 +113,7 @@ class CreatePull extends TranslationBase $stats = shell_exec('git diff --numstat HEAD'); - preg_match_all('/([0-9]+)\t([0-9]+)\t[a-zA-Z\/]*lang\/([a-z]{2,3})\.json/', $stats, $lineChanges); + preg_match_all('/([0-9]+)\t([0-9]+)\t[a-zA-Z\/]*lang\/([a-z]{2,3}(?:-[a-z]{2,3})?)\.json/', $stats, $lineChanges); $addedLinesSum = 0; if (!empty($lineChanges[1])) { @@ -126,8 +126,8 @@ class CreatePull extends TranslationBase @$linesSumByLang[$lineChanges[3][$i]] += $lineChanges[1][$i]; } - preg_match_all('/M [a-zA-Z\/]*lang\/([a-z]{2,3})\.json/', $changes, $modifiedFiles); - preg_match_all('/A [a-zA-Z\/]*lang\/([a-z]{2,3})\.json/', $changes, $addedFiles); + preg_match_all('/M [a-zA-Z\/]*lang\/([a-z]{2,3}(?:-[a-z]{2,3})?)\.json/', $changes, $modifiedFiles); + preg_match_all('/A [a-zA-Z\/]*lang\/([a-z]{2,3}(?:-[a-z]{2,3})?)\.json/', $changes, $addedFiles); $messages = array(); |