Hello!
I am trying to create a custom filetype for PHP files with translatable text in echo commands. Please advise how to best define filter for files like attached here.
What I did so far:
1) In Document structure, I defined opening pattern echo \" and closing pattern \". This works fine for files like example_php_2.php where echo only has one string of translatable text.
How to extract all translatable strings from echo commands that have many, like in example_php_1.php?
Alternatively, I tried using echo as opening and \; as closing, but then I did not figure out how to block PHP variables and only mark text in "" as translatable.
2) In Inline tags, I defined <br> as placeholder and <h2> </h2> as tag pair, this works fine for these examples.
However, there can be much more HTML inside PHP and I'd need to rewrite a lot of HTML filter to cover it properly. Is it possible to build a custom filetype for PHP and somehow include the HTML support that already exists in SDL Trados Studio?
(I tried to modify the HTML5 filter instead of building my own filetype, or build a custom filetype based on HTML rather than regular expressions, but there I did not figure out how to make echo content translatable.)
Thank you and best regards,
Marta Bartnicka