I working with multilanguage site with subdomains and want to do an equal navigation in subdomains, for example:
english site - http://mysite.com/node1.html - displays node in english language
german site - http://de.mysite.com/node1.html - displays node in german language
russian site - http://ru.mysite.com/node1.html - displays node in russian language

In Drupal 5 table 'url_aliases' have no language affiliation for aliases. And then there was no opportunities to make equal aliases for different translation of one node. Therefore, Pathauto adds numbers to equal aliases:
english site - http://mysite.com/node1.html
german site - http://de.mysite.com/node1.html-0
russian site - http://ru.mysite.com/node1.html-1

Drupal 6 have additional field 'language' in 'url_aliases' table. At this time Drupal 6 have a way to do an equal navigation in multilaguage sites with subdomains with original path module.
And, I think, pathauto module for Drupal 6 needs some patches for solve my problem and expand his functionality. Does anybody have some developments for this way?

Comments

murz’s picture

Status: Active » Needs review
StatusFileSize
new6.97 KB

I create a patch for the HEAD version of pathauto that adds functionality to create equal aliases for multilanguage nodes, in my multilanguage site on Drupal 6 RC2 with subdomains it works well.
Please anybody do some test with it on your sites with other types of multilanguage or some code reviews for errors and bugs.

murz’s picture

StatusFileSize
new7.32 KB

New patch for HEAD version, fixed an SQL error with dublicated language field on bulk update.

greggles’s picture

Murz - this is really exciting. Thanks for your work here. I did some testing with the new i18n features in 6 and new that we would need some fixes in Pathauto to really make Pathauto work well for D6 but I wasn't sure where to work.

Can you describe why you added this line?

+ $type_where .= " OR `type` = '%s'";

Could you provide a set of steps to test this module:

1. Install Drupal6
2. Enable German and Russion
3. Set your Pathauto pattern for pages to ?
4. Create a page with the title ?
...

Thanks!

murz’s picture

Can you describe why you added this line?
+ $type_where .= " OR `type` = '%s'";

When developing, I got some errors with this query, PHPMyAdmin shows me that 'type' is reserved sql-word and I try to escape it with quotes. But error was not in this place, but I forgot to remove this changes when creating patch. You can discard this .

Steps:
1. Install Drupal 6.
2. Enable 'Content translation' and 'Locale' modules.
3. Enable German and Russian languages.
4. Go to 'admin/settings/language/configure' url and set 'Language negotiation' to 'Domain name only'.
5. Go to edit language page (admin/settings/language/edit/de etc) and type full domains for non-native languages (http://de.mysite.com).
6. Create node and set language to english with pathauto alias like 'nodetitle.html' for example.
7. Go to 'Translate' tab and create translations in de and ru languages with same pathauto aliases.
8. Test your site with urls: http://mysite.com/nodetitle.html, http://de.mysite.com/nodetitle.html and http://ru.mysite.com/nodetitle.html - all must works!
That's all. Maybe I forgot something.

P.S. Sorry for my "English" :)

greggles’s picture

Component: Code » i18n Stuff

Better component.

Also, your English is great. No need to apologize.

drewish’s picture

Component: i18n Stuff » Code
Status: Needs review » Needs work
StatusFileSize
new8.18 KB

Patch doesn't apply cleanly any more... here's a re-roll minus the `type` parts. I also fixed a some of the PHPDoc to make it more consistent.

drewish’s picture

Component: Code » i18n Stuff
Status: Needs work » Needs review
StatusFileSize
new8.12 KB

fixed some problems with the parameter order in calls to db_query_range().

drewish’s picture

Status: Needs review » Reviewed & tested by the community

greggles said that one i was comfortable running the patch on my own server to mark this RTBC.. the path generation all seems correct but i'm now wishing i had a per node-language translation string.

greggles’s picture

Status: Reviewed & tested by the community » Fixed

Thanks very much Murz and Drewish.

drewish’s picture

Status: Fixed » Reviewed & tested by the community
StatusFileSize
new2.04 KB

turns out i wasn't fixing those db_rewrite calls and i added a line of cruft.

greggles’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again. Applied to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

spsingh’s picture

Dear,

step 7 is not clear,
7. Go to 'Translate' tab and create translations in de and ru languages with same pathauto aliases.......

could u please tell me How I can enable 'Translation' Tab.

sriprakash.singh@hytechpro.com

drewish’s picture

spsingh, enable the content translation module

aliyayasir’s picture

Component: i18n Stuff » Code
Category: feature » bug
Priority: Normal » Critical
Status: Closed (fixed) » Active

I am using D6.22 and pathauto6.x-1.6 that is already pathced this bug
but i have still issues. i.e:
when i am saving a node into English the URL alias is perfect like www.example.com/en/content/[title-raw] but when i want to check the same node in Arabic it is showing drupal default www.example.com/ar/node/1234

dave reid’s picture

Component: Code » I18n stuff
Category: bug » feature
Priority: Critical » Normal
Status: Active » Closed (fixed)

Please do not re-open issues that have been closed for three years.