MULTILINGUAL menu / content problem

PePiToO - November 15, 2006 - 02:38

I use the module i18n, very good for ARTICLES translations. But i was wondering why we can not do the same for the MENU ( primary links ) .
If i use the localization, and use a translation for my menu, then if i change language, the language change , ok, but the menu which was selected is no more selected.
Then, my second problem is :
if i choose to associate an english article to an englsih menu, ok no problem, i create my article, create my menu and make the link between them.
I translate this article to French. So in my content folder, i have 2 articles : the french one and the english one.
But for the menu, if i use the localization to translate it, there is still only one menu in the menu administration, so how to associate this french article with this french menu ?????
How to change language without deselected the menu i used ?

Is somoene understand ?

Two menus

incrn8 - November 15, 2006 - 02:59

I have found that the best solution is to have two menus: one English, one French. Each will be a separate block. Enable both blocks. For English menu block, display only on pages en/* and for French menu block display only pages fr/*. That should work for you.

The only bad thing with this approach is that you must maintain two separate menus. So if you change something in the English menu, you must yourself change it in the French menu. C'est pas automatique.

______________________________________________________________________________________________________
Recent Drupal websites: http://mbacasecomp.com and http://hudsonhistoricalsociety.ca

:O

PePiToO - November 15, 2006 - 10:08

It is not so easy to manage !

How to do that ?

First, I cannot configure my block ( no place to add custon php for my menu blocks )

Then, I totally don't know what to do. I need some help as i totally forgot my few php knowledge and the drupal performance.

I tried to make the localization work for my module. My website is in english, i added french.
So when i change language, the menu change to French.But if i use a link from this French menu, it shows the article in english version and have to click to french translation again...

There should have a way to manage this !

:)

incrn8 - November 15, 2006 - 12:51

No it is not that easy to manage two menus. If they are very big menus (lots of options) then you might want to use Category module. It will create menus from the titles of containers. so managing that is a bit easier.

For the block settings, you will see each menu listed in administer > blocks. Click configure next to each one. Scroll down to 'Page specific visibility settings'. Tick 'Show on only the listed pages'. In the box below this enter en/* for the English menu and fr/* for the French one. No PHP needed.

For this method, do not use localization to translate the menus - it doesn't work properly.

______________________________________________________________________________________________________
Recent Drupal websites: http://mbacasecomp.com and http://hudsonhistoricalsociety.ca

Cannot use category to

PePiToO - November 16, 2006 - 02:30

Cannot use category to organize my content as the category itself cannot be translated !!! no use for category in multilingual website...
So it means each time i create an article, I have to specify the link between the french menu nor the english menu... what a mess !

Yes, but its not that bad

incrn8 - November 16, 2006 - 03:26

It may seem like a mess to you, but I never found it that much of a problem. When I created the mbacasecomp.com site, my workflow would be as follows:

1. create the node in English, and give it a URL alias that links to a menu item (or you can create the menu item as you create the node). Link the menu item to the English menu parent.
2. once the English page is done, click Translate and change the text to French. At the same time, I change the menu link to a French one. Link this French menu item to the French menu parent.
3. That's it. Pretty simple I think. Now you have English page with English menu link and a French page with French menu link. Then use the tip above about the two menu blocks only being shown on specific pages.

As for category module, you can actually use it on a multilingual website. I'm working on one now that has three languages (and hundreds of pages) and uses mostly categories and containers for structure and content. It works the same way as I outlined above, except there are lots more options for the categories. I personally don't like the category module that much - its pretty big and a bit complicated - but it does work (be sure to enable multiple languages for categories and containers).
______________________________________________________________________________________________________
Recent Drupal websites: http://mbacasecomp.com and http://hudsonhistoricalsociety.ca

category multilingual

PePiToO - November 16, 2006 - 08:47

So I need to understand something :

A category can be create for each language but we cannot translate this category.
A category can have terms. Each term can be create for each language and also be translate.

So explain me what to do :

1/
-create a category in one language ( English for example ).
-create a term in English that i translate in the language i want ( French for example ), so if i create a block of this Englsih term, the block could be translate in French without create another French block.
-If I add an English article to this english term, it will be automatically add in this english block.
-Then i just have to translate this article in French language and it will be automatically add to the french block without create any more links.

So this mean we can have all the content in every language we want, but the title of the category can only be in one language !

2/
-Create a category for each language
-Create for each of this category a term, without translation coz the translation is in the other category. No link possible between the french category and the english category.
-Create a block of those category for each language. This mean i display all the english category in a block and all the french category in another block.
-Create an article in the english category. So now i can see my english article using the english block.
-Translate this article in another language ( french for example ). So this article have to be link to the french category again.

This mean we can have all content in every language, with the good category title name for every language. But for each translation we have to link to the good category again.

So tell me what is the use of translate terms then with this 2nd solution ?

Maybe my brain work too much and i'm wrong on every thing.

terms and categories

incrn8 - November 16, 2006 - 17:00

I have done some more testing using menus that list all pages from a particular terms. The best thing to do is use option 2/. But you must add a language to each term. If you just do this you will have english and french pages, each with an english or french category and term. But, you will have a problem with the page that LISTS the nodes in a term:

in english, the page is: en/taxonomy/term/8
switch to french -> : fr/taxonomy/term/8 (this is wrong as french should be e.g. fr/taxonomy/term/9)

There is only one way I know to fix this. Use URL aliases. So add a new URL alias:
existing url: fr/taxonomy/term/9
alternate url: fr/taxonomy/term/8

You have to do the same thing for when you switch back to english:
existing: en/taxonomy/term/8
alternate: en/taxonomy/term/9

Try that and see what happens.
______________________________________________________________________________________________________
Recent Drupal websites: http://mbacasecomp.com and http://hudsonhistoricalsociety.ca

terms and categories

Bockereyer - November 29, 2006 - 17:43

As I see it, this is a bug.
If I create a category/container in English with a translation and when I change languages I expect to see the correct version in the correct menu with the correct content.
How am I going to explain my customer that he or she has to do lots of complicated things so that the content shows up in the right place. Remember KISS? Well I can't. I hope this problem gets solved in 4.7 or at least in version 5.0.

If I was a decent PHP-programmer I would change it myself, but since I'm not, I'll have to wait for one good soul to make the necessary changes.

I agree

incrn8 - December 1, 2006 - 03:41

I agree with you that there should be a better solution - KISS is definitely the way to go. But until someone comes up with it, then my above message is a solution for now (albeit a somewhat messy one). I see that Jose is very busy going through the issues for i18n module, so maybe something will happen soon for this one.

______________________________________________________________________________________________________
Recent Drupal websites: http://mbacasecomp.com and http://hudsonhistoricalsociety.ca

MULTILINGUAL menu / content problem

Bockereyer - December 11, 2006 - 13:01

As long as there is live, there is hope.

Does anyone knows if this problem gets solved in 5.0? For now I'm fine (I think) I can let the website in Dutch only so I don't need translations right now. I hope my client will understand the problem.

If I use taxonomy and categories now, will I have the possibility to upgrade to 5.0 without losing data? If I can assure this to my client I'll buy me some time until eventually full multilingual support.

[sigh] Oh, why isn't software English only?

I've solved this problem in

Kerberos - March 23, 2007 - 10:11

I've solved this problem in such way:

I opened a page.tpl.php, found piece of code like:

   <?php if (is_array($primary_links) && count($primary_links) != 0) : ?>
    <ul id="primary">
     <?php foreach ($primary_links as $link): ?>
      <li> <?php print t($link) ?> </li>
     <?php endforeach; ?>
    </ul>
   <?php endif; ?>

In others themes code may diffirence, but the idea is to change

<?php
print $link
?>
to
<?php
print t($link)
?>
to make menu strings non static, but depending on selected language.

Then I just created menu in English, and then added localization for menu strings.

drupal 5

mgrant - April 26, 2007 - 23:32

In Drupal 5.x, you don't need to do this. You turn on i18n-menu module and then you simply create multiple menu items, one for each language. It's a little confusing at first because on the admin->menus page you will see your menu items appear in all the languages, but as soon as you navigate away from the admin->menus page, only the menu items for the selected language are displayed.

Thanks for your comment

osdrupal - July 5, 2008 - 08:55

Hello,

Thanks for your comment. It was of great help.

Keep doing the good work.

With best regards.

Usability dead forum post

heather - September 1, 2008 - 20:21

Usability dead forum post pruning

1) This forum is no longer actively used. Please do not post in this forum or reply to this post, it will help us to keep the usability issues clear. Thank you for your help!
2) This is a feature or support request or other not related to Drupal usability.

Please see the appropriate issue queue http://drupal.org/project/issues or group on http://groups.drupal.org

If this had been a suggestion for usability improvements, I would have added the issue to the queue and posted the link here.

------------------------------------------------------------------
"Knowledgeable in Some Matters" http://nearlythere.com/

 
 

Drupal is a registered trademark of Dries Buytaert.