Reputation: 1674
I'm using TYPO3 CMS 6.2.6 and a new fantastic Extbase Extension called "jobfair". I've add my new templateRootPaths like this:
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/
}
}
}
...
So I can edit the Templates and Partials for my specific Design. ALl other templates will load from /typo3conf/ext/jobfair/Resources/...
Everything works fine. I also copied the language-folder from the extension (typo3conf) to my fileadmn-folder (fileadmin/.../jobfair/Resources/Private/Language/).
I edit "locallang.xlf" and "de.locallang.xlf", for example:
partial: ContractType.html
<f:if condition="{job.contractType} == 0">
<f:translate key="tx_jobfair_domain_model_job.contract_type.0" />
</f:if>
I'll change the target at 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>
But it isn't working!?
How can I translate or rename backend (flexform)labels for my ext.? Isn't the de.locallang.xlf the right file?
Thanks for your help. p.s. I cleared any cache in TYPO3 .. nothing happened.
Here is my filesystem
I use it the same way for my FLUIDTEMPLATE
Upvotes: 2
Views: 3102
Reputation: 1674
Perfect. Lorenz, thank you very much for your detailed explanation. Now I understand it and 'I'll see the bigger picture' ...
I just need the Backend-Translation in that project, like:
TCEFORM.tx_jobfair_domain_model_job {
## disable flexform/tca fields
salary.disabled = 1
discipline.disabled = 1
education.disabled = 1
# rename or translate
job_title.label = Stelle
employer.label = Arbeitgeber
employer_description.label = Arbeitgeberbeschreibung
}
But I also test it for the frontend view:
plugin.tx_jobfair._LOCAL_LANG.de {
tx_jobfair_domain_model_job.contract_type = Vertragsart
}
Works perfect! Thank you very much!
Upvotes: 1
Reputation: 4558
Template and language handling are independent components in TYPO3. Therefore the template files you overwrite the original with cannot "know" that you copied the language files somewhere else. You have several options.
Just for the record, overriding labels for the frontend can be done comfortably using TypoScript:
plugin.tx_yourext._LOCAL_LANG.[languageKey] {
labelKey = New label text
}
(The default language has "default" als languageKey.)
In the backend, you can override TCA and FlexForm labels using Page TSConfig:
# 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
}
}
Please mind the backslashes in the Powermail example. The according field is called settings.flexform.main.optin
. Since dots are normally "path separators", they must be escaped to make it work.
Besides from this configuration way, there's a completely different approach. You can override whole translation files:
# 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';
More information on this topic can be found here.
Upvotes: 5