Closed (duplicate)
Project:
Pathauto
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2006 at 00:38 UTC
Updated:
17 Apr 2008 at 15:25 UTC
Jump to comment: Most recent
Comments
Comment #1
gregglesCan 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.
Comment #2
jazzitup commentedHint:
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".
Comment #3
gregglesThanks 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.
Comment #4
jazzitup commentedUmmm... 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.
Comment #5
klance commentedThis 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?
Comment #6
gregglesIf 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.
Comment #7
lamojo commentedjust 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'!
Comment #8
gregglesAs 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.
Comment #9
gregglesComment #10
mitchell commentedIt seems to me that Token should be used to add a tag [locale]. Does this sound right to anyone else?
Comment #11
gregglesSeems reasonable to me.
Note that there is work towards this over here: http://drupal.org/node/176449
Comment #12
Anonymous (not verified) commentedI 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?
Comment #13
sinasalek commentedSame problem here. subscribe