I've got a multilingual English/French site running very nicely except for one small detail. I have the language switcher block published, and it works fine except on the English site it says English/Francais instead of English/FRENCH. I would like it to say English/French when in English and Anglais/Francais when in French. Either that, or just ALWAYS English/French. Is either of these possible?

Thanks.

Comments

jaypan’s picture

Logically, that doesn't make sense. If a French person is looking at the site in English, they will want to see it in French, and they may not understand 'French', but they will most definitely understand 'Francais', which is why it's written in the native language. Conversely, if an English person comes to the site when it's in French, they may very well not undestand 'Anglais', since they are not French speakers.

I say this as someone who got very frustrated when dealing with sites in Japanese, trying to find 'English', when it was written as '英語' on many Japanese sites.

Contact me to contract me for D7 -> D10/11 migrations.

Drave Robber’s picture

There is also an option of getting Language icons and displaying only flags, without any text.
It of course depends of your audience whether this is acceptable. (Quebec-based sites I've seen use text links, and always in English / Français manner.)

unleash.it’s picture

The design is already approved with just text

unleash.it’s picture

I appreciate opinion, but to the client it makes sense, and that's the way they would like it :)

I don't actually agree with you though, most multilingual sites I've seen if the default language in English, publish the choices all in English. I'm pretty sure it's obvious to a French speaking person what they need to do.

Anyone else know how? Thanks.

jaypan’s picture

Yes, most sites are not very user friendly with language switchers.

Most English speakers are not going to know that Anglais is 'English' unless they have studied French.

Like I say, I've been that guy who has been searching a site for the English link, and not finding it because it wasn't in English. It's just sloppy, and bad UX.

Contact me to contract me for D7 -> D10/11 migrations.

unleash.it’s picture

are to do it a certain way. I have no problems making suggestions to clients. But in the end, following client's wishes make the best user experience for all...

unleash.it’s picture

to make the change that I'm asking? Thanks.

Drave Robber’s picture

Are you using core Language switcher block or Language switcher module?

Drave Robber’s picture

The following works for me on an (almost) clean D7 install:

Install, clear cache, switch languages to and fro so that strings get picked up by translation system, navigate to Configuration > Translate interface > Translate and look for 'English' and 'French' there.

seod.info:

name = Speak English Or Die
description = Makes language switcher links translatable, so that they can be in currently viewed language.
package = Other
core = 7.x

seod.module:

<?php

function seod_language_switch_links_alter(&$links, $type, $path) {
  foreach ($links as &$language) {
    switch ($language['title']) {
      case 'English':
        $language['title'] = t('English');
        break;
      case 'Français':
        $language['title'] = t('French');
        break;
    }
  }
}

note: .module files do not have closing ?> tag.

The trick here is one cannot pass variables to translation system via t(), so we need to pass each string explicitly.

You can change the module name if you want :) but the first part of function name must be equal to module name.

mabho’s picture

Thanks, this was very useful!

norman.lol’s picture

Like a charm. Thanks!

unleash.it’s picture

Hi Drave, I'm using the stock language switcher block. Is that the making of a custom module? Way cool. If so, not only will it solve my issue... I'll also get to explore custom modules for the first time.

Ha I like your sense of humor. I'll keep the liner notes in there to make it clear that we are in violation of the usability sages! Thanks for you help.

p.s. I agree especially when non-latin languages are involved. However IMO, with latin languages I doubt anyone will be confused if they see their language in the English spelling, or the other way around. I'm huge on usability, but in this case I think it's not a big deal. But it is interesting how some American's (esp. in some...cough... red quarters of our land) break out in hives if they see anything in a foreign language...

shamseerva’s picture

Go to configuration->Regional and Language->Languages, it displays the languages you have added.
click edit link on operations section on language, you have two options for language name
1. Language name in English
2. Native Language name - you can add your language name(Eg: English as Anglais in French)

ahqaf’s picture

Really, this is very helpful for me. Thanks a lot.