I have found that no matter what I do, whether I use string translation on a language neutral link, or translate an English link to the non default language (in this case French) - any link with the path user/logout will only display with the text 'Log out' no matter the language of the node being displayed. The link also displays in the wrong language on the menu's link list page.

Changing the English link text to something other than 'Log out' also has no effect if the module is enabled - it will appear correctly when you're editing the link, but always display as 'Log out' on the link list page.

The only page that shows the correct text for all languages is the translation set page for that link.

Disable the Administration Language module and all links appear as they should.

Comments

freeform.steph’s picture

Issue summary: View changes
ericc3’s picture

I had the same problem recently when working with a translated site. I used a 'user menu' block in my theme region and no matter what I tried, the 'Log out' link was never translated even though the translation was provided. It took me a while before I narrowed down the cause to this module.

Reproduce steps:
* Install Drupal 7 and log in as Admin
* Install Locale, Internationalization, menu translation, Admin_menu, Admin language
* Add new languages to install
* Set (English) language as admin language
* Translate the user menu user/logout link
* Place a user menu block in the theme layout
* You should see the log out link not translated when you switch language other than English

The problem is located in this function in line admin_language.module line 72 (version 1.0-beta1)

/**
 * Implements hook_translated_menu_link_alter().
 */
function admin_language_translated_menu_link_alter(&$item, $map) {
  if ('management' == $item['menu_name'] || 'user/logout' == $item['link_path']) {
    if (variable_get('admin_language_translate_admin_menu', 0)) {
      global $language, $_admin_language;

I believe the purpose of this function was to change the language of the 'log out' link in the admin menu toolbar to the admin language setting. However, this 'user/logout' == $item['link_path'] falls through to other menus containing 'user/logout' link during the page building process. This forces all the 'Log out' menu items outside the admin menu toolbar to the set admin language. At this point I don't have a solution other than remove the || 'user/logout' == $item['link_path'] portion of the if statement to get it working (quick fix). It definitely needs to be reviewed for an alternative solution.

I feel removing is better than having front-end users report about the why the 'log out' links are not translated, than having a translated 'log out' link inside the admin toolbar only a few admin users have access to.