Bilingual language toggle in Drupal 7

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by mlecha on April 2, 2011 at 3:14pm

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

Posted by dwhutton on April 2, 2011 at 3:33pm

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.

Posted by mlecha on April 2, 2011 at 3:56pm

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

Posted by mducharme on April 4, 2011 at 2:38pm

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

Drupal 7 version

Posted by mlecha on April 4, 2011 at 3:01pm

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

Posted by colan on April 4, 2011 at 5:27pm

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

Posted by mlecha on May 10, 2011 at 7:21pm

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

There are a few good links in his posting too.

Ottawa

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /