I have a site with 6 languages. English is the default language.
When a German user visits the site he gets the german version as expected. When he clicks any other flag except the English he get correctly both content and interface on the selected language. BUT, when he chooses the English language he gets ONLY the text page in this language while the interface remains in the German language. Also the breadcrumbs are shown in German insted of the selected English.
The same behaviour occurs for every visitor from different country. For example the Greek users when they click the English flag they get the english text in the page but the menus and interface remains greek.
Please, its urgent to fix this. Can you tell me how to correct the code ?
Comments
Comment #1
agrigor1 commentedI suppose that this is not a problem of the code of this module. The same behaviour is also from the Language selection block of i18n. I guess I misunderstood the operation of "Path Prefix with language fallback" option.
It seems that the language set either by browser or by user preferences in his profile, is to substitute the default language of the site (in my case the English one). So the language set by browser or by user selection in profile, will be the language of the interface when the user clicks the default language in the block (either in the block of consistent interface or in the Language Selection block).
In fact I wanted a different operation. I wanted the user, in his first visit in the site, to get the language of the browser or the one he has set in his profile but I dont want a restriction in selecting the default language for content and interface. Every subsequent click in the flags of the consistent interface block or in the language selection block, should allow him to change both the interface and the content (if there is a translation available).
Can anyone help?
Comment #2
agrigor1 commentedI added a language prefix for the default English language (en). This didnt change the behaviour of Consistent Language block but it did had the desired effect on the Language Switcher block. This is now working okey allowing the user to change interface and content in all languages (that have translation). It seems that Consistent Language block doesnt add a language prefix for the default language, although I added one. So it still behaves problematically as clicking the default language flag changes only the page displayed but not the interface.
Can you fix it?
Comment #3
bartezz commentedI've also noticed this, is this by design or a bug?
Cheers
Comment #4
jbiechele commentedSame here with three languages: english (default), german, spanish
As long as the visitors browser is configured to speak "english" first, everything works fine.
If the visitors browser is configured in another language than english he can't switch to english correctly,
as the language switcher block does not add the defined language-prefix "en" for english.
Any hint, trick or solution will be very appreciated.
Comment #5
jbiechele commentedAddition: I fixed that "quick&dirty" on my site by changing the languageinterface.module at lines 125-127 commenting them out.
Now the switcher always uses the defined language prefix including for the default language (in my case english). Of course this only works if you've defined a language prefix also for your default language and do not leave it blank in ../admin/settings/language.
As I did not test without prefix for the default language and don't know the impact on other configurations, I did not create a patch. But maybe this is of any use for someone else until the issue is fixed in a nicer way.
Comment #6
pcambraCode in #6 did the trick for me, ideally this should be included in the module to mimic the behavior of the normal language switcher in this cases.