[SOLVED] Override translations of other packages


(Harald Atteneder) #1

I am not able to override or extend the properties of NodeTypes/Image of the Neos.NodeTypes package.

Here is the content of My.Package/Resources/Private/Translations/en/NodeTypes/Image.xlf:

<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
	<file original="NodeTypes/Image" product-name="Neos.NodeTypes" datatype="plaintext" source-language="en">
		<body>
			<trans-unit id="properties.image" xml:space="preserve">
				<source>Alternative Translation (Image)</source>
			</trans-unit>
		</body>
	</file>
</xliff>

What am I doing wrong?


(Patric Eckhart) #2

Hi Harald!

Add 'Neos.NodeTypes:Image‘ in your Sites NodeTypes.yaml and define the translation variable like

Your.Site:Main:myownimagetrans


(Harald Atteneder) #3

Thanks for the reply!
I already added the Image to my NodeTypes.yaml, because I added some custom properties.

'Neos.NodeTypes:Image':
  properties:
    ....

Where should I put the translation? (Main.xlf and not NodeTypes/Image.xlf?)
And what exactly is the id for lets say properties.image for the Neos.NodeTypes/Image NodeType?


(Patric Eckhart) #4

Please paste your full .yaml


(Bernhard Schmitt) #5

Hey there,

Did you declare neos/nodetypes as a composer dependency of your package? Also, which Neos / Flow versions are you using?


(Harald Atteneder) #6

@Nezaniel Yes, neos/nodetypes is a dependency in my site package’s composer.json.

"neos/nodetypes": "*",

neos/flow version is 4.2.3


(Jon Uhlmann) #7

You can override labels in the Backend like that:

Foo.Bar:Element
  properties:
    image:
      ui:
        label: 'Foo.Bar:NodeTypes.Element:properties.image'

Like that, the entry properties.image from the file Resources/Private/Translations/LANGUAGE_CODE/NodeTypes/Element.xlf from the package Foo.Bar gets included

<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
    <file original="" product-name="Foo.Bar" source-language="en" datatype="plaintext">
        <body>
            <trans-unit id="properties.image" xml:space="preserve">
                <source>Your own label</source>
            </trans-unit>
        </body>
    </file>
</xliff>

(Harald Atteneder) #8

Nice. This solved my problem :wink: Thank you!


(Jon Uhlmann) #9

Great! I’m glad I could help you.