DirkPersky/typo3-dp_cookieconsent

Can't translate labels in TYPO3 12

Closed this issue · 6 comments

Hi, In TYPO3, I can't translate the labels as documented. Doing the following still displays the default text:

plugin.tx_dp_cookieconsent {
    _LOCAL_LANG {
        de {
            message = Some german text which are displayed properly
        }
    }
}

I do have the same problem overwriting the labels as described by @timdreier . Tested it with several plugin keys
plugin.tx_dp_cookieconsent
plugin.tx_dpcookieconsent
plugin.dp_cookieconsent
etc.

I can not even overwrite the whole language files via locallangXMLOverride.

Any idea?

He,

if i try it this way in TYPO 11 LTS

plugin.tx_dp_cookieconsent._LOCAL_LANG.de {
  allowall = Alle zulassen
  message = TEXT
}

Than it works:
image

But yeah in TYPO12 it didn't work anymore.

And how could it be realized nowadays?

I cannot translate with overriding the XLF as well. Is that because the plugin folder is not located in typo3_conf/ext?

No, u need to change the date in den XLF and than run the languagepack update.
image

You also coud use the XLF overwrite:

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

https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/Localization/ManagingTranslations.html#custom-translations

Thanks, it works now.