Skip to content

Rework parse_vbox_lang, update translations from VirtualBox 6.1 and correlated contexts#249

Merged
anonie-muss merged 4 commits intophpvirtualbox:developfrom
stianvis:update_language_contexts
Apr 29, 2025
Merged

Rework parse_vbox_lang, update translations from VirtualBox 6.1 and correlated contexts#249
anonie-muss merged 4 commits intophpvirtualbox:developfrom
stianvis:update_language_contexts

Conversation

@stianvis
Copy link
Copy Markdown
Contributor

No description provided.

stianvis added 3 commits July 10, 2020 00:02
parse_vbox_lang.php produce quite a few errors and only work on a
single file. This should make it easier to update translations with
changes in VirtualBox. Introduced in reworked script:

  - single file or directory input (batch processing)

  - checks to make sure all strings are included in resulting dat file

  - checks to get an overview of phpVirtualBox files compared to
    VirtualBox files and if settingsGlobalLanguage.html is updated
@stianvis stianvis changed the title Update language contexts Rework parse_vbox_lang, update translations from VirtualBox 6.1 and correlated contexts Jul 23, 2020
@h6w
Copy link
Copy Markdown
Contributor

h6w commented Jul 27, 2020

Thanks. There's a lot here that's going to take a while to go through, but at a glance it looks like you're removing "About phpVirtualbox" and "Installing Guest Additions" in all the languages and replacing it with "Loading....". Is there some reason to be doing this? I can't think why we would be removing any text from the translation matrix. Not removing it would make the patch a lot smaller and easier to understand.

@stianvis
Copy link
Copy Markdown
Contributor Author

stianvis commented Jul 27, 2020

I intended for this to be multiple PRs but probably messed something up, but the last two are connected so one would not work without the other. I know there are many changes but this can't really be done in pieces without breaking something.

Rework parse_vbox_lang.php

See commit message.

Update translations from VirtualBox 6.1

This is php ParseVboxLang.php -I ../../../VirtualBox-6.1/src/VBox/Frontends/VirtualBox/nls/ -O ./ -F and adding the new translations to panes/settingsGlobalLanguage.html. This results in the changes in contexts/strings that requires the next commit.

Update VirtualBox 6.1 translation contexts

Probably been a while since translations have been updated. There is a lot of them but mostly simple changes in source strings to match current in VirtualBox and changes to contexts since some of them have been removed (or strings have been moved to a different context).

The two biggest changes in the source files are

  1. an added if for the display of Hyper-V in js/phpvirtualbox.js since VirtualBox use Hyper-V in the UI and not HyperV.
  2. the functionality of the checkbox in panes/settingsSerialPorts.html needs to be reversed (previously "Create pipe" now "Connect to pipe").

Regarding the changes in the XML files; there aren't many but the same change needs to be done in all of them. I've used German while working on this as the German translation is handled by the VirtualBox project. The change is then mirrored to the others.

There is a "Loading ..." string in VirtualBox ts "UIVirtualMachineItemCloud" context but it is not translated and in trunk this context is removed. This is moved to the "phpVirtualBox" context. "Automatically start the machine after restore" is a new string and I couldn't find it in the VirtualBox translation files (old or current).

The "UIVMDesktop" context doesn't exist anymore. This have been changed to "UIActionPool". "UIActionPool" contain "Console", "About phpVirtualBox..." and "Install Guest Additions...".

If we are to mimic the VirtualBox Qt UI, "VirtualBox User Manual" isn't needed anymore and "About" needs to be changed to "About phpVirtualBox...".
image

There is no context named "UIActionsPool" in neither phpVirtualBox nor VirtualBox. The strings in "UIActionsPool" XML exist in current VirtualBox translations so isn't needed here anyway.

@h6w
Copy link
Copy Markdown
Contributor

h6w commented Aug 30, 2020

Sorry, I know that this is taking a really long time to go through. Just a couple of notes so far:

  1. Please don't rename and edit files at the same time. It makes it impossible to see the actual edits. It means I have to manually pull the old version of the file and your new one from the commit and then diff them.
  2. Please don't mix different types of changes. While I understand your argument for putting these together, there are also typo changes as well as structural changes together. It's best to keep these things separate since typos are a lot easier to approve than structural changes.

Combining changes in this way isn't just bad etiquette, it makes cherry-picking impossible. If we have to roll back one simple change we have to roll back all of them!

@stianvis
Copy link
Copy Markdown
Contributor Author

I don't think I've renamed any files... and any changes to source strings aren't typo changes. They are wrong and break the translations when those are updated to 6.1.

As I've said before. Lots of changes I know. But since this hasn't been updated for a long time this is necessary. It's an all or nothing change since everything is connected (source strings, contexts, etc.)

Just ask if there is something unclear and I'll try to explain.

@h6w
Copy link
Copy Markdown
Contributor

h6w commented Aug 30, 2020

FYI:

parse_vbox_lang.php (deleted) => ParseVBoxLang.php (new)

I'm talking about typo changes like:

  • "you" to "your"
  • "Host to Guest" to "Host To Guest"

There are quite a few like this which are distracting from the fundamental changes being made, particularly in a patch of this size.

These don't look like fixes related to translation and don't occur inside a translate css class.

It's not impossible, it just makes this a lot harder to go through because each line I have to work out what is the intention behind the change, what group of changes it's part of, etc.

@stianvis
Copy link
Copy Markdown
Contributor Author

parse_vbox_lang.php (deleted) => ParseVBoxLang.php (new)

See the commit message for "Rework parse_vbox_lang.php". The script is replaced since I couldn't be sure the old script produced valid data. I needed checks and such.

"Host to Guest" to "Host To Guest"

This is necessary since source strings are used to lookup the translations. I actually spent quite a bit of time to find that one :-)

@h6w
Copy link
Copy Markdown
Contributor

h6w commented Aug 31, 2020

I understand, but these are actually three separate things.

  1. The script to generate the language files,
  2. The changes that resulted from running the script, and
  3. The fixes and errors you found after you ran the script.

With respect to (1), leaving the original script is important so that we can test the differences in output between the old script and your new one. You said "I couldn't be sure" which isn't really very specific enough to be removing the old script. I would have expected more "Old script uses Qm files, new script works on Ts files which are what Virtualbox now uses." but I still wouldn't have deleted the old script because it's still useful until the new script is tested and accepted.

With respect to (2), putting those changes into one commit separately allows us to follow and verify the changes that come specifically from the new script. I should be able to run your script and then diff the output and compare that against the proposed commit.

With respect to (3), these are different to both (1) and (2) and allows us to tell what is script-related and what are human errors.

By putting all these together (and deleting the old script) you're asking us just to trust your commit or (what I'm doing) go back through all this and separate the changes out into one of these three types so that I can verify it independently.

@stianvis stianvis mentioned this pull request Nov 5, 2022
@anonie-muss
Copy link
Copy Markdown
Member

This probably isn't 100% compatible with the latest VBox, but it does get us closer. Thank you @stianvis! I know how much work it is to track these translations down.

@anonie-muss anonie-muss merged commit d298168 into phpvirtualbox:develop Apr 29, 2025
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.

3 participants