Skip to content

Instantly share code, notes, and snippets.

@Digi92
Last active January 18, 2019 10:02
Show Gist options
  • Save Digi92/536fbd4234293b8fb6eb82c2ec1bd107 to your computer and use it in GitHub Desktop.
Save Digi92/536fbd4234293b8fb6eb82c2ec1bd107 to your computer and use it in GitHub Desktop.
TYPO3 won't use translation files with segmentation informations and they look like: <trans-unit id="example"> <source>Beispiel</source> <seg-source> <mrk mtype="seg" mid="108">Beispiel</mrk> </seg-source>
TYPO3 won't use translation files they look like:
<trans-unit id="example">
<source>Beispiel</source>
<seg-source>
<mrk mtype="seg" mid="108">Beispiel</mrk>
</seg-source>
<target state="final">
<mrk mtype="seg" mid="108">Example</mrk>
</target>
</trans-unit>
So you can replace this with a regex and the "Search and Replace"-function von PhpStorm.
Remove "<mrk mtype="seg" mid="108">":
^(.*)(\<mrk mtype=\"seg\" mid=\"[^"]*\"\>)(.*?)
Remove "<seg-source>Beispiel</seg-source>":
^(.*)(<seg-source>[^*]*?<\/seg-source>)(.*?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment