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 ‘http://domain.com/signin’, if I translate into Spanish my url will still remain as ‘http://domain.com/signin’, 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 : http://www.yiiframework.com/doc/guide/1.1/en/topics.i18n

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 www.domain.com/en/site/index, www.domain.com/el/site/index

see an example at http://www.topservice.gr/

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

table1:

id

native_text (for example in english)

table2

id

id_table1

lang_code

lang_text

Best regards

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