After reading the docs and trying a few things I assume the option "Switch by url's language prefix" allows you to switch languages when requesting a node with the language in the path. eg:

category/english-node => fr/category/translated-node

1. If I create a translated node and put the language in the path alias, I get a page not found error.
eg:
Translated node's path alias: fr/category/translated-node
Navigate to: fr/category/translated-node
Result: Page not found error

2. If I do not put the language in the path alias, I can access the node using the language in the path alias, but drupal never generates a link in this form.
eg:
Translated node's path alias: category/translated-node
Navigate to: fr/category/translated-node
Result: Language switched and node viewable - but how can I get drupal to generate it's links like this?

3. If I go to the home page of my site and append a language to the domain it works (www.domain.com/fr, and all links from there on have the language prefix attached- eg fr/category/translated-node.

But now if I click the English flag to switch back to English, the language prefix is never removed from any of drupal's urls, so I end up with things like fr/category/english-node

Can someone explain how this option is supposed to work? Bearing in mind the following:

My site already exists in English.
None of the current paths have a language prefix in them, and I do not want this to change (search engine hassles).
I would like to translate only some of the nodes.
The translated nodes should have a language prefix on them, immediately following the domain name.
English nodes should remain with no language prefix.

Thanks

Comments

mr.j’s picture

Even worse.. even if I switch this option off, it seems that localizer still does something with any path that you try to load which contains a valid locale prefix.

For example - I try to create a new homepage for my site for only US visitors (using panels).
- I give it a path of 'us', and try to navigate to it manually (browser address bar).
- I cannot load the page - it seems localizer is intercepting the call to the page, even though I have "Switch by url's language prefix" off. Instead the default site homepage is loaded.
- If I change the panel's path to 'usa' then there is no problem, it loads fine.
- If I instead give the panels a path of 'en' (the default language), I can navigate to the page fine.

Can anybody help me? It seems there are some serious bugs with this module and no-one has any input.
Would the i18n module be a better choice for what I am trying to do?

Roberto Gerola’s picture

There is no support for panels module.
"Switch by node's language" option is changing your language.

mr.j’s picture

To be clear, I am not trying to translate the panels.
Panels are irrelevant, as I have a specific different panel for each language's homepage.

But anyway, I still could not work out how to use the option "Switch by url's language prefix".

Anyway I got it working how I would like it to using i18n, plus a few patches.

Thanks for your help

Roberto Gerola’s picture

Status: Active » Closed (fixed)