Bilingual language toggle in Drupal 7

Events happening in the community are now at Drupal community events on www.drupal.org.
mlecha's picture

It would be helpful to know how those developing bilingual sites are creating a language toggle as on standard gov't pages. If you're on the English page, you should see a link to the French page and vice-versa.

In Drupal 7 I'm using the core language switcher block of the locale module. However that displays a link to the current active language as well as to the translated language, and doesn't seem to be configurable. I'm not sure if I can override it somehow?

I've come across this solution for Drupal 6, which seems pretty hefty for such a small issue:
http://drupal.org/node/909418

Alternately, at the bottom of the content there are links to translated pages. Perhaps this output could separated out and displayed in the theme region of my choosing?

Your comments would REALLY be helpful!

Comments

You can do this with CSS

dwhutton's picture

I used the following CSS to hide the link to the current page:

block.locale a.active {display:none;}

The link in question has a class of 'active'.

Hope this helps.

Oh, thanks.

mlecha's picture

David,

That worked.

I'd still love to be able to change the output of that language switcher block. I feel that once I knew how to do that, I'd have a far better understanding of how to bend Drupal to my will.

Michael

Customizing the Language Switcher Output

mducharme's picture

Here's how to do this by code.
http://drupal.org/node/909418

Drupal 7 version

mlecha's picture

Hi,

Yes, that was the link for Drupal 6 which I'd posted in my original question. I tried it in Drupal 7 without success. I was under the impression that the code was not being called, because I didn't see any errors. Perhaps they changed a hook name in D7, or this call to "function phptemplate_links"? Seems I'll have to do some more research.

Best,

Michael

Next meeting

colan's picture

Maybe we could discuss this and other language issues at the next meeting? In any event, I'd like to request that we move to Tuesday @ 1700h, as Mondays are now difficult for me to make.

Some comments from Dries on Multilingual support

mlecha's picture

Multilingual support in Drupal 8
http://buytaert.net/multilingual-support-in-drupal-8

There are a few good links in his posting too.