Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locales: Finish RU, update DE; fix EN #3549

Closed
wants to merge 1 commit into from
Closed

Conversation

vadcx
Copy link

@vadcx vadcx commented May 15, 2024

  • Completely update the Russian translation. Including fixes and new strings
  • More strings translated in German. Few updates/fixes
  • Only grammar fixes in English locale

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.

  • I didn't finish German because I've had too much.
  • As far as Russian goes I am fairly certain of my translation skill and while there are some strings that need double-checking with Firefox' own terminology (glossary), it should be a very close match. I've also adapted some IT terminology like "Addon" -> "Extension" to be easier to comprehend for everyone, since addons are no longer called such anyways. I doubt there will be uproar from the previous translator(s). Even if: point them towards a "Create pull request" button ;)

@piroor
Copy link
Owner

piroor commented May 19, 2024

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.

@vadcx
Copy link
Author

vadcx commented May 19, 2024

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

@piroor
Copy link
Owner

piroor commented May 19, 2024

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.

@vadcx
Copy link
Author

vadcx commented May 19, 2024

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.

@piroor
Copy link
Owner

piroor commented May 19, 2024

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.

@piroor
Copy link
Owner

piroor commented May 19, 2024

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.

@vadcx
Copy link
Author

vadcx commented May 26, 2024

My workflow so far (documenting in case someone less tech affine needs to follow):

Undoing the ENGLISH / JAPANESE language file:

  1. Get both files, old and new updated
  2. Run both files through jq to normalize formatting (jq is a streaming JSON processor, so it keeps the ordering intact but formatting will be different): jq "." /path/to/messages.json > messages-jq.json
  3. Now you have old and new normalized files, compare with diff to see the strings you modified: diff messages-old-jq.json messages-new-jq.json
  4. Manually put updates visible through diff into actual original JSON from repo.
  5. Delete the temporary files from above
  6. Submit

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:

  • under each translation key there's now a hash
  • in JSON root there's __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

@vadcx
Copy link
Author

vadcx commented May 26, 2024

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:

  • normalize repo's messages.json with jq
  • normalize translation update .json with jq
  • diff both files, it should only yield the changed values

Other than that, I am going to commit the files as following:

  • English messages: updated manually, entire file kept as-is
  • Russian, German messages: ran through jq once to normalize formatting and remove "hash" entries added by WET. The ordering is kept exactly the same (neither WET nor jq modified it), but the formatting changed to multi-line. There's no way to finely control jq's formatting (either pretty-print or single-line).

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.

- Completely update the Russian translation. Including fixes and new strings
- More strings translated in German. Few updates/fixes
- Only grammar fixes in English locale

Completely untested. Created with Web Extension Translator

Update EN, DE, RU translations and normalize formatting

See discussion in:
piroor#3549

EN translation: manually reentered updates to keep the file diffable
DE, RU translation: cleaned files with jq and normalized their
formatting. Command:

jq "del(.[].hash, .__WET_LOCALE__)" messages-new.json > messages-new-jq-cleared.json
piroor added a commit that referenced this pull request May 30, 2024
@piroor
Copy link
Owner

piroor commented May 30, 2024

OK, I've wrote a script to merge updates in your translation to the original locale keeping JSON format: 52bc5f2
And I've merged changes on this PR manually: aebfa7d

So I close this PR without merging, sorry I couldn't leave your credit as the author of the commit... Anyway thanks a lot!

@piroor piroor closed this May 30, 2024
@vadcx
Copy link
Author

vadcx commented May 30, 2024

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

@piroor
Copy link
Owner

piroor commented May 31, 2024

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 aebfa7d - they were simply copied from en locale, it is due to a bug of my script. Could you translate them also?

de locale:

"command_toggleTreeCollapsed": { "message": "Toggle Tree Collapsed" },
"command_toggleTreeCollapsedRecursively": { "message": "Toggle Tree Collapsed Recursively" },

"tabbar_newTabAction_childTop_command": { "message": "First Child Tab" },
"tabbar_newTabAction_childEnd_command": { "message": "Last Child Tab" },

"blank_allUrlsPermissionRequiredMessage": { "message": "This message is here due to Firefox tried to restore a dialog which is provided by Tree Style Tab addon. Please grant the \"Access your data for all websites\" permission via the \"Permissions\" tab of Tree Style Tab's details page in the Add-on Manager, if this message is not wanted to appear anymore." },

"message_startup_requestPermissions_clipboardRead": { "message": "Allow to open a new tab with the URL in the clipboard, by middle click on the \"New Tab\" button (*you may need to activate \"dom.events.asyncClipboard.clipboardItem\")" },

