Closed boehsermoe closed 4 years ago
Each module can provided translations by its own:
public static function onLoad()
{
Yii::setAlias('@luyathemes', static::staticBasePath());
self::registerTranslation('luyathemes*', '@luyathemes/messages', [
'luyathemes' => 'luyathemes.php',
]);
parent::onLoad();
}
public static function t($message, array $params = [], $language = null)
{
return parent::baseT('luyathemes', $message, $params, $language);
}
So i would say this works already?
I am going to close this issue because:
If you think this is still important or there are more/new informations. Please reopen the issue and let us know.
If this is a problem or a feature you like to discuss, join our slack team: slack.luya.io. We try to keep our issue tracker as clean as possible in order to focus on active issues.
Problem
Maybe some theme could have some translations in their views. Currently you can only use
Yii::t('app', 'lorem ipsum')
. In a theme inside the app this is no problem, but for theme packages.Idea
On thememanager setup register translation form the theme messages directory like in
onLoad
function of modules. Those translations should have the prefixtheme
and call withYii::t('theme<theme name>', 'lorem ipsum')
Theme translation have to be overridable from the app.