On my website currently only one content type gets translated and is therefore available in multiple languages. On this content type/page all the links (logo, menu, footer, etc.) refer to their language version of the current language.

E.g.: I'm currently on the french version of the page. The URL looks like this: "/fr/translated-node.html". Now all the links in the menu or footer look like this: "/fr/some-page.html".

But it shouldn't be like this. All the links on this page should always look like this: "/some-page.html". So without the language code at the beginning.

How can I achieve that programmatically?


Go to admin/config/regional/language/detection/url and then you must delete the path prefix for the language, you don't need code to do this.

enter image description here

And save the config.

  • But I need the URL "/fr/translated-node.html" to stay like it is..
    – elterr1ble
    Nov 7 '17 at 0:16
  • @elterr1ble why you want something like this? Nov 7 '17 at 2:27
  • @AdrianCidAlmaguer because the URLs "/fr/translated-node.html" are already fix in the system (production environment).
    – elterr1ble
    Nov 7 '17 at 19:05
  • @elterr1ble I can't get the point Nov 7 '17 at 19:06

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.