Last week on a different installation of i18n and Drupal 5.0, I followed the instructions here http://drupal.org/node/83514 to get the Primary Links to switch languages when the visitor switches the language of the website. It seems to have worked.

(At least, I think it worked. According to my own message at that thread, I claim it didn't work for me. But that is because I think I was looking at the menu from an Administer screen -- and not from a regular page. I have come to realize that you must always view the navigation blocks from a regular page. Otherwise, you will (always?) see *both* languages in the Primary Links navigation bar.)

However, through trial and error I think I have discovered another way to accomplish the same thing -- but without adding stuff to /sites/default/settings.php. If someone has already posted these, I'm sorry. I didn't see detailed instructions like this. Also, I'm posting them in case I've done something horribly wrong that will have unforseen (to me) effects on my Drupal website.

Here are my instructions for how to create bilingual Primary Links (in English and French):

1. From any English page, click Create content
2. Click Page (or Story, whatever)
3. In Title box, enter About
4. In Multilingual settings, make sure English is selected
5. Enter Body text (optional for the purposes of this demo)
6. In Menu settings -- Title box, enter AboutAbout (I chose to write it this way temporarily... you'll see why after)
7. In Parent items, select Primary links
8. Leave the other options alone and click Submit

In my example, a page was created and has the url en/node/19 and AboutAbout is now displayed on my Primary Links. Okay, now let's add the French text.

9. From the English page, click Translation

The page url should now be: en/node/19/translation

10. Click Francais in your sidebar Languages section (or whatever is the name of your second language link)

The page url should be: fr/node/19/translation

11. Click Create translation
12. Enter new (French) text in Title and Body fields
13. In Menu settings (which may be called something else because we're looking at the French UI), enter AproposApropos (which is French for AboutAbout)
14. In Parent items (or Element parent), select Primary Links
15. Press Submit (or Soumettre)

A new page with the URL fr/node/20 has been created. If you click on a random content page in your sidebar, you'll see the English or French navigation (Primary Links) listed. You'll note that both AboutAbout and AproposApropos appear when viewing the English version of the site or the French. Let's fix that.

16. From any English content page on the site, click AboutAbout
17. Click Edit
18. In Menu settings, click edit the advanced settings
19. In Language, select English
20. In Title, change it to About
21. Click Submit

If you click on a random (English) content page in your sidebar, you'll note that AboutAbout has been replace in the Primary Links by About. But the French text AproposApropos is still there. For fun, click the Francais button to switch the content of your random page to the French version. You'll note that the AboutAbout (or About) has disappeared. Perfect. Now let's repeat the last few steps, but on the French page AproposApropos.

22. On any French content page, click AproposApropos from the Primary Links
23. Click Edit
24. In Menu settings (or Parametres du menu), click edit the advanced settings
25. In Language (or Langue), select French
26. In Title, change it to Apropos
27. Click Submit (or Soumettre)

Click on any random content page and switch from English to French. You will see that the Primary Links change fron English to French perfectly.

I'm looking for feedback on whether these steps are good or not. They work. But maybe there's an easier way make Primary Links bilingual.

- Thumper

Comments

ebw’s picture

my personal preferences are also en/fr, however for the site i configured the better choice is en/es.

i'm not happy with how the translation map works, and my notion of access in en/fr/es is not so much litteral translation as content equivalence, more "two (or three) newspapers with the same stories, but not the same word counts or extranious similarities.

i don't know yet how i'll handle spanglish or engsais, code-switching.

signature left on blank check, reward if found

Stretsh’s picture

I figured out that there is a shorter way to do this:

1: create your content (about page)
2: Give this page an alternative URL (en/about) <-- this is necessary because the FR URL path will tell you that the path already exists.
3: Submit
4: Translate your content (Apropos)
5: Give this translated page an alternative URL (fr/about) <-- also call it about
6: Submit
In both cases don't mind the menu section, leave it as is.
7: Go to Administer->Site building->Menus
8: Add an item under Primary links
9: Select English
10: Add the title ("About us")
11: As path you specify "about"
12: Set the weight (optional) and Submit
13: Repeat 8 - 12 for French, where title is "Apropos" and path is "about". The weight can be the same as the English item

This should do the trick. It does work in the menu, but the only problem I'm having is with the Language switcher.

adrienf’s picture

Did you succeed to show children items when parent item is clicked?

ricardo.wing’s picture

I've found an easy way to do the translation for the menu... here it goes...
1- Create the content in the base language...
2- assign the the normal name for the menu item
3- give an url path** optional **
4- submit
5- translate the content
6- submit
7- (and here is the trick) go to admin->menu-> "your menu name" -> edit
8- there you must just change the language (MAKE SURE YOU PRESS "CHANGE" WHEN YOU SELECT A LANGUAGE) and give the translated name to your menu item
9- submit

Then you can see that when you change your language, also the menu does...

Thanks for all. I couldn't do it without your help...
Thanks again everyone

jtroshani’s picture

Under Laungage Configure, what do i select,
None,
Path prefix only,
Path prefix with language fallback or
Domain name only?

Do i need to install contributed modules beside the core modules?

Thanks

Bamboostar’s picture

Thanks, thumperstrauss for the instructions. Do they work for 3 languages as well? I tried using them to create trilingual links as I'm using Chinese simplified, traditional and English. The links for all 3 languages still appear in the primary links. I can't seem to get them to switch between each other. Any help would be greatly appreciated.

Bamboostar’s picture

transformative’s picture

I've had some success in streamlining my process for a large multi-lingual site, by making some small changes to the modules and by using the pathfilter module.

I've created a small patch for translating the URL aliases automatically.

http://openconcept.ca/blog/kevin/i18n/form_fields/url_alias_translation

If you have a link called en/some_url_alias, it will automatically populate the url alias field with fr/some_url_alias when you are translating into french. This is helpful for a larger site, when the users aren't as familiar with the url alias format required.

I am also using the category module with i18n (with a number of challenges). Here are the steps I follow, in doing a translation, with the category module:

http://openconcept.ca/blog/kevin/i18n/content_structure/process

...
Kevin.

jtroshani’s picture

Under Laungage Configure, what do i select, None, Path prefix only, Path prefix with language fallback or Domain name only?

Thanks