Forums / Install & configuration / ShowUntranslatedObjects overrules fetch(only_translated)

ShowUntranslatedObjects overrules fetch(only_translated)

Author Message

Marc Boon

Saturday 13 May 2006 8:37:39 am

After upgrading to 3.8 I have this problem:
The setting

 
[RegionalSettings]
ShowUntranslatedObjects=enabled/disabled

in site.ini.append.php seems to override the value of only_translated in a fetch(content, list/tree) function. Setting only_translated to true() or false() has no effect at all.
Is this intended behaviour or a bug?

Marc Boon

Sunday 14 May 2006 6:18:56 am

After reading this article about the new language model of 3.8
http://ez.no/download/ez_publish/changelogs/ez_publish_3_8/multi_language_features_for_the_content_model
I understand why my fetch funtions behave differently. It says:

"The existing parameters only_translated and language to the fetch functions content/list, content/tree, content/list_count and content/tree_count are deprecated since they are not valid anymore."

Still, this presents with me with several problems. For my multilingual site, I have the following requirements:

1. Articles are written/translated in one or more languages. On various index pages on my site, I only want to list those articles which are available in the language of the site access.

2. For each article, I want to provide links to the available other languages of that same article, if any. Following this link would show the same node in a different language ie. site access.

3. Articles can have related content, such as maps and images, which are created in one language and not translated, but still need to be shown next to the article in another language.

If I set ShowUntranslatedObjects=disabled, 1 is fulfilled, but not 2 and 3:
The contentobject attribute 'available_languages' does not contain the other languages of my object, even though they do exist. Related objects in another language are not shown.

If I set ShowUntranslatedObjects=enabled, 2 and 3 are fulfilled, but not 1:
Object are fetched in any language. The parameter only_translated=true() has no effect. I could use the 'language' parameter to limit the fetch to only one language, but then I have to find out the locale of the site access somehow.
The documentation article is a bit unclear about this. In the quote above it says that also the 'language' parameter is deprecated and no longer valid, but in the paragraph before that is says:
"The fetch function has a parameter called language which is an array of languages to act as the priority list (instead of the one defined in site-access)."

Marc Boon

Sunday 14 May 2006 11:47:30 am

After experimenting a bit with ShowUntranslatedObjects and SiteLanguageList settings, I observe the following:
If ShowUntranslatedObjects=disabled, $node.object.available_languages contains only those languages which are in SiteLanguageList *and* are actually available as translated objects.