Questions About I18

Hi All,

I’m about to start to translate my app, before that I have read some wikis and posts but I still have some doubts…

  1. If I want to display a different image depending on the language, should I better translate the whole file (view)?

  2. Now my urls look like this ‘’, if I translate into Spanish my url will still remain as ‘’, is that ok? I mean… in terms of SEO for example? or should also translate the Url? if so… how?

3)If I have a for example a table of posts and I want to translate every post saved on my DB, should I add a new column on that table like ‘language’ and filter by that? is this approach ok?

Many doubts I guess…

Thanks in advance!

Try reading this :

Thanks for your reply, i already read that guide and some others posts and I still have doubts, as I said in my first post.

Hi @menxaca

It depends!

  1. If you have a lot of translated texts then it is prefered to make it by new tranlated view files

for few texts you sould call something like that

echo Yii::t('myfilename','your image url')

2)in terms of SEO you have to include the language in url like that,

see an example at

  1. Yes it is preferable, or better make another related table to contains all the translations by language like that



native_text (for example in english)






Best regards

Very helpful answer!!! Really! Thank you very much KonApaz!