[MAGNOLIA-3314] i18n and multisite, different fallback and default Created: 06/Oct/10  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Closed
Project: Magnolia
Component/s: i18n
Affects Version/s: 4.3.2, 4.3.6
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Andrea Castelli Assignee: Unassigned
Resolution: Won't Do Votes: 2
Labels: fallbackDefault, i18n, multisite
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Vista, Windows 7


Attachments: JPEG File i18n-mysite.jpg     JPEG File screenshot-i18n-generic.jpg    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

From the mailing list:

I noticed a strange behaviour with Magnolia 4.3.2 and 4.3.6.

I configured for a site of the STK
defaultLocale=it
fallbackLocale=en
because I need the main language = Italian and when a content (for example) in french is missing I need to display the english content.

BUT at this point when I switch to english an error 404 is returned. So:
www.host.com/magnoliaAuthor/it/demo-features.html -->WORKS
www.host.com/magnoliaAuthor/en/demo-features.html -->NOT WORK

I verified this beahviour also in the demosite, with different combination of locales.
-------------------------
Jan said:
Is english in the list of available locales?

Also did you enter any english content? Default site content (i.e. the one w/o locale suffix when viewed in JCR browser) was mapped to english, so changing default locale to italian, all the default content would show as italian instead of english and there would be no english content anywhere).

Can you provide also listing of available locales (the locales subnode) and export (or screnshot) of content in question as seen in JCR browser?
---------------------
Me:
1. English content was entered.
2. The feature is for french or german users that when comes on mysite.ch should see /it/mysite.ch and if they already switched to /fr/mysite.ch the missing french content should be showed in english (sorry... this is what has been asked to me).
3. I attached the screenshot, If you want the export too I can attach it, but I noticed this problem on a standard installation of magnolia 4.3.6 using as locales "de" and "en" instead of "it" and "en".

----------------------------
Jan:
I see what you mean. I can get the URLs to render but I think there is still a bug since authoring support doesn't store the localized content in appropriate nodes. You might try to restart server after changing the configuration ... it should be re-initialized correctly after the restart. Either way, could you please create an issue in jira?
-----------------------------
Me:
After restart still doesn't work.



 Comments   
Comment by Sven Damm [ 27/Jun/13 ]

I stumbled across the following lines in AbstractI18nContentSupport.determineLocale()

        if(locale.equals(getFallbackLocale())){
            locale = getDefaultLocale();
        }

and this did not make sense to me. So I searched and came here. Now it makes sense: it does not work since a long time.

I removed the lines

Comment by Sven Damm [ 27/Jun/13 ]

I noticed two more problems with this function:
a) When calling http://www.site.com/ or http://www.site.com/foo it returned the correct defaultLocale, but for http://www.site.com/foo/bar it returned the fallbackLocale
b) For http://www.site.com/IT/bar it returned Italian

Comment by Sven Damm [ 27/Jun/13 ]

My solution:

    @Override
    protected Locale onDetermineLocale() {
        final String i18nURI = MgnlContext.getAggregationState().getCurrentURI();
        String localeStr = StringUtils.substringBetween(i18nURI, "/", "/");
        if (localeStr == null) 
            return null;
        if (localeStr.length() == 2 && Character.isLowerCase(localeStr.charAt(0)) && Character.isLowerCase(localeStr.charAt(1))) 
            return new Locale(localeStr);
        return null;
    }
Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Mon Feb 12 03:45:17 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.