Open tresrob opened 4 years ago
Try to put this in your config file:
'sourceLanguage' => 'en-US',
'language' => 'it-IT',
'i18n' => [
'translations' => [
'pluto' => [ // override pluto's standard messages
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@app/messages', // this is a default
'sourceLanguage' => 'en-US', // this as well
],
],
],
Try to put this in your config file:
'sourceLanguage' => 'en-US', 'language' => 'it-IT', 'i18n' => [ 'translations' => [ 'pluto' => [ // override pluto's standard messages 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@app/messages', // this is a default 'sourceLanguage' => 'en-US', // this as well ], ], ],
Hi ettolo
Thanks for the reply. unfortunately it doesn't work. I only see the English language. I put it inside the config / web.php file.
Hi, did you put the "it" folder in /messages?
Hi, did you put the "it" folder in /messages?
Hi yes i copied it in vendor\yiisoft\yii2\messages\it and also in vendor\sjaakp\yii2-pluto\messages\it
but nothing
no, if you have basic yii2 template you should create the folder in root, same level as config folder
/messages/it/
no, if you have basic yii2 template you should create the folder in root, same level as config folder
/messages/it/
Ok i have created in root folder but this the result
not translate
in file /config/web.php i have insert
'sourceLanguage' => 'it-IT',
'language' => 'it-IT',
'timeZone' => 'UTC',
and 'components' => [ ... 'i18n' => [ 'translations' => [ 'pluto' => [ // override pluto's standard messages 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@common/messages', // this is a default 'sourceLanguage' => 'it-IT', // this as well ], ], ],
'basePath' => '@app/messages', // **this is a default**
'sourceLanguage' => 'en-US', // **this as well**
'basePath' => '@app/messages', // **this is a default** 'sourceLanguage' => 'en-US', // **this as well**
hi ettolo i'm sorry
if i replace 'sourceLanguage' => 'it-IT', with 'sourceLanguage' => 'en-US',
this is the messagge
Invalid Argument – yii\base\InvalidArgumentException Invalid path alias: @common/messages
You are not following my instuctions :-)
'basePath' => '@app/messages', // **this is a default**
@app not @common you don't have a common folder if you're using basic template
in file /config/web.php i have insert
'sourceLanguage' => 'it-IT', 'language' => 'it-IT', 'timeZone' => 'UTC',
Also this is wrong! Leave sourceLanguage => 'us_US'
You are not following my instuctions :-)
'basePath' => '@app/messages', // **this is a default**
@app not @common you don't have a common folder if you're using basic template
Ops i change with @app but not translate
i have copy a file pluto.php so
bring patience but I can't understand how to add the path
the path is ok, have you done the other correction to web.php (_Leave sourceLanguage => 'usUS')?
the path is ok, heva you done the other correction to web.php (_Leave sourceLanguage => 'usUS')?
BINGO!!!!!!!! ohhhhh yessss Thanks thanks thanks
You're welcome!
Hi sjaakp
I want to activate the Italian language. I have yii2 basic version installed and added the following code in the web.php file:
'i18n' => [ 'translations' => [ // ... other translations ... 'pluto' => [// override pluto's standard messages 'class' => 'yii \ i18n \ PhpMessageSource', 'basePath' => '@ app / messages', // this is a default 'sourceLanguage' => 'it-IT', // this as well ] ] ]
Unfortunately, it doesn't work, the Italian language doesn't change. can you help me please Thanks