Answer the question
In order to leave comments, you need to log in
Yii2: Translations in po files from various sources. How?
I have two translation sources
@backend
@common/models
How do I collect translations in one place? Please do not offer to post translations in Common , it does not suit me.
I need separate
@backend translations from @backend and from @common/models
frontend translations from frontend and from @common/models
Due to the fact that the same entity can be named differently in the client and in the admin panel.
Alexander Makarov Suggested the option of creating two config files
return [
'color' => null,
'interactive' => true,
'sourcePath' => '@backend', // для второго файла тут @common
'messagePath' => '@backend/messages',
'languages' => ['ru'],
'translator' => 'Yii::t',
'sort' => true,
'overwrite' => true,
'removeUnused' => false,
'markUnused' => false,
'except' => [
'.svn',
'.git',
'.gitignore',
'.gitkeep',
'.hgignore',
'.hgkeep',
'/messages',
'/BaseYii.php',
],
'only' => [
'*.php',
],
'format' => 'po',
'catalog' => 'messages',
'ignoreCategories' => [],
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question