Fixes #6107 and #6112: `yii message` was emptying existing translations and incorrectly writing not yet translated strings in .po in case of multiple categories