jeanslack / Videomass

Videomass is a free, open source and cross-platform GUI for FFmpeg and yt-dlp
https://jeanslack.github.io/Videomass/
GNU General Public License v3.0
1.06k stars 49 forks source link

add language selection #129

Closed jeanslack closed 2 years ago

jeanslack commented 2 years ago

Closes #127

@katnatek please check whether this solves your issue

The code in this PR allows you to select the application language. Please set it using the preferences dialog. Also, the string on line 14 of the Spanish language videomass.po file has been changed from es to es_ES. Maybe that was what was causing the problem.

katnatek commented 2 years ago

Produce error when you try to open the Preference section, if the variant of spanish is not es_ES like in my case that is es_MX

videomass 
Info: executable=/usr/bin/videomass
12:16:39: Debug: Adding duplicate image handler for 'Windows bitmap file'
12:16:39: Debug: Adding duplicate animation handler for '1' type
12:16:39: Debug: Adding duplicate animation handler for '2' type
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/videomass/vdms_main/main_frame.py", line 1289, in Setup
    with preferences.SetUp(self) as set_up:
  File "/usr/lib/python3.8/site-packages/videomass/vdms_dialogs/preferences.py", line 547, in __init__
    self.current_settings()  # call function for initialize setting layout
  File "/usr/lib/python3.8/site-packages/videomass/vdms_dialogs/preferences.py", line 556, in current_settings
    lang = SetUp.LOCALE_NAMES[self.appdata['locale_name']]
KeyError: 'es_MX'
jeanslack commented 2 years ago

Did the application start with the correct language before you opened the preferences?

katnatek commented 2 years ago

Did the application start with the correct language before you opened the preferences?

Negative, still start in english

katnatek commented 2 years ago

Maybe you can get inspiration from how it handle yt-dlg https://github.com/oleksis/youtube-dl-gui/blob/master/youtube_dl_gui/app.py

jeanslack commented 2 years ago

Maybe you can get inspiration from how it handle yt-dlg https://github.com/oleksis/youtube-dl-gui/blob/master/youtube_dl_gui/app.py

Yes, thank you, that's what I did. I removed the wx.LANGUAGE_DEFAULT value (gets the user's default/preferred language from the OS) which was causing the problem. It should work now, can you try again please?