简体   繁体   English

在多站点/多语言设置中实现不同的默认语言

[英]Implementing different default languages in a multi-site/multi-language setup

Assume the following requirements: 假设以下要求:

  1. A TYPO3 install should host two sites (page trees) in different languages (English and German). TYPO3安装应包含两个使用不同语言(英语和德语)的站点(页面树)。

  2. Both sites share translated records (that is with sys_language_uid equal to 0 and 1 respectively) from a data folder. 这两个站点共享数据文件夹中的翻译记录(即sys_language_uid分别等于0和1)。

Requirement 1 could be solved by modifying the displayed language through mod.SHARED.defaultLanguageFlag/Label in PageTS for each site root and using appropriate frontent TypoScript. 可以通过为每个站点根目录通过mod.SHARED.defaultLanguageFlag/Label修改显示的语言并使用适当的前端TypoScript来解决要求1。 Both sites would languageField / sys_language_uid equal to 0 for all content. 对于所有内容,两个站点的languageField / sys_language_uid都将等于0。

Requirement 2 introduces a problem with this simple setup: All records on both sites refer to the default (english) language for the content in the data folder. 要求2引入了这种简单设置的问题:两个站点上的所有记录都引用数据文件夹中内容的默认(英语)语言。 This is problematic in the backend and frontend. 这在后端和前端都有问题。

How does one get around that? 如何解决这个问题? Is it possible to have the german tree (pages and new content) handled by TYPO3 in BE with a default language id of 1? TYPO3是否可以在BE中使用默认语言ID为1的TYPO3处理德语树(页面和新内容)?

An ugly solution that would probably work is to create english pages in the german tree, create german translations and add content only to these translations. 一个可能可行的丑陋解决方案是在德语树中创建英文页面,创建德语翻译并将内容仅添加到这些翻译中。 Also, one would probably have to set TCAdefaults.[table].sys_language_uid = 1 for all tables in that page tree to avoid having to create english records first. 同样,可能必须为该页面树中的所有表设置TCAdefaults.[table].sys_language_uid = 1 ,以避免必须首先创建英语记录。 Is that the only viable way? 那是唯一可行的方法吗?

The problem you mention is truly existing but only in the backend when editors have to work with the records. 您提到的问题确实存在,但仅在后端编辑需要处理记录时才存在。

For the frontend you're free to set any language as default language. 对于前端,您可以随意将任何语言设置为默认语言。 In the root of each page just make a different language-setup and assign the language you need as default, together with the corresponding sys_language_uid. 在每个页面的根目录中,仅需进行另一种语言设置,然后将所需的语言默认设置为相应的sys_language_uid。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM