The documentation of i18n says the module works with URL aliases:

To have aliases for a translated node/page, you have to define each of them. I.e.:
- en/mycustompath -> node/34 (which is suppossed to be the english version)
- es/mycustompath -> node/35 (which should be the spanish version)

This is true if you want to use "../mycustompath" as the one and only URL alias for the node in both languages. However, in the same example I would like to use something like "en/englishpath" as URL alias for the english node, and "es/spanishpath" as URL alias for the spanish node. First, because it makes more sense, second, because search engines can find the page by using path in two languages.

Does anyone know a way to make this possible?

I cannot figure out how to link from one menu item to two possible nodes (dependant on the sites language), otherwise than described in the quote above. The same issue for linking from one menu item to two possible taxonomy terms - for an overview of a category of pages in the right language.

Am I missing something? Hope someone can help...

Thanks,
Marc

Comments

Marc Bijl’s picture

Would love to get it working...
___________________
discover new oceans
lose sight of the shore

sKanD’s picture

My guess is that the path alias form can be filled with whatever you may want.

Does it make sense ?

--
@+
sKanD
aka Stephane Carpentier

Marc Bijl’s picture

Hi Stephane,

You're basically right, the path alias can be filled with anything I want.

My problem however is, I usually have 2 nodes for the same piece of content: 1 node in dutch, and 1 node in english. These 2 nodes have 2 different aliases as well, i.e. "webdesign/analyse" for the dutch node, and "webdesign/analysis" for the english node.

Question: how can 1 (by localization translated) menu-item link to 2 different aliases? It is only possible to define 1 path (alias) as the link for a menu-item. But, dependant on the language the site is viewed in, my menu-items have to decide whether to link to the dutch alias, or to the english alias...

There is no problem if I define the same aliases for both the dutch and the english node. But that is not what I prefer. I would like to have dutch aliases for dutch nodes, and english aliases for english nodes.

___________________
discover new oceans
lose sight of the shore

sKanD’s picture

Hi,
It seems that you're a step ahead from me concerning your navigation bar on your site. Well, that's another problem...

I was going to say something like : make a path alias like:
en/englishpath-->en/mycustompath and es/spanishpath-->es/mycustompath
but that useless I think because i will only works for link you click on and not for a switch between languages...

I don't know yet but that's part of a problem I'm looking after too.
Maybe try to mail the author of the module?

--
@+
sKanD
aka Stephane Carpentier

Marc Bijl’s picture

Hi Stephane,

Thanks for the reply! I have had quiet a lot of contact with the maintainer of i18n.module (Jose Reyero), mainly regarding his new i18n_menu.module for translatable menus:

   • http://drupal.org/node/14783 (#21 and #24).

Might be interesting for you too - btw...

Unfortunately for me now, he's very busy to prepare i18n (and probably i18n_menu as well) for drupal 4.7. That means: a little hard to get in touch...

But if that means these modules will do the trick in 4.7 it's definitely worth waiting!

Cheers,
Marc
___________________
discover new oceans
lose sight of the shore

sKanD’s picture

Hi Marc,

That's definititly good news! :-D
I was struggling with my own i18n for a site of mine and that seems to be solving some questions I have.

Thanks for your reply! And sorry for not being enough helpful with your problem.

I have good hope to make it work too.
--
@+
sKanD
aka Stephane Carpentier

svendecabooter’s picture

Sorry to bump this old thread, but did u find a solution to this problem, as i'm having exactly the same issues...
I have no idea how to make this work, but i really need it this way, so it's really doing my head...
I'm using drupal 4.6.6 BTW

Marc Bijl’s picture

- Configure localization

- Install i18n etc etc

- To switch off the language link at the bottom of each node,
I have implemented the code of http://drupal.org/node/17829#comment-44729

- To make the language block work correctly (or at least the way I wanted it),
I have implemented the code of http://drupal.org/node/22345

- Enable clean URL's: administer > settings > clean URLs > enable

- Create a node in a certain language, e.g. english (en-local)
- While doing this, define the path alias*
- Save node

- Create a translation by using the translation tab
- Define the node in another language, e.g. dutch (nl)
- While doing this, define the path alias*
- Save node

  * NOTE:

     If path aliases are really different, don't use a language prefix in the path alias:
     - For the english node "Graphic Design" I define path alias "graphic-design"
     - For the dutch node "Grafisch Ontwerp" I define path alias "grafisch-ontwerp"

     If path aliases are the same (e.g. international terms), use a language prefix in the path alias:
     - For the english node "Contact" I define path alias "en-local/contact"
     - For the dutch node "Contact" I define path alias "nl/contact"

