我正在使用TYPO3 CMS 6.2.6和一个新的出色的Extbase扩展,名为“ jobfair”。我像这样添加新的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/
}
}
}
...
因此,我可以为我的特定设计编辑模板和部分。所有其他模板将从/ 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>
我将在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>
但这不起作用!?
如何为分机翻译或重命名后端(flexform)标签?de.locallang.xlf不是正确的文件吗?
谢谢你的帮助。ps我清除了TYPO3中的所有缓存。
这是我的文件系统
我对FLUIDTEMPLATE使用相同的方式
模板和语言处理是TYPO3中的独立组件。因此,您用来覆盖原始文件的模板文件无法“知道”您已将语言文件复制到其他位置。您有几种选择。
仅作记录,可以使用TypoScript轻松地为前端覆盖标签:
plugin.tx_yourext._LOCAL_LANG.[languageKey] {
labelKey = New label text
}
(默认语言具有“默认” als 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
}
}
请注意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';
有关此主题的更多信息,请参见此处。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句