3

So my problem is i dont know how to make my custom menu item change language in drupal. I know there is a language switcher in drupal, but i want to make a new custom menu in drupal, theme it, and i want the links to trigger changing the language, like the link "french" changes the site to french. How can this custom trigger of events be created in drupal and how do i know which functions to call/variables to change to allow me to achieve this?

I really appreciate any help!

-1

May be you are looking for language_negotiation_get_switch_links

Return the language switch links for the given language.

$path = drupal_is_front_page() ? '<front>' : $_GET['q'];
$links = language_negotiation_get_switch_links($type, $path);
3
  • The question is not asking about the language switcher links; it's asking about localizing menu items and content. – colan Feb 10 '14 at 17:03
  • Above question is indeed talking about language switching links... "I know there is a language switcher in drupal, but i want to make a new custom menu in drupal, theme it, and i want the links to trigger changing the language, like the link "french" changes the site to french." – Anil Sagar Feb 11 '14 at 5:05
  • Oh, you're right. I misread that - sorry. I must have been thinking about something else at the time. – colan Feb 11 '14 at 15:55
-1

If you have localized content, say an "About Us" page with and English version and a version of that page translated into French, then you're looking for Entity Translation.

You don't need to create a custom menu item as the Locale module, which ET depends on, provides this block for you. It should be called "Language switcher".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.