Project:Menu translation (Node)
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I'm not sure if this issue is related to this module or to the i18nmenu module but for pathauto I always use the [menupath-raw] token. But when I enabled this module the translated pages receive the menupath of the source language. So what I've done is created a separate module that adds an [i18n-menupath-raw] token. Perhaps this new module can be integrated into this module.

AttachmentSize
i18nmenu_token.zip1.35 KB

Comments

#1

First I have to thank for the wonderful i18nmenu - great idea. For many websites this approach fits much better.

We had the same problem with paths as Johnny. Using his module fixed this - also a big thank you!

I think it would be a good idea to integrate the module - or it there another place where this token could be useful?

Cheers

#2

This is a desirable feature. I'll try to look into this asap.

#3

Project:Menu translation (Node)» Internationalization
Version:6.x-1.x-dev» 6.x-1.x-dev
Component:Code» Menus

This probably fits better into the i18nmenu module.

Related issue: #881270: [bookpath], [menupath], [*path] tokens not cleaned: aliases without punctuation removed, lower casing, etc..

#4

Project:Internationalization» Menu translation (Node)
Version:6.x-1.x-dev» 6.x-1.x-dev
Component:Menus» Code

Sorry, I did not consider that i18nmenu does not touch node menu item paths. Moving back to the MTN queue.

#5

Status:active» needs review

Here is a patch based on the code posted in the OP.

Please note that due to the above issue with Pathauto, the token has been renamed to [i18n-menuhierarchy-raw]. Until that one is fixed we need to configure puntuaction settings to leave alone slashes to have working aliases.

Note also that the i18n- namespace should be used by the i18n project, but in this case Menu Translation (which is the right place where implement any other [i18n-menu*] token) does not need the hierarchy token, as it relies on menu item replication (which works with the standard [menupath-raw] token), so this should not be an issue.

AttachmentSize
i18nmenu_node-867288-5.patch 3.02 KB

#6

Great i'll try to test this somewhere in the next few weeks. I'm overly busy with deadlines.

#7

Rerolled

AttachmentSize
i18nmenu_node-867288-7.patch 1.67 KB

#8

Status:needs review» fixed

Committed to HEAD.

#9

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#10

you've renamed the token to i18n-menuhierarchy-raw but this is in the pathauto module

function pathauto_clean_token_values($full) {
  foreach ($full->values as $key => $value) {
    // If it's a "path" or "url friendly" token don't remove the "/" character
    if (drupal_substr($full->tokens[$key], -4, 4) === 'path' || drupal_substr($full->tokens[$key], -8, 8) === 'path-raw' || drupal_substr($full->tokens[$key], -5, 5) === 'alias') {
      $full->values[$key] = pathauto_cleanstring($value, FALSE);
    }
    else {
      $full->values[$key] = pathauto_cleanstring($value);
    }
  }
  return $full->values;
}

so if the token doesn't contain path, path-raw or alias then all slashes are removed.

so i propose to rename the token to i18n-menuhierarchy-path-raw

#11