Kaasstengel
Kaasstengel

Reputation: 457

How to override language files in Typo3 version 7.6?

I really need to know how to override languagefiles from extensions. For example, I have powermail installed and I have one language file from that extension that I need to override.

So I've got an extension called website_head and in that I created the file:

typo3conf\ext\website_head\Resources\Private\Language\Overrides\powermail\Resources\Private\Language\locallang.xlf

And the file I want to override is:

typo3conf\ext\powermail\Resources\Private\Language\locallang.xlf

When I clear the caches it does not change (but when I change the original it does change the text, it's just not overriding)

Also this is what's inside the override locallang.xlf file:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
    <file source-language="en" datatype="plaintext" original="messages" date="2014-05-02T12:00:00Z" product-name="powermail">
        <header/>
        <body>
            <trans-unit id="validationerror_mandatory">
                <source>Custom text</source>
            </trans-unit>
        </body>
    </file>
</xliff>

Upvotes: 1

Views: 3081

Answers (1)

QB new media
QB new media

Reputation: 322

Have a look at https://docs.typo3.org/typo3cms/CoreApiReference/7.6/Internationalization/Translation/Index.html:

You probably need to:

1) declare your XLF:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:powermail/Resources/Private/Language/locallang.xlf'][] = 'EXT:website_head/Resources/Private/Language/Overrides/powermail/Resources/Private/Language/custom.xlf';

2) override a label:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
     <file source-language="en" datatype="plaintext" original="messages" date="2013-03-09T18:44:59Z" product-name="website_head">
             <header/>
             <body>
                     <trans-unit id="validationerror_mandatory" xml:space="preserve">
                             <source>Custom text</source>
                     </trans-unit>
             </body>
     </file>
</xliff>

Upvotes: 6

Related Questions