Commit fb2dff85 by Alexander Makarov

Fixes #6107 and #6112: `yii message` was emptying existing translations and…

Fixes #6107 and #6112: `yii message` was emptying existing translations and incorrectly writing not yet translated strings in .po in case of multiple categories
parent bc4a12f1
...@@ -27,6 +27,8 @@ Yii Framework 2 Change Log ...@@ -27,6 +27,8 @@ Yii Framework 2 Change Log
- Bug #5997: The same message may be exported twice to log targets (klimov-paul) - Bug #5997: The same message may be exported twice to log targets (klimov-paul)
- Bug #6018: When setting the `encode` option via `yii\widgets\ActiveRecord::errorOptions`, it works the other way around (stanishevsky, qiangxue) - Bug #6018: When setting the `encode` option via `yii\widgets\ActiveRecord::errorOptions`, it works the other way around (stanishevsky, qiangxue)
- Bug #6049: `yii\db\Connection::getSchema()` for Oracle should return false when the table does not exist. Oracle does not support `ON UPDATE` clause. (wenbin1989) - Bug #6049: `yii\db\Connection::getSchema()` for Oracle should return false when the table does not exist. Oracle does not support `ON UPDATE` clause. (wenbin1989)
- Bug #6107: `yii message` was emptying existing translations in .po in case of multiple categories (samdark)
- Bug #6112: `yii message` was incorrectly writing not yet translated strings in .po in case of multiple categories (samdark)
- Bug: Gii console command help information does not contain global options (qiangxue) - Bug: Gii console command help information does not contain global options (qiangxue)
- Bug: `yii\web\UrlRule` was unable to create URLs for rules containing unicode characters (samdark) - Bug: `yii\web\UrlRule` was unable to create URLs for rules containing unicode characters (samdark)
- Enh #4181: Added `yii\bootstrap\Modal::$headerOptions` and `yii\bootstrap\Modal::$footerOptions` (tuxoff, samdark) - Enh #4181: Added `yii\bootstrap\Modal::$headerOptions` and `yii\bootstrap\Modal::$footerOptions` (tuxoff, samdark)
......
...@@ -408,11 +408,11 @@ EOD; ...@@ -408,11 +408,11 @@ EOD;
$merged = []; $merged = [];
$notTranslatedYet = [];
$todos = []; $todos = [];
$hasSomethingToWrite = false; $hasSomethingToWrite = false;
foreach ($messages as $category => $msgs) { foreach ($messages as $category => $msgs) {
$notTranslatedYet = [];
$msgs = array_values(array_unique($msgs)); $msgs = array_values(array_unique($msgs));
if (is_file($file)) { if (is_file($file)) {
...@@ -425,7 +425,7 @@ EOD; ...@@ -425,7 +425,7 @@ EOD;
sort($msgs); sort($msgs);
foreach ($msgs as $message) { foreach ($msgs as $message) {
$merged[$category . chr(4) . $message] = ''; $merged[$category . chr(4) . $message] = $existingMessages[$message];
} }
ksort($merged); ksort($merged);
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment