pathauto i18n integration

Events happening in the community are now at Drupal community events on www.drupal.org.
greggles's picture

There is some concern that pathauto's i18n integration isn't functioning properly. I don't understand it or have the interest to work on it. So, I'm writing here to say:

1) If it's agreed that nobody has it working, I'll remove it so we don't confuse people about totally buggy code. Please respond either here or in that issue if you have a feeling about that.

2) To try to solicit someone who does need it to work on that area of the module. Ideally I'd like to see the code in the i18n module rather than in pathauto, but I can't force that. If you do want to be responsible for getting it working right, please provide a patch to either pathauto or (better) i18n module.

Thanks!

Comments

Pathauto and i18n.

jose reyero's picture

So far, I've seen some bug reports about pathauto and i18n integration, but I really don't know about the status with latest versions.

These bug reports seem to be mostly for old versions, and I'm not using pathauto for any live site, but I've given a try to both modules together -latest Drupal 5- and seem to work.

So if someone provides accurate up to date information and/or a patch for this, I'm willing to fix it on i18n side if it makes more sense.

References
http://drupal.org/node/82024
http://drupal.org/node/81965

great

greggles's picture

Jose - thanks for the testing and for the confirmation. I'm in basically the same position as you for patching the code - the bug reports are not accurate and my knowledge of i18n is not strong enough for me to make pathauto work with it.

In the next week or so I will be releasing an alpha of Pathauto that uses token module to get all of the patterns. That will be a much better way forward with easier integration, so I'll get back in touch as that passes.

Thanks,
Greg

--
Knaddisons Denver Life | mmm Free Range Burritos

pathauto UTF8 urls support

druvision's picture

Hi Guys,

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.

<?php

              $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've created a separate pathauto issue for this
Amnon
-
Professional: Drupal Search | Drupal Israel | Web Hosting Strategies
Personal: Hitech Dolphin: Regain Simple Joy :)

pathauto with UTF8 test results

druvision's picture

I've tested the new pathauto 5.x-2.x.dev with UTF-8 (Hebrew)

Wanting to test it, I've created a new node and added some of those special characters (?,&,=) to the node title and then tried to save the node.

Test results

  1. URLs and it no longer removes them. That's great.

  2. The only complainet I have is that the special chars above (e.g. ?&=) are not removed but seemingly translitated (I hope I used the correct word, since I haven't had the time to dive into the transliation algorithm).

Wanting to remove those special chars anyway, I've tried to add some of those special characters (?,&,=) to the field 'String to Remove'. I got tons of preg_replace errors - seemingly you are expecting a regular expression.

I got 48 identical errors lines (no alias was created):

warning: preg_replace() [function.preg-replace]: Compilation failed: nothing to repeat at offset 219 in pathauto.module on line 295.

I feel the 'Quotation Marks' option should be included to allow those special chars as well. They should be replaced by dash (not removed) - otherwise some words might be concatenated.

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

Punctuation chars treatment

druvision's picture

I've updated the issue and created a feature request based on the above.

more issues that need assistance

greggles's picture

There are some more issues which need assistance from folks who care and know about i18n.

I care about i18n issues, but I just don't understand them well enough to be able to debug and fix them intelligently.

http://drupal.org/node/164709 - "Pathauto does not support unicode"
http://drupal.org/node/111110 - "Transliteration system does not respect section"

Any assistance would be greatly appreciated.

--
Knaddisons Denver Life | mmm Chipotle Log | The Big Spanish Tour

i use it

Goose4all's picture

hi,

before you remove it from the module.. ;)

i use it sucessfully to transform ä,ö,ü into ae, oe, ue... and i dont wanna miss that :)

That's transliteration a bit

greggles's picture

That's transliteration a bit different from the "i18n integration". I'm speaking specifically about the file http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/pathauto/co...

--
Knaddisons Denver Life | mmm Chipotle Log | The Big Spanish Tour

oxygenerror's picture

Project name : GUI add multi language
Project description :
การใช้งานเวปไชค์มในแต่ละประเทศมีความแตกต่างกันในด้านของภาษาในการทำงานของ Multi language นั้นจะทำให้การใช้งานและการเข้าใจในการติดต่อสื่อสารลายละเอียดให้เข้าใจเป็นความหมายเดียวกันและทำให้สะดวกในการใช้งานเวปมากขึ้น โดยตัวโปรแกรมจะมี mode Edit เพื่อทำการเพิ่มคำใหม่ๆลงในตัวเก็บภาษา เพื่อทำการแก้ไขตัวเวปได้ทันที และเมื่อต้องการใช้งานแบบภาษาตามเดิม เราก็สามารถเปลี่ยนกลับไปเป็นโหมดเดิมได้ โดยการเลือกในช่องเลือกภาษาตามที่ต้องการ
Over view
I'll add multi language by use I18N for drupal6.1 plus GUI for add multilanguage and multi selection use language in web. Use by Edit mode .when you entry in edit mode you can edit language and save you language but if you want it back you just can choose the “droupdown list” and change other language do you want.

Implementation details:

Java Script and PHP

Resource:
http://groups.drupal.org/i18n

My Profile:
Name : keattikun
Lastname: sittiyoth(Oxygenerror)
E-Mail :Oxygenerror@hotmail.com
Age: 23

benefit to drupal community
schedule/timeline

hello ...greggles

oxygenerror's picture

hello I'm keattikun. I ask for adviser for my project(SOC.2008). my project is GUI multi language (standard I18N)
my module can change the language by "inplace" old language to the new or understand language and you can save your language
and then you can change language on web page to be your language wed page such as when you open web drupal is english language but you want to be a change wab page is thai language you just right click then you can change thai language or other language if you want to be a change.
that is my project
cloude you suggest me please.
contact me "oxygenerror@hotmail.com"
thankyou alot.

edit...

oxygenerror's picture

hello I'm keattikun. I ask for adviser for my project(SOC.2008). my project is GUI multi language (standard I18N)
my module can change the language by "inplace" old language to the new or understand language and you can save your language
and then you can change language on web page to be your language wed page such as when you open web drupal is english language but you want to be a change wab page is thai language you just right click then you can change thai language or other language if you want to be a change.
that is my project
could you suggest me please.
contact me "oxygenerror@hotmail.com"
could you leave your E-mail address please...??.I need you to be my adviser.
thankyou alot.

Hi keattikun, I'm not sure I

jose reyero's picture

Hi keattikun,

I'm not sure I understand what you're going to do but if you're implementing new multilingual features on top of Drupal 6 and/or i18n module, I'd invite you to give a try to existing modules before and let us know which new features you plan to add.

Or if you need any support about i18n module, please let me know

mailed as well

greggles's picture

I sent an email as well, but since this thread is based on the idea that I know nothing about i18n I'm not sure how I could be a mentor to a project related to i18n. Luckily Jose is the right person to be helping, so thanks for commenting.

--
Open Prediction Markets | Drupal Dashboard

two 6.x issues making Pathauto more valuable...

greggles's picture

There are two issues that drewish is working on which will make Pathauto more valuable for i18n. One is already fixed, one needs reviews:

Fixed: #210595: Create equal aliases for one translateble node in different languages

Needs reviews: Add per-language patterns for multilingual node types

--
Open Prediction Markets | Drupal Dashboard

Quick reality check

alexiscott's picture

Hi,
I am about to start working on a site that uses pathauto and i18n and just want to check that this is a good approach

  1. Should we use something like [lang]/[title-raw] or is there another way that pathauto does this?
    One reservation is what it says on the handbook page:
    http://drupal.org/node/134003
    "it is advised to use only paths without language prefixes and to use different path alias for different languages"
    ...But then again, I have found using the language prefixes the only way to have menus switch.

  2. Should titles, and thus urls remain the same. All drupal sites I have looked at , that handle translation, use, example:
    en/my-title
    es/my-title
    I have not seen anther way to do it, and this seems to be the only way that works with the block language switcher that comes with the i18n module as it simply changes the language prefix. Were It to have different titles I think there would be a page not found error.
    However I can see this causing complications if we actually wanted a different title for the node but the same URL. I presume we would need to manually override Pathauto to make sure that the URL is the same (apart from probably the language prefix - that relates to my first question - and of course Drupal would not allow you to have the same path alias anyway).

Internationalization

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week