This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Always Available, not always working
expandshrink

Always Available, not always working

Always Available, not always working

Tuesday 13 November 2012 11:04:53 am - 4 replies

I'm testing out the ability to set the main language fallback with the admin interface from the Translations tab of a bit of content.  But it's not working.

I've got 3 siteaccesses set up, each with a different Locale:

eng-NZ (default)
eng-GB
eng-US 

Previously, in the GB siteaccess, I might have set up site.ini > Regional Settings > SiteLanguageList to include all three.  Now I've removed SiteLanguageList completely, set ShowUntranslatedObjects=enabled, set AlwaysAvailable to checked (1) on the all content.

Now, the GB siteaccess is pulling in the US content, despite NZ content being set to "Main" in the Translations tab.  Crazy!

Purging the cache doesn't help.  I'm using a patched & modified CP 2012.3.

Anyone able to confirm whether AlwaysAvailable + Main actually works when ShowUntranslatedObjects=enabled and SiteLanguageList is empty?

Cheers,
Geoff 

Tuesday 13 November 2012 6:11:22 pm

Hi Geoff,

I can confirm this behaviour, and it strikes me as odd, as I've never noticed it before. On the other side, I've never used an empty SiteLanguageList config, so there's that.

It looks like a bug with how eZContentLanguage::sqlFilter method works in combination with eZContentLanguage::prioritizedLanguages method.

eZContentLanguage::prioritizedLanguages method returns the list of all locales if ShowUntranslatedObjects is enabled and SiteLanguageList is empty, sorted by language name, so naturally "English (American)" comes before "English (New Zealand)".

eZContentLanguage::sqlFilter method gets the list of prioritized languages from the above method, and apparently cannot recognize four different cases (your case in bold):

  1. SiteLanguageList NOT empty / ShowUntranslatedObjects DISABLED - everything works fine - prioritized languages are equal to your SiteLanguageList
  2. SiteLanguageList empty / ShowUntranslatedObjects ENABLED - DOESN'T WORK because the only list you get is list off all locales sorted by language name
  3. SiteLanguageList NOT empty / ShowUntranslatedObjects ENABLED - everything works fine because locales from SiteLanguageList are located before all other available locales
  4. SiteLanguageList empty / ShowUntranslatedObjects DISABLED - everything works fine, but [RegionalSettings]/ContentObjectLocale is the only locale in prioritized list

Tuesday 13 November 2012 6:49:56 pm

Edi, you're a star!  Thanks for testing this so thoroughly, confirming the issue, and pointing me in the right direction. I'd be interested to know how you tracked down the offending class?  I normally use Eclipse debugger, but finding the right point in the process can be difficult if you don't know what you're looking for.

My use-case is that most siteaccesses use eng-NZ as the last item in SiteAccessList, but I have a need in one area for having them fallback to a different language, and have the only the NZ siteaccess display eng-NZ content.  The work-around is to create translations in every other language/region, but this is messy, and I'd prefer to set the main language in the admin.

I'll let you know when I find a solution.

Cheers!

Tuesday 13 November 2012 8:46:58 pm

I've added this bug to the issue tracker - https://jira.ez.no/browse/EZP-20067 

Wednesday 14 November 2012 11:27:52 am

Quote from Geoff Bentley :

Edi, you're a star!  Thanks for testing this so thoroughly, confirming the issue, and pointing me in the right direction. I'd be interested to know how you tracked down the offending class?  I normally use Eclipse debugger, but finding the right point in the process can be difficult if you don't know what you're looking for.

I've become intimately introduced to eZContentLanguage class when working on eZ Tags 2.0 which has translatable tags happy.gif Emoticon I've gone over [RegionalSettings] config and the class numerous times happy.gif Emoticon

Quote from Geoff Bentley :

My use-case is that most siteaccesses use eng-NZ as the last item in SiteAccessList, but I have a need in one area for having them fallback to a different language, and have the only the NZ siteaccess display eng-NZ content.  The work-around is to create translations in every other language/region, but this is messy, and I'd prefer to set the main language in the admin.

I'll let you know when I find a solution.

I suppose it can be solved with a bit of hacking happy.gif Emoticon Good luck Geoff! happy.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from