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
......@@ -26,7 +26,9 @@ Yii Framework 2 Change Log
- Bug #5925: `ArrayHelper::htmlEncode()` does not work properly when the value being encoded is a nested array (tebazil)
- 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 #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: `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)
......
......@@ -408,11 +408,11 @@ EOD;
$merged = [];
$notTranslatedYet = [];
$todos = [];
$hasSomethingToWrite = false;
foreach ($messages as $category => $msgs) {
$notTranslatedYet = [];
$msgs = array_values(array_unique($msgs));
if (is_file($file)) {
......@@ -425,7 +425,7 @@ EOD;
sort($msgs);
foreach ($msgs as $message) {
$merged[$category . chr(4) . $message] = '';
$merged[$category . chr(4) . $message] = $existingMessages[$message];
}
ksort($merged);
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