Problem with langauge switcher block

Permalink
The language switcher block that comes with the internationalization add on is doing something strange.
If you want to display text instead of flags it translates the different language names into the current locale. This is absolutely not what you would expect, and makes it unusable for the users of the site. Each language option instead needs to appear in its own locale.
To clarify the problem: if you have a site where the default language is chinese then all the language choices appear in the dropdown in chinese. This means that our poor english user has no idea which one to pick!
Or have I missed something?

 
Mainio replied on at Permalink Best Answer Reply
Mainio
Yes, I think this is also incorrect if the case is that your users will browse to some other language first on your site than their own language.

To fix this, copy this file:
/packages/multilingual/blocks/switch_language/controller.php

here:
/blocks/switch_language/controller.php


And open the copied file for editing. Find line 40 that looks like this:
$languages[$m->getCollectionID()] = $m->getLanguageText($locale);



and change it to this (if you're running the LATEST github version):
$languages[$m->getCollectionID()] = $m->getLanguageText($m->getLocale());


if that throws an error, you can try this:
$languages[$m->getCollectionID()] = $m->getLanguageText($m->getLanguage() . "_" . $m->getIcon());



Hope it helps! I think the main issue here is what the developers of the multilingual add-on have thought is something different than you think. I think that might be an option when adding the block?


Antti / Mainio
windchill replied on at Permalink Reply
Thank you very much!
That's the second time you helped me out recently.
The second of your two options works perfectly.