typo3 templavoila 检查当前语言

typo3 templavoila check current language

嗨,我的错字有 4 种语言。这是我对它们的主要配置:

#LANGS
config.linkVars=L
config.defaultGetVars.L = 0
config.sys_language_overlay = hideNonTranslated
[globalVar = GP:L = 3]
config.sys_language_uid = 3
config.language = en
config.locale_all = en_EN
config.htmlTag_langKey = en
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 3
[globalVar = GP:L = 2]
config.sys_language_uid = 2
config.language = ro
config.locale_all = ro_RO
config.htmlTag_langKey = ro
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 2
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = de
config.locale_all = de_DE
config.htmlTag_langKey = de
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 1
[global]

一切正常。 我正在使用 templavoila 和 realurl。

在其中一个 templates/modules/flexible 内容中,只有当它不为空时我才会显示打字错误的字段:

10 = TEXT
10.field = field_test
10.wrap = info: |
10.if.isTrue.field = field_test

现在我想在不同版本中显示此字段:

喜欢:

10.wrap = informationen | 

DE 语言等

我如何在这里查看当前语言是什么?

在 TypoScript 中使用翻译标签

您可以在 TypoScript 中使用翻译标签。例如:

{LLL:typo3conf/customlabels.xlf:label.id}
{LLL:EXT:mytemplateext/Resources/Private/Language/locallang.xlf:label.id}

您可能想看看:

http://docs.typo3.org/typo3cms/FrontendLocalizationGuide/BasicSetupOfALocalizedWebsite/Llxml%28locallang-xml%29InPluginsAndTyposcript/Index.html

llXML files are XML files containing labels that the system can fetch in a localized version if a language pack is installed. If you want to retrieve values from llXML files in TypoScript you can do it like this:

page.20 = TEXT page.20.stdWrap.data =
LLL:EXT:indexed_search/pi/locallang.xml:submit_button_label

另见:

http://docs.typo3.org/typo3cms/CoreApiReference/Internationalization/Introduction/Index.html http://docs.typo3.org/typo3cms/InsideTypo3Reference/CoreArchitecture/Localization/Locallang-xml%28llxml%29Files/Index.html

TypoScript 变量

您可以使用自己的设置扩展语言配置。例如:

#LANGS
config.linkVars=L
config.defaultGetVars.L = 0
config.sys_language_overlay = hideNonTranslated
myLanguageLabels {
    info = info
}
[globalVar = GP:L = 3]
config.sys_language_uid = 3
config.language = en
config.locale_all = en_EN
config.htmlTag_langKey = en
myLanguageLabels {
    info = info 2
}
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 3
[globalVar = GP:L = 2]
config.sys_language_uid = 2
config.language = ro
config.locale_all = ro_RO
config.htmlTag_langKey = ro
myLanguageLabels {
    info = info 3
}
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 2
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = de
config.locale_all = de_DE
config.htmlTag_langKey = de
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 1
myLanguageLabels {
    info = info 3
}
[global]

然后指出你要使用的变量:

10.wrap = {$myLanguageLabels.info}: |