以特定语言显示来自 EXT:news 的记录 [英] Displaying records from EXT:news in specific language

查看:25
本文介绍了以特定语言显示来自 EXT:news 的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以与默认语言不同的语言显示新闻记录,其中不存在默认语言的记录.

I'm trying to display a news record in a different language to the default language where no record in the default language exists.

多语言配置

 config {
    sys_language_mode = strict
    sys_language_overlay = 0
 }

页面上的插件设置为所有语言".

The Plugin on the page is set to 'All languages'.

仅以默认语言存在的新闻按预期被抑制,但仅以另一种语言提供的新闻不会附加到列表中.

News only existing in the default language are suppressed as expected, but news only available in another language are not appended to the list.

(EXT:news 版本是 2.2.1,TYPO3 版本是 4.7.14)

(EXT:news version is 2.2.1, TYPO3 Version is 4.7.14)

推荐答案

这是 Extbase 持久层的一个 bug.我知道的唯一解决方法是用默认语言创建新闻记录,用默认语言隐藏它并翻译新闻.然后新闻记录只显示在翻译版本中.

This is a bug in the persistence layer of Extbase. The only workaround known to me is to create a news record in the default language, hide it in the default language and make a translation of the news. Then the news record is displayed only in the translated version.

更新 TYPO3 6.2:

从 TYPO3 6.2.4 开始(参见 https://git.Typo3.org/Packages/TYPO3.CMS.git/commit/c78a2e051a5c163a54150013ceb96fe2542a8c11),Extbase 查询解析器可以正常处理没有默认语言版本的本地化版本的记录.不再需要解决方法.

As of TYPO3 6.2.4 (see https://git.typo3.org/Packages/TYPO3.CMS.git/commit/c78a2e051a5c163a54150013ceb96fe2542a8c11), the Extbase query parser work properly with localized versions of records without a default language version. The workaround is not needed anymore.

这篇关于以特定语言显示来自 EXT:news 的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