Hi,
I set up an i18n page, where I translate messages using yii\i18n\PhpMessageSource with the following config part:
(config/web.php)
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'bootstrap' => ['debug'],
'language' => 'de-DE',
'components' => [
'i18n' => [
'translations' => [
'app*' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@app/messages',
'fileMap' => [
'app' => 'app.php',
],
'forceTranslation' => true,
],
],
]]
…byt the way: this works fine.
For a kind of static content -like an imprint-, I like to use an complete translated view.
So I added some sub-directories in the views
- folder, with the view insight:
@app/views/myController/de-DE/myview.php
@app/views/myController/en-US/myview.php
So my action does the following:
public function actionImpressum() {
\Yii::$app->language = 'en-US';
return $this->render('myview');
}
…which results in an Invalid Parameter – yii\base\InvalidParamException: The view file does not exist: /path/to/my/app/views/dbdi/myview.php
Is there something I forgot?
Thank you, Borner.