[MGNLSTK-552] I18n does not work for the Navigation Created: 24/Dec/09  Updated: 23/Jan/13  Resolved: 27/Jan/10

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: base system, templates
Affects Version/s: 1.2, 1.2.1
Fix Version/s: 1.2.2

Type: Bug Priority: Major
Reporter: Bozidar Ilievski Assignee: Federico Grilli
Resolution: Fixed Votes: 1
Labels: i18n, navigation
Remaining Estimate: 1h
Time Spent: Not Specified
Original Estimate: 1h

Attachments: Text File navigation-patch.txt    
Issue Links:
dependency
depends upon MAGNOLIA-3010 content wrapper: should wrap returned... Closed
relation
is related to MAGNOLIA-2931 templating: the renderer should not o... Closed
supersession
supersedes MGNLSTK-500 The horizontal menu cannot be localiz... Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

Hi.

I18n does not work for the Navigation when the content for all the languages is in one site tree.

For I18n Content support I have the following setting:
Configuration->/server/i18n/content/class is set to info.magnolia.cms.i18n.DefaultI18nContentSupport.

In the page properties dialog, I have two nodes for the navigation titile: "navigationTitle" and "navigationTitle_de".
When I switch the language between English and German, all the content on the page changes, except for the navigation.

I found that the problem is in info.magnolia.module.templatingkit.navigation.SubNavigation.
The getItems() method, when creating a new NavigationItem should wrap the child Content element with I18nContentWrapper.
Here is the problematic line with the fix applied:

SubNavigation.java
NavigationItem mp = new NavigationItem(new I18nContentWrapper(child), this, depth-1, allOpen);

There is also Patch included.

Thanks,
Bobi.



 Comments   
Comment by Philipp Bärfuss [ 04/Jan/10 ]

This should have been solved by MAGNOLIA-2931. Do you run on Magnolia 4.2?

Comment by Bozidar Ilievski [ 12/Jan/10 ]

Yes, we run on Magnolia 4.2.1.

Comment by Bozidar Ilievski [ 12/Jan/10 ]

I did some research again, and found out that i18n in the Horizontal Navigation works only for the current page.
It does not work for the other links in the menu.

Are you sure that http://jira.magnolia-cms.com/browse/MAGNOLIA-2931 is enough to solve my problem?
I also saw that the patch that you propose in http://jira.magnolia-cms.com/browse/MGNLSTK-500 is not yet applied. Is there no need for that one?

Thanks,
Bobi.

Comment by Philipp Bärfuss [ 15/Jan/10 ]

The fix for MAGNOLIA-2931 has actual only partially fixed the problem due to the fact the the wrapper does not wrap returned children (MAGNOLIA-3010).

The original patch provided for MGNLSTK-500 should not be used as it makes the navigation aware of the i18n content support. Actually the same thing is true for the proposed fix in this issue. MAGNOLIA-3010 will fix it.

Comment by Federico Grilli [ 27/Jan/10 ]

applied and verified patch against core 4.2

Comment by Magnolia International [ 27/Jan/10 ]

So this is now fixed in standard-templating-kit-1.2.2 (against Magnolia 4.2.3). This bug is not impacting standard-templating-kit-1.3+ (with Magnolia 4.3+), thanks to MAGNOLIA-3010.

Generated at Mon Feb 12 07:28:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.