Hi,

I've upgraded my previous site (for Jose: not newoceans.nl) from 4.6.6 to 4.7 and replaced the i18n module folder (version 4.6) with the new one (cvs). Updated the database (update.php), so far so good.

In the previous version it was possible to translate menu items by adding language dependent variables in settings.php (e.g. phptemplate_primary_links) and combining this with the i18nmenu module.

However, in the cvs version there's not such a module anymore and I haven't been able to get menu items (in this case: primary links) translated. I have additionally downloaded and installed the 4.6 version of i18nmenu module, which at least makes it possible to translate the menu items (using localization, like it used to be done), but I can't find out how to get the translated strings working in the site...

Should i18nmenu module be part of i18n, does anyone know? If negative, how can menu items then be translated? If positive, there's probably something missing...

Looking forward to replies!

Cheers,
Marc

Comments

svendecabooter’s picture

Experiencing the same problems when trying to translate menu items...
Hope this can get solved :)

Marc Bijl’s picture

Some additional info about how international menu items, e.g. primary links, in 4.6 -most likely- differs from 4.7 by giving a description of the way I used to define them in 4.6.

May be this can enlighten things a bit and help solving the issue (:

  • As said in a previous post, in 4.6 I created language dependent variables in settings.php, e.g. phptemplate_primary_links.
  • I also installed and used i18nmenu.module.
  • Then I created a menu and defined menu/submenu items in English (administer > menus).
  • To translate these menu item strings (mainly for the sub menu items, as you will see later), I used localization (administer > localization).
  • Next thing, defining the main menu in English. For this, I used primary links, which I found under the theme configuration:
    http://www.example.nl/en-local/admin/themes/settings/name-of-default-theme (watch the language prefix: en-local!!!). So, this is where I defined the english main menu items with the right paths.
  • To define the main menu in Dutch, I did the same but this time at this theme configuration:
    http://www.example.nl/nl/admin/themes/settings/name-of-default-theme (watch the language prefix: nl!!!). So, this is where I defined the dutch menu items with the right paths.
  • To define the sub menus, I hard coded in the page templates:
    <?php
    $TheMenu = theme_menu_tree(mid);
    ?>
    

    And this worked: menu items were translated automatically, because of the work done with localization, in combination with (I suppose) i18nmenu.module

Not sure if my approach has been the right one, but hey, it worked!

Main (and important!!!) thing here is that primary links (main menu) were defined in the theme configuration, at exactly the same path, except the language prefix:

- http://www.example.nl/en-local/admin/themes/settings/name-of-default-theme (for english)
- http://www.example.nl/nl/admin/themes/settings/name-of-default-theme (for dutch)

As far as I can see now, such workflow for administering multi lingual is not possible in the current version of Drupal (4.7) and i18n (cvs).

That's basically it! Just for info (:

Hope can be helpful...

BTW
Some more info about how I got things working in 4.6.6 can be found here:
- http://drupal.org/node/37168#comment-112671

Marc Bijl’s picture

Hmm...

You'll all understand the paths mentioned were:

- example.nl/en-local/admin/themes/settings/name-of-default-theme (for english)
- example.nl/nl/admin/themes/settings/name-of-default-theme (for dutch)

omar’s picture

Ummm.... I feel like I must be missing something... but I just took the i18nmenu.module from 4.6, shoved it into 4.7 and it seems to work as before... i.e.

1) add the i18nmenu.module and enable it.
2) add a menu item (within the english interface)
3) switch interface languages
4) go into localisation, find the string and translate it

Problem solved no? Am I missing something here?

Marc Bijl’s picture

That sounds like good news to me!

And yes, as if I've done something wrong... So, tonight I'll give it another try.

But: does it work for primary links too? I suppose the answer must be possitive, as primary links are part of the menu system in 4.7.

Marc Bijl’s picture

Title: Translating menu items in i18n cvs (preparing for 4.7) » How to get i18n_menu (4.6.6) ready for Drupal 4.7 ?

Allright. Translating primary links works (: As I wrote:

I have additionally downloaded and installed the 4.6 version of i18nmenu module, which at least makes it possible to translate the menu items (using localization, like it used to be done), but I can't find out how to get the translated strings working in the site...

The thing is, the two primary links of either language are pointing to the same node (so indeed, the title of this topic was not the best one I could have used...). To illustrate this:

Resume: one primary link must be able to point to two different nodes, an English one and a Dutch one, dependent on the interface language being used.

Therefore, in 4.6.6 I used to define primary links in the theme settings this way:

  • Set administration interface language to English
  • Went to theme settings, defined English menu items with URL aliases to English nodes
  • Set administration interface language to Dutch
  • Went to theme settings, defined Dutch menu items with URL aliases to Dutch nodes

And that was basically it. Now in 4.7 I can't find out where to define the two different URL aliases for one and the same menu item.

First I tried to switch administration interface languages and changed the menu item and its URL alias in the menu system (as I used to do with the theme settings), but that did not work; it seems that a menu item defined in the menu system can have only one language at a time, independent of how many and which interface languages are used.

Second I tried to define different menu items in the specific menu settings of each node, but that resulted in an extra primary link which seems a bit silly: "advertising" next to "adverteren" in the menu bar. Needs twice as much space too...

May be I'm doing something terribly wrong, so it would be great if someone can help. Thanks!

Cheers,
Marc

Marc Bijl’s picture

Just FYI: It seems a menu module will be introduced for 4.7, Jose is working on it.

This morning (12-05-2006) I found this post http://drupal.org/node/37855#comment-97635 where Jose refers to a new block translation module. More in general, he refers to an additional 18n module module directory (contrib) in the cvs area, where a readme.txt says:

********************************************************************
These are additional modules for i18n package
********************************************************************

These modules depend on i18n.module and provide some additional features

i18nblocks module
-----------------
Provides language dependant blocks.
You can define meta-blocs that will show up a different block depending on language.

i18nmenu module [Not yet updated for 4.7]
---------------
Translates menu items.
Runs all admin editable menu item names through localization.

i18nfilter module [Not yet updated for 4.7]
----------------------------------
Provides a filter for language switching in text.
Contributed by Thomas Mandys

So, that's the status - I suppose.

jose reyero’s picture

Status: Active » Fixed

The module is working, and I removed that note from the README

Marc Bijl’s picture

Ok, and thanks. But somehow I cannot get it working, see:
- http://drupal.org/node/63691

Must be me ;-)

So, I'll leave this post as fixed and suggest to use topic #63691 for further investigation.

Anonymous’s picture

Status: Fixed » Closed (fixed)