DirkPersky / typo3-dp_cookieconsent

TYPO3 Extension: Enable a cookie consent box. Let you visitors control the usage of cookies and load script or content after a consent. (ePrivacy, TTDSG)
GNU Affero General Public License v3.0
32 stars 27 forks source link

Translating the cookie list view (GER) / changing the template not possible #86

Closed kriemhildt closed 2 years ago

kriemhildt commented 2 years ago

Hello there, I'm currently trying to translate the table that shows the cookie list. First, I set the template path in the constants:

plugin.tx_cookieconsent.view.partialRootPath = EXT:myext/Resources/Private/Partials/dp_cookieconsent/
plugin.tx_cookieconsent.view.templateRootPath = EXT:myext/Resources/Private/Templates/dp_cookieconsent/
plugin.tx_cookieconsent.view.layoutRootPath = EXT:myext/Resources/Private/Layouts/dp_cookieconsent/

It might be that the general problem is already existent at this point. But I can't find it. Nevertheless this is how I went on:

Because there currently is no german translation for the thead table rows I then went into the template and changed the translation key to the path of my extension and the language files within.

 <f:translate key="LLL:EXT:myext/Resources/Private/Language/de.locallang.xlf:cookie.name"/>

I created the corresponding language file in my extension and added the missing items. Like this:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
    <file source-language="en" datatype="plaintext" original="messages" date="2015-09-19T09:11:39Z" product-name="theme_t3kit">
        <header/>
        <body>
            <trans-unit id="cookie.name">
                <source>Cookies</source>
                <target>Cookies</target>
            </trans-unit>
            <trans-unit id="cookie.category">
                <source>Category</source>
                <target>Kategorie</target> // this for example is not shown in the FE
            </trans-unit>
...

As I said, maybe the problem started way before altering the template file, because I can't make any changes to the template.

image

But I know for sure that clearing the cache isn't the problem.

Any help would be much appreciated :)

asche76 commented 2 years ago

would use the ext translate_locallang. with this ext u can easy translate all labels:

image

image

image

kriemhildt commented 2 years ago

@asche76 thanks for the tip! I can see the benefits of this approach. But I was hoping to achieve this without an additional extension.

asche76 commented 2 years ago

problem with this method is, after dp_cookie ext update the new labels are reverted to the default ones. i thought the translation locallang ext would have saved the changes as some kind of overlay or abstraction somewhere -.-

DirkPersky commented 2 years ago

fixed in next release