"context_toggleMuteTree_label_mute": { "message": "&Mute this Tree" },
"context_toggleMuteTree_label_multiselected_mute": { "message": "&Mute Selected Trees" },
"context_toggleMuteTree_label_unmute": { "message": "Un&mute this Tree" },
"context_toggleMuteTree_label_multiselected_unmute": { "message": "Un&mute Selected Trees" },
"context_toggleMuteTree_command": { "message": "Mute/Unmute this Tree" },
"context_toggleMuteDescendants_label_mute": { "message": "Mu&te Descendants" },
"context_toggleMuteDescendants_label_multiselected_mute": { "message": "Mu&te Descendants of Selected tabs" },
"context_toggleMuteDescendants_label_unmute": { "message": "Unmu&te Descendants" },
"context_toggleMuteDescendants_label_multiselected_unmute": { "message": "Unmu&te Descendants of Selected tabs" },
"context_toggleMuteDescendants_command": { "message": "Mute/Unmute Descendants" },

"context_toggleSticky_label_stick": { "message": "Stic&k Tab to Edges" },
"context_toggleSticky_label_multiselected_stick": { "message": "Stic&k Selected Tabs to Edges" },
"context_toggleSticky_label_unstick": { "message": "Unstic&k Tab to Edges" },
"context_toggleSticky_label_multiselected_unstick": { "message": "Unstic&k Selected Tabs to Edges" },

"config_showTreeCommandsInTabsContextMenuGlobally_label": { "message": "Show commands for tree of tabs in tab context menu globally ex. on the native tab bar" },

"config_outOfScreenTabsRenderingPages_label": { "message": "Number of pages to pre-render tabs:" },
"config_outOfScreenTabsRenderingPages_description": { "message": "* \"-1\" will pre-render all tabs for better scrolling performance, and as a trade off you may need to wait long time on initialization." },

"config_suppressGroupTabForStructuredTabsFromBookmarks_label": { "message": "Suppress top-level group tab when opened tabs are already organized as a tree" },

"config_insertNewTabFromFirefoxViewAt_caption": { "message": "Insertion position of new child tabs from Firefox View (will appear as root tabs)" },
"config_insertNewTabFromFirefoxViewAt_noControl": { "message": "No control (respect the decision by the browser or other tab addons)" },
"config_insertNewTabFromFirefoxViewAt_nextToLastRelatedTab": { "message": "Next to the recently opened child, or near the opener" },
"config_insertNewTabFromFirefoxViewAt_top": { "message": "The top of the tree (near the opener)" },
"config_insertNewTabFromFirefoxViewAt_end": { "message": "The end of the tree" },
"config_autoGroupNewTabsFromFirefoxView_label": { "message": "Auto-group tabs opened from Firefox View (a new tab for grouping will be opened with a title like \"Tabs from ...\")" },
"config_groupTabTemporaryStateForChildrenOfFirefoxView_label": { "message": "Default state of group tabs for tabs opened from Firefox View:" },

"config_autoAttachOnNewTabCommand_childTop": { "message": "First Child of the current tab" },
"config_autoAttachOnNewTabCommand_childEnd": { "message": "Last Child of the current tab" },

"config_guessNewOrphanTabAsOpenedByNewTabCommandTitle_before": { "message": "Guess a newly opened tab as opened by \"New Blank Tab\" action, when it is opened with title(s) " },

"config_guessNewOrphanTabAsOpenedByNewTabCommandUrl_after": { "message": "(*You can list multiple values with a separator \"|\")" },

"config_autoAttachOnNewTabButtonMiddleClick_childTop": { "message": "First Child of the current tab" },
"config_autoAttachOnNewTabButtonMiddleClick_childEnd": { "message": "Last Child of the current tab" },

"config_middleClickPasteURLOnNewTabButton_label": { "message": "Open new tab with URL in the clipboard (*simulation of the browser's built-in behavior for \"browser.tabs.searchclipboardfor.middleclick\"=\"true\", and you may need to activate \"dom.events.asyncClipboard.clipboardItem\")" },

"config_autoAttachOnNewTabButtonAccelClick_childTop": { "message": "First Child of the current tab" },
"config_autoAttachOnNewTabButtonAccelClick_childEnd": { "message": "Last Child of the current tab" },

"config_autoAttachOnDuplicated_childTop": { "message": "First Child of the current tab" },
"config_autoAttachOnDuplicated_childEnd": { "message": "Last Child of the current tab" },

"config_treeDoubleClickBehavior_toggleSticky": { "message": "Stick to tab bar adges / Unstick from tab bar edges" },

"config_simulateTabsLoadInBackgroundInverted_label": { "message": "When you open a dropped link in a new tab, switch to it immediately (*simulation of the browser's built-in option \"When you open a link, image or media in a new tab, switch to it immediately\" (\"browser.tabs.loadInBackground\"))" },

@piroor
Copy link
Owner

piroor commented May 31, 2024

I've confirmed that there are no not-translated-yet entries in ru locale.

@vadcx
Copy link
Author

vadcx commented May 31, 2024

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 :)

@piroor
Copy link
Owner

piroor commented May 31, 2024

OK, I'll remove these untranslated entries from de locale if necessary. Don't mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants