开发者

Drupal - multilingual site - change language - redirect to same page in selected language

开发者 https://www.devze.com 2022-12-28 14:33 出处:网络
In a Drupal multilingual site, for custom modules, (not nodes) what is approach to assure that user navigates to same page in new language?

In a Drupal multilingual site, for custom modules, (not nodes) what is approach to assure that user navigates to same page in new language?

example: en/mypage to de/mypage

edit: menu hook looks like this:

  // add menu item
  $items['my_module_name'] = array(
     'title'    开发者_开发技巧        => t('My Page Title'),   
     'menu_name'        => 'menu-my-menu',       
     'page callback'    => 'call_this_function_below',   
     'access arguments' => array('access content'),         
  );


You mean how to program a module with multilanguage support? Well, I would say you use a placeholder in the menu path you are registering your module for (hook_menu). In that way your module will get the request no matter what language identifier is used, so it will react for en/mypage as well as de/mypage. Of course in your module you must add custom processing logic to deliver the content in the requested language.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号