-
-
Notifications
You must be signed in to change notification settings - Fork 938
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
GUI: Add UI language option #2604
Conversation
I realise this is a lot of changes in various parts of both the server and the GUI, so if it would be better to split this into multiple different PRs then I'd be happy to try to do so. Also, if it would help debugging, I can try to rebase the commits to separate the changes of the different parts of the code :) |
18d6ce6
to
d5a425a
Compare
I think this implementation is mostly done. It needs testing to fix any bugs and to make sure it works on all platforms. In particular the macOS GitHub action build seems to be failing for some reason (it seems like an issue to do with file paths and packaging? but I don't have a Mac to test this on). Help with testing and seeing what's wrong there would be great :) |
Lovely, I'll look at this soon :-) Thanks so much for your hard work. |
ea74447
to
15feed0
Compare
Hi @SunderB, I've taken a look at this and in addition to it failing the CI, there's quite a lot of changes in this PR that make it hard to see the precise goals. Would it be at all possible to either modify this PR or create another which has a clear statement and description of the suggested changes and then just the minimum code changes necessary to achieve this. All changes that do nice refactoring and tidying etc should ideally be separate PRs to keep things easy to follow and review. |
15feed0
to
23a406e
Compare
5d7b4fa
to
47b34e1
Compare
@samaaron The main goal is to add the option to change the UI language within the GUI. I've gone through it, rebased it on top of the new API changes and trimmed it down to code that's only relevant to the GUI feature. Hopefully it makes it clearer to see its purpose and what it does? :) |
@cmaughan - would you be able to take a very brief look at this? |
Sure, I'll look at it later today |
9f48164
to
de8e03d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, but looks good to me.
It might be nice to add a startup argument to revert to the system default.
.gitignore
Outdated
@@ -61,7 +61,8 @@ app/gui/qt/moc_mainwindow.cpp | |||
app/gui/qt/moc_sonicpiudpserver.cpp | |||
app/gui/qt/qrc_SonicPi.cpp | |||
app/gui/qt/utils/ruby_help.h | |||
app/gui/qt/help/*.html | |||
app/gui/qt/utils/lang_list.h | |||
app/gui/qt/help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we never update the help as a checkin?
de8e03d
to
52259a3
Compare
@cmaughan, thanks! |
@SunderB - let me know when you think it's ready to be merged. |
The only main issue is that some languages' translations fail to load (I believe because no strings are translated?):
Apart from that if you can't find anything else that needs tweaking, it should be good to go I think :) |
Also some of the native language names may need double checking and correcting - I've done my best but some may not be 100% correct. |
Co-authored-by: ethancrawford <ethan_jc@hotmail.com>
Load the language after program output has been redirected to gui.log
… and add a warning about stopping runs & recordings (due to restart) when changing language.
…ts own tab in the SettingsWidget; fix bugs from renaming source files Also, when the user selects 'System language', we now show them the list of detected system languages, and show them which one is in use,
…n changing the language Also clean up/refactor SonicPii18n class
6780ea2
to
cee7fc0
Compare
I've updated it to allow the user to decide whether to restart Sonic Pi or not after selecting a new language. If the user doesn't restart, then the language will be applied when next running Sonic Pi. |
@samaaron @ethancrawford Are there any things that need tweaking or fixing? Are you happy with the structure and how the implementation works? |
@SunderB This is looking really nice, thank-you so much for all your really hard work. I guess my only major question is how people can easily reset to the system default. If a user accidentally changes to a different locale that they can't understand, what's the plan for us supporting them to easily reset things? |
Hi @SunderB - looks like my recent patch removing the old api code has cause some conflicts here - apologies! Any chance you could fix this in the PR? Also, am I right in thinking that you store the current locale choice in the QSettings file? If so, I've recently moved it to the standard config dir, so just nuking that should be a simple way of reverting locale to system default? |
Synths winwood_lead, bass_foundation, and bass_highend
90ccfee
to
a68c2bf
Compare
* Fixes an issue where the settings wouldn't be saved when restarting after selecting a new language. * Also, remove the unnecessary delay in restartApp(). Cleanup should be complete when onExitCleanup() returns.
a68c2bf
to
9372da9
Compare
@samaaron I've managed to fix the conflicts, and after fixing a problem with settings not saving when restarting, it still seems to work. :) And yes, deleting the gui-settings.ini file seems to reset the UI language to the system language on my system. |
* Add Basque and generic English to the list of language names * Add a message in the language options panel when the translations fail to load * Set fallback language code to en_GB instead of en (so it's clear which English translation is being used) * Tweak some log messages from SonicPii18n
Thanks so much for this work - much appreciated. |
Tested on my Mac and Raspberry Pi. Works nicely. Nice addition. |
Where do I find the option? EDIT: I am currently using an old version of sonic-pi because I installed it via the AUR, which is 3.3.1 |
An implementation of an option to change the language of the Sonic Pi GUI (without CMD args or changing the system language).
Features implemented:
Potential ideas for the future (not in the scope of this PR):
Closes #1506
Based on #2017
Feedback and help in completing this & testing this on different platforms is needed and greatly appreciated :)
Checklist:
Add language option
Properly detect system language on Windows (to be tested)
Pass GitHub Builds
Testing