feat(translationtool): Allow vue-translator comments
Hi all,
i just gave it a go to extract translator-comments from vue-files. I fell over that in https://github.com/nextcloud/documentation/issues/5422 I'm neither the great php pro, and not at all for Regex. The attempt is probably not the ideal one and it needs a bit more looping than before. But it seems to work. 🙈 So comments and review-suggestions are welcome! 😊
Three things from my side:
- ~~The regex check for
TRANSLATORSis executed twice - Once for HTML and once for JS. This is due to the fact, that i didn't find a Regex to match either the HTML-EndTag-->or just nothing for JS-Comments. Does one of you have an idea here?~~ EDIT: Just had an idea and pushed a fixup: Now checking for<!--|//|/*TRANSLATORSand then separately removing possible end-tags-->|*/ - One issue i realised, but it is more or less independent and already existed before: Double-Quote matches most probably use double-quotes as they want to use a single quote within their strings. However, they are parsed to be single-quotes here, which does not work anymore. (I saw an issue on some app, but i don't find it anymore 😞) Any idea for this? Or probably do it as separate topic? 🤔
- Can we test this somehow properly before merging / going live? I was only able to test my new code out of scope, but therefore changing some small code parts to make it run.
Greets! :) Jonas
cc @rakekniven 😉
Fake-File Before:

Fake -File After:

while the first comment is out of HTML and the second one out of JS:

@jotoeri Wow, thank you! Hope that reviews will be approved and it will hit ci soon ;-)
Any comments @juliushaertl @MorrisJobke @ChristophWurst ? 🤔
Any progress here? The translators will happily starting a party. At least me 😃
Ahh, I'm sorry, @rakekniven. I still have it on backlog & in my notifications, just recently had some other PRs to complete and due to exams at university not too much of a time for some hacking. So it's not lost, i still want to complete that, i just need to take the time for. 😉
The last weeks I have seen many questions about context of strings based on vue files.
I am kindly asking @nickvergessen to have a look at this one.
Maybe @juliushaertl can spend some time on it as well?
I would honestly be a little more comfortable with a bit of easy testing on this script :see_no_evil:
@skjnldsv For sure anyone is invited and appreciated by all translators :-)
Any update on this one?