joubertredrat / Matomo-ProtectTrackID

A Matomo plugin that protect track ID
https://plugins.matomo.org/ProtectTrackID
MIT License
20 stars 6 forks source link

Translations using Weblate #22

Closed Findus23 closed 1 year ago

Findus23 commented 3 years ago

Hello,

Lukas from Matomo team here. We are currently in the process of moving our translations from Transifex to Weblate (https://github.com/matomo-org/matomo/issues/17907). As Weblate makes it easier to add a git repository as a component and merge back updated translations via pull requests, I thought it would be great if more plugins in Matomo were available in the users languages if someone is interested in translating them.

If you are interested in adding your plugin, simply comment here, and I'll help you with the setup.

joubertredrat commented 1 year ago

Hi @Findus23, sorry for a big delay in my response. Yes, I'm interested to add my plugin to weblate

Findus23 commented 1 year ago

Thanks for the ping!

I have created the component here: https://hosted.weblate.org/projects/matomo/communityplugin-protecttrackid/

Soon there should be a PR in this repository. Don't merge this PR yet, in the next 24 hours it will be updated to add all other languages and afterwards you should always receive a PR with any changes that you can e.g. merge before releases.

The only thing you need to do is this: For Weblate to be notified anytime the source strings change, you need to set up a Webhook. For this go into the settings of this repository and create a new webhook with https://hosted.weblate.org/hooks/github/ as the Payload URL. You can leave all other settings at the default.

joubertredrat commented 1 year ago

Hi @Findus23, thanks for your response.

I created a webhook here. In a refactor I'm changing some and adding new strings, in this case what I need to do?

Findus23 commented 1 year ago

If you change strings in the repository they should immediatly be updated in Weblate thanks to the webhook. Just try to not edit the non-english strings in github as that way you might get merge conflicts.

joubertredrat commented 1 year ago

@Findus23 ah, then I need to edit only en.json, right?

Other question, this kind of string with %d is accepted? Invalid value on Length, expected between %d and %d, was filled %d.?

And PR is open, feel free to talk to me when I can merge. https://github.com/joubertredrat/Matomo-ProtectTrackID/pull/29

Findus23 commented 1 year ago

Correct, only en.json needs to be changed, the others are updated by weblate.

Yes, placeholders work, but I would always recommend to use numbered ones like This translated text %1$s uses %2$s parameters. as otherwise it breaks with languages where the word order changes.

(see https://developer.matomo.org/guides/translations)

29 is ready to be merged

joubertredrat commented 1 year ago

Hi @Findus23, thanks for your support, the translations it working fine, and I'm now receiving new translations as you can see in https://github.com/joubertredrat/Matomo-ProtectTrackID/pull/31.