用 locallang.xlf 翻译 Extbase Extension,但没有任何反应?

use*_*852 2 caching typo3 translate extbase

我正在使用 TYPO3 CMS 6.2.6 和一个名为“jobfair”的新的出色的 Extbase 扩展。我添加了新的 templateRootPaths,如下所示:

plugin.tx_jobfair {

  view {
        templateRootPaths {
          100 = EXT:jobfair/Resources/Private/Templates/
          101 = fileadmin/templates/ext/jobfair/Resources/Private/Templates/
        }

        partialRootPaths {
          100 = EXT:jobfair/Resources/Private/Partials/
          101 = fileadmin/templates/ext/jobfair/Resources/Private/Partials/
       }

       layoutRootPaths {
          100 = EXT:jobfair/Resources/Private/Layouts/
          101 = fileadmin/templates/ext/jobfair/Resources/Private/Layouts/
       }
  }

}
...
Run Code Online (Sandbox Code Playgroud)

因此我可以为我的特定设计编辑模板和部分。所有其他模板将从 /typo3conf/ext/jobfair/Resources/... 加载

一切正常。我还将语言文件夹从扩展名 (typo3conf) 复制到我的 fileadmn 文件夹 (fileadmin/.../jobfair/Resources/Private/Language/)。

我编辑“locallang.xlf”和“de.locallang.xlf”,例如:

部分:ContractType.html

<f:if condition="{job.contractType} == 0">
 <f:translate key="tx_jobfair_domain_model_job.contract_type.0" />
</f:if>
Run Code Online (Sandbox Code Playgroud)

我将在 de.locallang.xlf 更改目标

<trans-unit id="tx_jobfair_domain_model_job.contract_type">
<source>Contract Type</source>
<target>Here's my german translation!!!</target>
</trans-unit>
Run Code Online (Sandbox Code Playgroud)

但它不起作用!?

如何翻译或重命名我的分机的后端 (flexform) 标签?de.locallang.xlf 不是正确的文件吗?

感谢您的帮助。ps 我清除了 TYPO3 中的所有缓存..什么也没发生。

这是我的文件系统

ext-文件夹复制到fileadmin中

我以同样的方式使用它来处理我的 FLUIDTEMPLATE

流畅和语言拼写错误3

lor*_*enz 5

模板和语言处理是 TYPO3 中的独立组件。因此,您用来覆盖原始文件的模板文件无法“知道”您将语言文件复制到其他地方。您有多种选择。

仅供记录,可以使用 TypoScript 轻松完成前端的重写标签:

plugin.tx_yourext._LOCAL_LANG.[languageKey] {
    labelKey = New label text
}
Run Code Online (Sandbox Code Playgroud)

(默认语言的“default”为 languageKey。)

在后端,您可以使用 Page TSConfig 覆盖 TCA 和 FlexForm 标签:

# TCA
TCEFORM.tt_content.layout.label = New label

# FlexForm field
TCEFORM.tt_content.pi_flexform.[ext_key].[sheet_key].[field_key].label = New label

# Example for Powermail
TCEFORM.tt_content.pi_flexform.powermail_pi1 {
    main {
        settings\.flexform\.main\.optin.label = Require opt-in for mails
    }
}
Run Code Online (Sandbox Code Playgroud)

请注意 Powermail 示例中的反斜杠。相应的字段称为settings.flexform.main.optin. 由于点通常是“路径分隔符”,因此必须对它们进行转义才能使其正常工作。

除了这种配置方式之外,还有一种完全不同的方法。您可以覆盖整个翻译文件:

# Override XLF for default language
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['path/to/originalTranslationFile.xlf'][]
    = 'path/to/otherTranslationFile.xlf';
# Override XLF for French language
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['fr']
    ['path/to/originalTranslationFile.xlf'][] = 'other/path/to/fr.otherTranslationFile.xlf';
Run Code Online (Sandbox Code Playgroud)

有关此主题的更多信息可以在此处找到。