I have a problem with handling i18n module with pathauto. I took a look in the database and url_alias table has the following entries:
src: node/1
dst: 20060901_Title

Since I'm using multilanguage site, when I click on that primary link element, I've been transfered to the "http://mysite.com/en/20060901_Title" which results with "Page not found".

Comments

greggles’s picture

Can you elaborate on how the pathauto module should behave?

I'm having a hard time understanding what the pathauto module should do to handle this situation since I'm not terribly familiar with the i18n module.

jazzitup’s picture

Title: Issue with i18n module » Issue with the i18n module

Hint:
From the example I already mentioned from above, a link "http://mysite.com/en/20060901_Title" leads do "Page not found", but the link "http://mysite.com/20060901_Title" opens the right content. The module i18n modifies links with an international abbreviation of the selected language right after the dns, for example:

http://mysite.com/en/ (* if English is the default language on site*)

Right after this URL construction, Drupal's internal links will be added. So, when you set the alias url from "http://mysite.com/20060901_Title" to "http://mysite.com/node/1", then your module won't know what is "http://mysite.com/en/20060901_Title".

greggles’s picture

Thanks for the "hint". I'm still not sure if this is something that pathauto needs to do, and if so what, or if it's something that i18n needs to do.

I'm certainly not going to work on this at this point - if someone else is "scratched" by this then feel free to itch it and provide a patch.

jazzitup’s picture

Category: bug » feature
Status: Active » Closed (duplicate)

Ummm... yes, I think you're right... when I spent a little bit more time on this, more and more I become convinced that it's i18n module's "pair of socks". They should be aware of a group of URL's that should stay unchanged.

klance’s picture

This is somewhat speculative, but from the testing I've done it seems that pathauto interacts somewhat with i18n because it prepends the url alias with "en/" if the site default language is English. Unfortunately, it doesn't seem to detect the language of the category, node, blog or forum posting, because it prepends *ALL* of the url aliases with "en/" regardless of the node, etc,'s language.

I was trying to figure out why i18n's translation block won't link to the correct translation, and determined that it's because it can't differentiate between the English and French nodes when both of their url aliases are prepended with "en/", so it doesn't try to translate them. I think this is a reasonable behavior. Pathauto needs to prepend the correct language to nodes and categories, and not assume that they will all be in the default language. I thought this was happening only on bulk updates, so I tried creating a new French page and associating it with a French category, and pathauto still prepended the url alias with "en/".

To me this seems more like a pathauto issue that an i18n one, because i18n correctly collects and stores the languages of various content types and categories in the database, and pathauto doesn't look at them. The BIG question is, should pathauto consider i18n in its design, or vice-versa?

greggles’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Closed (duplicate) » Active

If someone wants to make a patch and explain how to test it then I'd be happy to commit it. Otherwise, I'm not interested in writing anything myself because I don't know enough how i18n module works and where/what Pathauto should be doing.

I change the status and version to reflect this situation.

lamojo’s picture

Version: 5.x-1.x-dev » 5.x-1.0
Category: feature » bug

just ran in the same problems as klance. pathauto does put the default language in front of the alias, even if you set it up not to do so, and only use [catalias] as a prefix. it does this weather the node is in the default language or another language.

one work around seems to be to prefix your catalias with the correct language. user 'es/libros' and 'en/books' as catalias instead of 'libros' and 'books' . it seems to copy the right language then on an autopath 'bulk update'. its not nice, because you don't want the language prefix SEO wise... but it works...

i also found that there are two blocks for switching the language. one is 'Language switcher' the other 'Translations'. if you use the 'Language switcher' block to switch languages, and if you do not use bulk update but edit a node thru the site, then the alias will be prefixed with the language you are currently switched to in the site. if you use the other block ('Translations') to switch between languages on the site, than it will always prefix the alias with the correct language (language you set the node to). just don't use pathauto 'bulk update'!

greggles’s picture

Title: Issue with the i18n module » i18n integration does not work
Version: 5.x-1.0 » 5.x-2.x-dev

As I said in my last response, I don't understand this well enough or have the interest to work on it. If someone else provides a patch to fix it and the instructions on how to test I will consider it.

If the consensus is that it is totally broken (which seems to be the case) then I plan to remove this from the pathauto code so that I don't confuse people into thinking that it does work.

greggles’s picture

Status: Active » Postponed (maintainer needs more info)
mitchell’s picture

It seems to me that Token should be used to add a tag [locale]. Does this sound right to anyone else?

greggles’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Seems reasonable to me.

Note that there is work towards this over here: http://drupal.org/node/176449

Anonymous’s picture

I don't see how pathauto and i18n work together at all?

For example, on my site with both enabled:

/en/goodbye

becomes

/de/goodbye

but it should of course be:

/de/auf_wiedersehen

pathauto does not pre-translate, it just changes /en/ into /de/ but disregards the fact node titles are translated, so can't even be used in combination with i18n!

Or does anybody have a solution for that?

sinasalek’s picture

Same problem here. subscribe