docker-ci icon indicating copy to clipboard operation
docker-ci copied to clipboard

feat(translationtool): Allow vue-translator comments

Open jotoeri opened this issue 4 years ago • 8 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 TRANSLATORS is 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 <!--|//|/* TRANSLATORS and 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: grafik

Fake -File After: grafik

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

jotoeri avatar Feb 28 '21 18:02 jotoeri

@jotoeri Wow, thank you! Hope that reviews will be approved and it will hit ci soon ;-)

rakekniven avatar Mar 02 '21 16:03 rakekniven

Any comments @juliushaertl @MorrisJobke @ChristophWurst ? 🤔

jotoeri avatar Mar 19 '21 12:03 jotoeri

Any progress here? The translators will happily starting a party. At least me 😃

rakekniven avatar Apr 12 '21 14:04 rakekniven

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. 😉

jotoeri avatar Apr 13 '21 11:04 jotoeri

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?

rakekniven avatar Oct 23 '22 14:10 rakekniven

I would honestly be a little more comfortable with a bit of easy testing on this script :see_no_evil:

skjnldsv avatar Oct 23 '22 16:10 skjnldsv

@skjnldsv For sure anyone is invited and appreciated by all translators :-)

rakekniven avatar Oct 23 '22 16:10 rakekniven

Any update on this one?

rakekniven avatar Nov 18 '22 22:11 rakekniven