OmgDef / yii2-multilingual-behavior

Yii2 port of the yii-multilingual-behavior.
146 stars 60 forks source link

Default language problem #21

Closed tahirm closed 9 years ago

tahirm commented 9 years ago

First of all thank you very much for your efforts.

We are using version 1.0.3 of your extension. And I have just noticed strange behaviour that I want to confirm. If I have set the defaultLanguage as en for example and then I query for translation for de language. and lets suppose there are no translations available in de for that specific id, in that case shouldn't it query with default language to try to get translations in default language? or I'm missing something?

Many thanks for any help.

OmgDef commented 9 years ago

If there are no translations available in de for that specific id, values for attributes will taken from the parent table

tahirm commented 9 years ago

Thanks for quick reply.

Do we have the same behaviour in version 2? because in docs of version 2 I don't see any title and content fields in parent post table. Those fields are available only in postLang table. In this case from where the default value will be picked for above scenario? And is it safe to just upgrade to version 2 or should I be careful about certain things other than table structure?

OmgDef commented 9 years ago

@tahirm Yes, we have the same behaviour in version 2. But duplication of multilingual columns is not required. In second version I just removed not used params.

tahirm commented 9 years ago

@OmgDef If I understood it correctly, if we don't create duplicated columns then even the default language will be stored in postLang table? If this is correct then how will you get the results in en when translation for de is not available. or you simply don't do anything in that case, and user gets null values?

OmgDef commented 9 years ago

you simply don't do anything in that case, and user gets null values

Exactly. Duplication is used only for fallback.

tahirm commented 9 years ago

@OmgDef So I can update to version 2 and still have duplicated columns for fallback, and it will work fine?

OmgDef commented 9 years ago

@tahirm Yes

tahirm commented 9 years ago

@OmgDef Great, Thank you very much for quick answers :)