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

Setup translations before Application instantiation #11142

Closed
erikjv opened this issue Aug 23, 2023 · 8 comments · Fixed by #11300
Closed

Setup translations before Application instantiation #11142

erikjv opened this issue Aug 23, 2023 · 8 comments · Fixed by #11300
Assignees
Labels
Milestone

Comments

@erikjv
Copy link
Collaborator

erikjv commented Aug 23, 2023

The version checks have translatable text, and are shown before the translations are set up. Move this to somewhere early in the main() function.

@TheOneRing
Copy link
Contributor

This will also allow us to translate the help text.

@erikjv
Copy link
Collaborator Author

erikjv commented Sep 28, 2023

We can move this code to the main() function as-is, but then we do not get translations for the command-line --help option. (There is no translation yet either, because of the way we setup the translations.) If we would want to translate that help text to the system language, we would have to do the setup in 2 steps:

  • setup the translation for the system language
  • load the command-line arguments
  • if either the --language option or the --confdir option is present, remove the translation for the system language, and load the translation for the override language

We can make this work, but it won't be the most elegant piece of code: we would have to move the command-line parsing and the language setup into its own function, just to prevent blowing up the main() function.

See also issues #11245 and #11246 , which ask for the removal of both option.

erikjv added a commit that referenced this issue Oct 18, 2023
Now the messages during early start-up can be localized.

Fixes: #11142
erikjv added a commit that referenced this issue Oct 27, 2023
Now the messages during early start-up can be localized.

Fixes: #11142
TheOneRing pushed a commit that referenced this issue Oct 27, 2023
Now the messages during early start-up can be localized.

Fixes: #11142
@erikjv
Copy link
Collaborator Author

erikjv commented Oct 30, 2023

Steps to test:

  • have the system language set to something else than English
  • make sure that there are translations for the command-line options for the system language
  • have the UI language set to something different than the system language
  • run and check that the command-line options are translated to the system language
  • run and check that the UI is in the chosen language

@Salipa-Gurung
Copy link
Contributor

Command line options are translated to the client UI language ❓

Tested on:
ownCloud 6.0.0.12815-daily20231205 394c7e
Libraries Qt 6.6.0, OpenSSL 3.1.4 24 Oct 2023
Using virtual files plugin: wincfapi
OS: windows-10.0.19045 (build arch: x86_64, CPU arch: x86_64)
QPA: windows

steps:

  1. system language set to Language other than English (Português)
  2. client UI language set to language different than system language
  3. run and check command line option (owncloud -h) [ not translated to the system language ] ❌
  4. run and check that the UI is in the choosen language ✅

cc: @erikjv

@TheOneRing
Copy link
Contributor

Command line options are translated to the client UI language ❓

Tested on: ownCloud 6.0.0.12815-daily20231205 394c7e Libraries Qt 6.6.0, OpenSSL 3.1.4 24 Oct 2023 Using virtual files plugin: wincfapi OS: windows-10.0.19045 (build arch: x86_64, CPU arch: x86_64) QPA: windows

steps:

1. system language set to Language other than English (Português)

2. client UI language set to language different than system language

3. run and check command line option (owncloud -h) [ not translated to the system language ] ❌

4. run and check that the UI is in the choosen language ✅

cc: @erikjv

That was the intended behaviour.

@Salipa-Gurung
Copy link
Contributor

That was the intended behaviour.

Are the following step valid if translating command line options based on client UI language is the expected behaviour?

Steps to test:

  • have the system language set to something else than English
  • make sure that there are translations for the command-line options for the system language
  • have the UI language set to something different than the system language
  • run and check that the command-line options are translated to the system language
  • run and check that the UI is in the chosen language

@erikjv
Copy link
Collaborator Author

erikjv commented Dec 5, 2023

The order of trying to load translations is:

  1. language set in the settings of the application
  2. system language

So both the UI language and the language for the help options should be the same, if there is a translation available for the options. If a string is not translated, the English version is shown.

@Salipa-Gurung
Copy link
Contributor

Tested on:
ownCloud 6.0.0.13062-daily20240108 b46134
Libraries Qt 6.6.0, OpenSSL 3.1.4 24 Oct 2023
Using virtual files plugin: wincfapi
OS: windows-10.0.19045 (build arch: x86_64, CPU arch: x86_64)
QPA: windows

  • In desktop client, language is set to Korean(ko)
  • System language is set to Deutsch

The help option and desktop UI texts are in the same language. ✔️

Screenshot from 2024-01-08 15-29-24

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

Successfully merging a pull request may close this issue.

3 participants