Could you take a look at this issue, please:

http://drupal.org/node/81965

CommentFileSizeAuthor
#3 pathauto.module_1.txt24.79 KBdruvision

Comments

jazzitup’s picture

Category: task » bug

The same thing.... i18n is also *not working* with phpgedview module.

jazzitup’s picture

How to prevent i18n from changing some URL addresses created by other modules?

druvision’s picture

Version: 4.7.x-1.x-dev » master
StatusFileSize
new24.79 KB

The issue is that pathauto deletes all non-english characters from the URL.
Solution is simple! don't do it.

I've successfully integrated pathauto Hebrew Urls on my own sites in all versions since Drupal 4.6.
Each version, I had to patch it again to remove the needlessly complex logic of deletion nonprintable chars.
I am not really that master on CVS - i am more of a system analyst and intergator and I code slowly, so I can't do it on my own, but here are the requirements.

To be truly i18n compatible - there is almost no need for string cleaning.
All we need is to clean the chars which has special URL meaning, and make sure the url is utf8-encoded.

              $special_chars = array ("?",":","&","@","~","+","_","\"","'",";",".");
              $output = str_replace($special_chars, "", $string);

Attached is the modified pathauto.module - I've only modified out the pathauto_cleanstring function. Somehow, my change was not caught by DIFF, and I don't have the time to dive into it further, but here is my modified code attached. Hebrew urls work perfectly - take a look at my blog.

I think this is really a pathauto issue.

Amnon
-
Professional: Drupal Search | Drupal Israel | Web Hosting Strategies
Personal: Hitech Dolphin: Regain Simple Joy :)

druvision’s picture

I've opened a separate issue for my previous comment since it's not connected to i18n - UTF-8 urls support is needed even without i18n.

jazzitup’s picture

It seems to me like a completely off-topic post to my subject and that doesn't help me at all. The thing is that if you create a node and its translation (while using i18n module), you'll get URLs that will look like these:

www.example.com/en/node/14
www.example.com/hr/node/15

Now... if you'd like to use a pathauto module to put a regular alias for each of those URLs (using allowed characters only: [0-9a-zA-Z$\-_\.\+\!\*'(),]+), you expect something like this:

www.example.com/about
www.example.com/onama

But since i18n needs to know which language does any page use, you'll get some of these:

www.example.com/en/about
www.example.com/hr/onama

... but THESE URLs are leading to Error 404. And that's the problem!

www.example.com/about != www.example.com/en/about

jose reyero’s picture

Status: Active » Fixed

This is an old one and AFIK i18n works fine with pathauto, at least for Drupal 5, reopen (with more specific title/issue) and version if needed.

jazzitup’s picture

Status: Fixed » Closed (fixed)

You're right.. this was an old post and the issue is fixed in new versions of i18n. Closed.