Closed vadcx closed 4 months ago
Please keep the original styling of the en locale and update only messages, because it is very hard for me to confirm details of your changes. Sorry but I can't review and merge this as-is.
@piroor OK, I understand. I will see if GitLocalize keeps the structure intact. This means that WebExtension Translator cannot be used (it's a recommended way), because it modified the structure itself and added all these fields.
Hmm, GitLocalize breaks styling of JSON so it looks not good to modify en and ja locale with GitLocalize... Entries in those original locales are sorted and grouped with their context, for better development experience for me. I think en and ja locales need to be updated by editing their JSON sources with this repository, until we find out something better way to edit locales keeping their original style.
I see. Is the grouping strictly manual or is something like sorting by key acceptable? My idea is to see if filtering & sorting with jq
would be enough (to remove unnecessary values, sort keys etc.) Yet the current update I'll need to transplant onto current (or jq-ed files) manually. Maybe not English and German, but in the Russian file I've probably touched 1/2 to 3/4ths of strings.
Basically I think entries should corresponds to the order and groupings in uses on the UI: options page, menus, and so on. There are some exceptions by historical reasons and I think they should be rearranged to match to current UI. Sorting based on character codes will break such ordering and grouping, so I think en and ja locales need to be managed fully manually for now.
Changes to locales except en and ja are basically merged as-is (if there is no changes around executable codes) because I can't review translated messages. I think it is better that entries in those locales are also ordered same to en and ja, but currently I prefer to the easiness of translation tasks by contributors.
My workflow so far (documenting in case someone less tech affine needs to follow):
Undoing the ENGLISH / JAPANESE language file:
jq "." /path/to/messages.json > messages-jq.json
diff messages-old-jq.json messages-new-jq.json
diff
into actual original JSON from repo.Tip: while you are on your own translation branch, you can retrieve the original messages.json from branch trunk
with this git command: git show trunk:./messages.json > messages-trunk.json
Undoing other translation files where WET (WebExtension Translator) added its custom fields:
hash
__WET_LOCALE__
Refer to step 2 above, you only need to change the command slightly to eliminate these keys in output:
jq "del(.[].hash, .__WET_LOCALE__)" messages-new.json > messages-new-jq-cleared.json
Continue with step 3. You can now transplant new changes onto the old file manually as before... or offer piroor a deal:
EDIT: I hit CTRL+Numpad Enter by mistake and it submitted the comment... Please wait while I finish typing duh! I will post a separate comment
The Deal: piroor, there are 113 changes to the DE translation, 257 to the RU translation. That's too much for me to redo by hand just to keep formatting :/ Technically you could (have someone else) review these changes even with changed formatting with this:
Other than that, I am going to commit the files as following:
PS: If future translators follow the same procedure of WET+jq, they should produce a minimal diff. PPS: I missed the opportunity to produce a minimal diff myself, had I split formatting changes and text updates in two commit here...
This is ready, piroor.
OK, I've wrote a script to merge updates in your translation to the original locale keeping JSON format: https://github.com/piroor/treestyletab/commit/52bc5f294ad154098fe17cbae748fbc4daeaae8a And I've merged changes on this PR manually: https://github.com/piroor/treestyletab/commit/aebfa7dc9dad6b8fa8655c3358ccb729ef058bea
So I close this PR without merging, sorry I couldn't leave your credit as the author of the commit... Anyway thanks a lot!
Thanks, I don't mind. However git itself allows to specify the commit author (you, because of the new script) and commiter (you too) and then co-authors like this
Oh, I didn't know that, I'll try that at next chance!
And I've realized that there are some more not-translated-yet entries at the commit https://github.com/piroor/treestyletab/commit/aebfa7dc9dad6b8fa8655c3358ccb729ef058bea - they were simply copied from en locale, it is due to a bug of my script. Could you translate them also?
de locale: https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L27-L28 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L72-L73 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L138 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L261 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L298-L307 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L323-L326 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L359 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L410-L411 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L423 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L462-L469 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L496-L497 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L501 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L503 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L508-L509 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L515 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L520-L521 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L534-L535 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L640 https://github.com/piroor/treestyletab/blob/530d65e27f95c568227db3dd6c531b00e10d3f91/webextensions/_locales/de/messages.json#L720
I've confirmed that there are no not-translated-yet entries in ru locale.
Yes, sorry. I didn't finish the German translation and don't plan to. I will rethink it tomorrow if I have the motivation to dive deeper :)
OK, I'll remove these untranslated entries from de locale if necessary. Don't mind!
Completely untested. Created with Web Extension Translator
Preface: someone in comments on a website that's presumably catering to open-source and FOSS enthusiasts "can someone report this grammar mistake?" ... Well yes, but did you know that magic doesn't happen on its own accord?
I used the WET as per instructions. I see the diff is absolutely massive, because it changed the JSON structure completely. I am not sure if you are
a. OK with this? Because you point out to use git's diffing to see if the source (EN) translation was updated and downstream locales need updates as well b. If this breaks the structure the i18n library you use expects?
Yes, I didn't test this (how would I load a changed locale file along the extension in Firefox?). I hope this runs but as for translation quality, I actually wish and expect for other people pick this up and improve, in wiki style.