Last updated September 5, 2006. Created by jayvee on August 28, 2006.
Log in to edit this page.
It took me some time to figure it all out, but I have everything working now:
- installed drupal 4.7.3
- installed i18n, 4.7
- installed nice_menus
Activate locale, path, page and all i18n modules. Import languages through administer -> localisation (these are translations of the menu's).
First you have to define, in the administer > settings > content-types pages, which content types you want to have in multiple languages. Then, a 'language' field and a 'translations' tab - provided you have also enabled the 'translation' module, included in the same package - will show up when creating or editing that node types.
Use the translation block, not the languate switcher block (found in administer -> blocks).
MAKE SURE YOU SET A LANGUAGE FOR EVERY PAGE/ARTICLE YOU CREATE!
Ok, I'll explain the rest with an example:
Let's say you're creating a page "hello" and set the language to English. Go to URL path settings (on the page where you edit "hello") and set the alternate path to "en/hello" (without the quotes, obviously).
Click translation and translate. In this example, we are translating to Dutch (nl). LEAVE THE MENU SETTINGS ALONE. Again, go to URL path settings and enter "nl/hello".
Ok, that being done, we now edit the primary links. So click "edit primary links" (top right if you're still working in the default skin).
Go to the menu item "hello". Click edit. Set the Path to "hello" (NOT "en/hello" and NOT "nl/hello", just "hello": the language things in the background will add the en/ or nl/ in front of the hello depending on which language you've selected in the language switcher block).
Now, depending on which language you have selected, you should be lead to the correct page.
However, you still see "hello" in your navigation bar, regardless if you're working in english or dutch. Of course we want there to be "hallo" (dutch translation) in the menu if we're working in dutch. This you do in the administer->localization menu. There you go to the tab "manage strings", enter hello as the string to search for and search. You will then get one or a few items, pick the one saying just "hello". If nl is in strikethrough, then it hasn't been translated yet. Click edit and translate.
Now, when Dutch is selected, the menu-item "hello" will be shown translated as "hallo".
We're almost there. Everything should be working fine, except if you have expandable items: they don't expand any more. Very annoying. This is why we have the "nice_menus" module: go to administer->settings->nice_menus and make sure the number of nice_menus is set to at least 1. Then go to administer->blocks, where you will find a nice_menu. Click configure, give it a nice name i.e. "navigator", set source menu tree to "Navigation". Pick a menu style. Save. Enable it somewhere and disable your old "Navigation" menu.
Your nice_menu navigator WILL expand menu-items where the standard navigation menu did not. Plus nice_menus just looks a lot better (imo).
Now, if you have the page "hello" in English but not yet translated to Dutch, clicking "hello" when in Dutch will lead to nl/hello, which isn't configured yet. So you'll get a 404 page not found.
To show the English instead of nothing when you haven't got the translation yet, go to administer->url aliases. You will there see all the aliases you've already set. Look for the one "en/hello" and note to which node it goes. Then click "add alias" and add as existing system path the same node that "en/hello" refers to. Fill in "nl/hello" in the second field, as the alternate path.
You'll have to undo this before creating the translation, because you will then let "nl/hello" refer to the node with the Dutch text (as explained above, by just setting nl/hello in URL path settings on the Dutch page).
OK, this should be it (it worked for me).
PS: if you're working with sub-pages/sub-stories (whatever, if it's sub), there is no problem using a path like i.e. en/hello/world and another one like en/hello/universe when "world" and "universe" are your two sub-things from "hello".
PPS: I've only been using Drupal for a couple of days, just trying it out really, and I must say it looks great. BUT translations are somewhat a pain in the ass to do all the settings and I think many more sites could have an advantage in using Drupal if only it supported multiple languages better. I would even go as far as to say this should be core functionality (imo).
PPPS: in my explanation, I've used (and copied) some text found spread over the Drupal website. I didn't take the time to mention the names of the people who's contributions I've used to figure it out (because there were plenty), but thanks guys, I'd still be looking if you hadn't given me the pieces to put together.
Comments
clarification of menu settings
In the example, I tell you to leave alone the menu settings of the translation.
This does not mean you can't fill in anything in the menu settings of the original (in my example: "hello", the english page), you can use the menu settings there like you would on any normal (=nothing to do with translations) page.
However, if you would fill in menu settings for both the original and a translation, then both pages would show up in your navigation block instead of just the one. And that's not what we want, obviously.
Languages block
Everything seems to work except that the Language block does not switch the page correctly.
Say the Italian (my language) page is node/1 and the English one is node/2, aliased respectively as "it/hello" and "en/hello". When I'm in the Italian page, I have the following in the Language block:
- Italian points to it/hello
- English points to en/node/1 (which reverts to it/node/1)
When in the English page:
- Italian points to it/node/2 (which reverts to en/node/2)
- English points to en/hello
Is this a bug?
Anything I can do?
use Translations block not Language Switcher
I can't emphasize this enough since I've spent the last couple weeks confused over this:
use the Translations block!
Do NOT use the Language Switcher block. This block seems to be just able to switch the user interface between languages, not between the nodes that you have linked together with the translation tab (which only appears with the i18n module).
-------
Herb van den Dool
-------
Herb van den Dool
Web Developer at Freeform Solutions
Remember to enable the "translate nodes" permission
Remember to go to Administer > access control and enable the "translate nodes" permission. Otherwise, you will not be able to create new translations.