The translations do not appear when the language of the application is the same as the sourceLanguage.
Here is the main.php:
return [
'id' => 'applicationID',
'sourceLanguage' => 'en-US',
'basePath' => dirname(__DIR__),
'language' => 'en-US',
'i18n' => [
'translations' => [
'*' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => "@app/messages",
],
],
],
],
];
messages/en-US/feedback.php:
<?php
return [
'TEST' => 'TEST EN',
];
message/de-DE/feedback.php
<?php
return [
'TEST' => 'TEST DE',
];
When I set the language of the application to be de-DE \Yii::t(‘feedback’, ‘TEST’); output:
TEST DE
When I set the language of the application to be en-US \Yii::t(‘feedback’, ‘TEST’); output:
TEST
I can’t see anything wrong in what I am doing. Any ideas?
EDIT: I already tried to add :
'sourceLanguage' => 'en-US',
To the i18n configuration but it doesn’t change anything.