1

I'm working on a site with internationalization from the source language, English, into a few other languages. Translating the pages has worked out fine; however, I'm running into trouble with URL aliases.

Some of our pages have different menu labels vs. page titles (e.g. Terminals as the menu label vs. Terminal Information as the page title), and since the client wanted the shorter menu labels in the URL, my default path pattern (set using the Pathauto module) is [node:menu-link:parents:join-path]/[node:menu-link:title].

Menu items are also set per language – so while Terminals is the English version of the menu item for that page, when viewing the site in French, I have a menu item labeled Aérogares that's used only when the site is translated into French. This means that when the URL is constructed for a page called Maps in English and Plans in French whose parent is Terminals/Aérogares, the English URL alias is /terminals/maps, but the French alias is /fr/aérogares/plans.

Another part of the problem I'm facing is that when I save a translation of the page, this menu pattern ignores the source language and resaves every language's alias as that of the language of the translation (when saving a French translation, the English alias becomes /aérogares/plans, the Arabic alias becomes /ar/aérogares/plans, etc.).

I've tried a few different tokens as part of the URL alias options to see if they'd work, but without success:

  • [node:source:menu-link:parents:join-path]
  • [node:source:menu-link:title]
  • [node:source:title_field]

There are a few different options that would be acceptable in the end, listed here from most to least desirable:

  • Foreign-language URL aliases use that language's menu structure, e.g. Terminals/Maps is /terminals/maps in English and /fr/aérogares/plans in French, and saving one language doesn't affect the others
  • Foreign-language URL aliases use the language code followed by the full English path, e.g. Terminals/Maps is /fr/terminals/maps in French
  • Foreign-language URL aliases use the language code followed by the current page's English title, e.g. Terminals/Maps is /fr/maps

I'm running Drupal core version 7.61. Here's a list of relevant translation- and menu-related modules I currently have in use:

  • Entity Translation 7.x-1.0
  • Entity Translation Menu 7.x-1.0
  • Internationalization 7.x-1.26
  • Menu translation 7.x-1.26
  • Pathauto 7.x-1.3
  • Token 7.x-1.7
  • Translation Management (tmgmt) 7.x-1.0-rc3

How can I accomplish one of the desired URL structures and keep them language-independent when saving revisions to content?

0

Your configuration is too complex to be able to say with certainty, but your menu tokens seem to support "languages", so it may be the Path that needs some extra support.

Have you enabled Path translation or tried Pathauto i18n?

  • Thanks for responding. I'd tried Pathauto i18n, but without success – I think Pathauto alone correctly creates the aliases, so that and manually creating aliases via Path translation don't seem to help; it seems more like it incorrectly overwrites each language's alias when I save a revision. – Kurt Jan 21 at 14:20

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.