- For pointing a primary link** to one of these nodes, use exactly the defined path alias,
which (see *NOTE) can be with or without language prefix (e.g. "grafisch-ontwerp", and "nl/contact").

  ** NOTE

       Be aware that, when administering a site, 
       changing the language prefix in the URL address bar will give different administrations(!)

       So, defining primary links (defined in the theme) for the english website,
       I change the language prefix of the theme administration's URL to /en-local/

       And, defining primary links for the dutch website,
       I change the language prefix of the theme administration's URL to /nl/

- For pointing internal links to one of these nodes, always use the full path alias,
by which I mean, always a path alias including the language prefix (e.g. /en-local/graphic-design and /en-local/contact).

I think -and hope- that's basically it!

It has been quite some time ago I installed and configured this module, so I hope the information I gave is complete and still up-to-date...

Succes!

___________________
discover new oceans
lose sight of the shore

svendecabooter’s picture

Thanks a lot for the well documented and fast reply.
I will try to put your explanation to practice tomorrow.

I wasn't aware that u could change the primary links according to the language selected.
I gave it a fast try, and changing a primary link in 1 language, also changed it in the other.
But maybe i forgot a detail.

The last link to the patch looks very promising :)
It gives me some new hope that it will be possible to implement, coz today my hope almost vanished :)

Thanks a lot!

svendecabooter’s picture

Hi,

I can't get the second note to work..
If i change the language prefix on administrative pages, everything i edit, gets edited in both languages.
I tried with Xtemplate and PHPtemplate, and it doesn't work...

Either way, i want to use a menu from administer > menus anyway to store the menuitems.
I think it will be not possible to get it working...
The menu item should point to 2 different paths, eg. if the page is viewed in English, a link should point to en/news, if the page is viewed in Dutch, it should point to nl/nieuws.
As far as i can see, this is not possible. Too bad, coz i really wanted it that way.

Marc Bijl’s picture

Hi xeniox,

Unfortunately, I don't a lot of time before the weekend, so I'm not able to write extensive instructions. Anyway, two things: translating primary/secondary menu items, and translating menu items defined in the menu system.

1. Translating primary/secondary links
What I've described in http://drupal.org/node/37168#comment-112671 is about primary links. To get this working, it's important to create language dependent variables, as written in install.txt of i18n module. It might be the reason why it doesn't work for you... The install.txt says:

Language dependent variables
============================
The list of variables to be made language dependent must be defined in the config file:
    $i18n_variables = array(
        // Site configuration
        'site_name',
        'site_slogan',
        'site_mission',
        'site_footer',
        'anonymous',
        // Node help
        'blog_help',
        'story_help',
        // User configuration
        'user_registration_help',
        'user_mail_welcome_subject',
        'user_mail_welcome_body',
        'user_mail_approval_subject',
        'user_mail_approval_body',
        'user_mail_pass_subject',
        'user_mail_pass_body',
        // Theme settings: primary and secondary links, logo, etc..
		'theme_settings',
        // These are for PHPtemplate
    	'phptemplate_primary_links',
    	'phptemplate_primary_links_more',
    	'phptemplate_secondary_links',
    	'phptemplate_secondary_links_more',        
    );
These are only the suggested ones, but you can add as many Drupal variables as you want to the array.
You need to redefine these variables for the first time for every language, as previous values are lost and they return to defaults -they will be back if you disable i18n-. 

2. Translating menu items defined in the menu system
Did you install the i18n.menu module? Nowadays, the i18n.menu module is part of the i18n download. At the time I started experimenting with translating menu items, the sub module did not exist. In this post (and sub posts) you can read the conversation Jose Reyero and I had when he was developing this sub module:
- http://drupal.org/node/14783
- http://drupal.org/node/14783#comment-54905, which refers to:
-- http://drupal.org/node/14783#comment-52608
-- http://drupal.org/node/14783#comment-52805
- http://drupal.org/node/14783#comment-55490

Another thing to realize is that translating menu item titles is done through the localization system(!). This means, I defined an english menu in the menu system, and translated all the titles seperately through the locales module (localization).

If I'm right, the search for the right path alias (that is in the right language - so with the right language prefix) is done by the i18n.menu module.

I hope you can find some interesting information in the posts I've mentioned. Don't give up, it is possible! If you do not manage, may be next week I can find some time to look after it.

Success!
Marc

___________________
discover new oceans
lose sight of the shore

svendecabooter’s picture

Thanks! I managed to get it working :)

Marc Bijl’s picture

Cheers mate!

___________________
discover new oceans
lose sight of the shore

Bevan’s picture

Just a note on how I acheived this:

Alias System

Contact_Us node/1
en/Contactanos node/1
es/Contact_Us node/2
Contactanos node/2

where node/1 is the english node, and 2 is the spanish node.

Not the most efficient, but it works.

shixi’s picture

beto_beto’s picture

hi am using drupal 6 for multi language now when i copy the article URL to any social page like twitter or Facebook pages it give me character like this 2%D9%8A%D i don't find a solution for that can any one please help me