Syncplay / syncplay

Client/server to synchronize media playback on mpv/VLC/MPC-HC/MPC-BE on many computers
http://syncplay.pl/
Apache License 2.0
2.11k stars 215 forks source link

Language detection does not work correctly #288

Closed v-ji closed 4 years ago

v-ji commented 4 years ago

Hi everyone,

The code for getInitialLanguage() does not seem to be working correctly across platforms.

On macOS, it automatically sets Syncplay to English even though my system language is German. Python’s locale.getdefaultlocale() returns ('en_GB', 'UTF-8'). After a bit of searching it seems like unfortunately, there is no straightforward cross-platform way to get the system language in Python.

Is this working correctly for users on other platforms or other macOS users?

Et0h commented 4 years ago

It's a shame it doesn't work, but not sure if there is a fix other than manually setting the language, e.g by following the guidance at https://syncplay.pl/guide/client/ and:

Et0h commented 4 years ago

@vaviary What result do you get from locale.getpreferredencoding() on macOS?

v-ji commented 4 years ago

Sorry, I made a dumb mistake there: My .zshrc had the line export LC_CTYPE=en_GB.UTF-8. Launching Python in Terminal.app without a shell it returns the following:

>>> locale.getpreferredencoding()
'UTF-8'
>>> locale.getdefaultlocale()
('de_DE', 'UTF-8')

Where does Syncplay get its locale from, then?

Et0h commented 4 years ago

I don't know as I don't use macOS. Are you using the AppImage available from https://github.com/Syncplay/syncplay/releases/download/v1.6.4a/Syncplay_1.6.4a.dmg and/or the slightly more recent experimental one available from https://bintray.com/syncplay/Syncplay/download_file?file_path=Syncplay-1.6.5-x86_64.AppImage ? Is there a difference between the two?

v-ji commented 4 years ago

I’m using the latest GitHub release as installed by Homebrew, so version 1.6.4a.

I went ahead and downloaded the 1.6.5 .dmg from Bintray (I think you accidentally linked to the AppImage). Unfortunately, it still detects English as the system language.

albertosottile commented 4 years ago

Interesting... Which version of macOS do you have? Can you make a screenshot of the Language & Region settings in System Preferences? I am interested in what languages are listed there and in which order. Thank you.

v-ji commented 4 years ago

I’m using macOS Catalina 10.15.3 and here’s a screenshot of the language settings menu:

Bildschirmfoto 2020-04-06 um 11 55 24

German is the primary language on the left (“Primär”).

JBeckwith commented 4 years ago

Would just like to add that this appears as an issue in the "inverse" - the language will be set to German on a Mac with English set as the default language.

pratyushmanocha commented 4 years ago

Hi, I would like to mention that even I am facing this issue but in my case, the language displayed to me is Russian. My default language is English but I have no clue how this is happening. In addition to this, I am unable to add a server password in the password field in the gui config panel.

I tried running Syncplay from the cli using the -g argument that forcefully brings up the gui. This allows me to modify the password field (only in this session) but the on-screen language for the Mac OS folders is still Russian.

I installed Syncplay using brew cask install syncplay and am running it on MacOS Catalina.

Apart from this, I have been facing a few more issues and if possible, would like to create another discussion thread for them.

I would be glad to furnish any more information that would be required. Thanks in advance.

albertosottile commented 4 years ago

@v-ji I just reproduced the issue in my local testing virtual machine. I will try to investigate it as soon as I can.

@JBeckwith @pratyushmanocha I think we are mixing different issues here. The original issue is that the GUI is displayed in English even though the System language is set to a different, supported one (e.g. German). If you are experiencing other bugs, please open new issues in the tracker. Please note that a language issue has been solved in the unreleased 1.6.5 version linked above (https://bintray.com/syncplay/Syncplay/download_file?file_path=Syncplay_1.6.5.dmg). I would encourage you to test it before opening a new issue.

albertosottile commented 4 years ago

Hello @v-ji, I just prepared a build with a fix for this issue in my fork. Could you download this version from https://bintray.com/alby128/Syncplay/download_file?file_path=Syncplay_1.6.5.dmg and test in on your system? Please, let me know if the correct language is shown when you use this build.

v-ji commented 4 years ago

I just tested it and it works flawlessly!

Bildschirmfoto 2020-04-24 um 13 46 24