kiwix / kiwix-desktop

Kiwix for Windows and GNU/Linux desktops
https://download.kiwix.org/release/kiwix-desktop/
GNU General Public License v3.0
717 stars 93 forks source link

Allow to change the UI language / Application default language #478

Open kelson42 opened 3 years ago

kelson42 commented 3 years ago

This might be useful for a few users (and for developers to make tests).

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

sgourdas commented 3 months ago

I made a PR to allow language change support from the settings menu.

Some problems I would like to discuss are:

sgourdas commented 3 months ago
Sample: ![image](https://github.com/kiwix/kiwix-desktop/assets/57002743/b10208c4-2dfc-4139-a9f6-606b773f2ef8)
kelson42 commented 2 months ago
  • For now user needs to restart the application for changes to take effect. Should we put a note below the option to indicate that? Or maybe is there a suggestion to dynamically refresh text elements, after language selection.

Ideal solution would to apply dynamically and directly the new UI langauge without restart. But not sure how this should be done. Otherwise I would recommend following workflow:

* For the moment, because there wasn't any discussion that I found regarding how to get the languages, I am statically importing the language codes based on the `ls resources/i18n | awk -F '.json' '{print $1}'` output. What would be a better way to get the languages available?

Qt has for sure a way to list the language available as translation for the app... the main question is if you can display each language name is there language so "Francais" for "French" etc.

* Using the above codes, I convert them to language names using `QLocale(country_code)`. This makes it so some of the languages appear as ["C"](https://doc.qt.io/qt-5/qlocale.html#c) (for example `QLocale("bcl")`)? Should we not use these languages? How can we tackle this?

Here you are :) You will have to handle a local list of language name because qt does not have them all....

sgourdas commented 2 months ago

Here you are :) You will have to handle a local list of language name because qt does not have them all....

Can you please elaborate on this

kelson42 commented 2 months ago

Here you are :) You will have to handle a local list of language name because qt does not have them all....

Can you please elaborate on this

I don't know how to do that, but the list of known language by Qt is limited, so what is the solution you plan? IMHO, you will need something custom. We have this partly already implemented in the libkiwix AFAIK.

kelson42 commented 1 month ago

@sgourdas Impropose to close this PR. The work needed here is significant and I believe we might better work on other issues for the moment. But, of course, if you are really motivated, we can bring it to the end.

sgourdas commented 1 month ago

I will try to give it a good push this upcoming week. Let's see how it goes and we can move accordingly.

kelson42 commented 1 month ago

@sgourdas I recommend to have a look how Kiwix Server works, from both developer and user perspective.