TYPO3-Initiatives / crowdin

TYPO3 crowdin translation initiative
0 stars 0 forks source link

XLF: Copy id attribute to attribute resname #19

Closed georgringer closed 5 years ago

georgringer commented 5 years ago

Given

<trans-unit id="tt_content.asset_references">
    <source>Media elements</source>
</trans-unit>

Crowdin doesn't show the information stored in the attribute "id". If we want to have that visible, the attribute must be duplicated using "resname". So it should like that

<trans-unit id="tt_content.asset_references" resname="tt_content.asset_references">
    <source>Media elements</source>
</trans-unit>
liayn commented 5 years ago

search: (?<!resname=.*)(?!.*resname=)id="([^"]+)" replace: id="$1" resname="$1" in all XLF files

georgringer commented 5 years ago

@liayn have found a flaw in your regex, IMO must be (?<!resname=.*)(?!.*resname=) id="([^"]+)" (mind the space) as there is also something like <file t3:id

liayn commented 5 years ago

good point. wasn't aware of this. Thanks.

liayn commented 5 years ago

https://forge.typo3.org/issues/89335

georgringer commented 5 years ago

Solves