PICARD-1633: fix system locale detection on macOS

This failed due to:
- macOS returning language / country separated by "-" instead of "_" (en-UK instead of en_UK)
- required pyobjc modules not being packaged
This commit is contained in:
Philipp Wolfer
2019-10-09 14:55:31 +02:00
committed by Philipp Wolfer
parent 16160e62a3
commit 776f10d5a4
2 changed files with 3 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ def setup_gettext(localedir, ui_language=None, logger=None):
import Foundation
defaults = Foundation.NSUserDefaults.standardUserDefaults()
current_locale = defaults.objectForKey_('AppleLanguages')[0]
current_locale = current_locale.replace('-', '_')
locale.setlocale(locale.LC_ALL, current_locale)
except Exception as e:
logger(e)

View File

@@ -1,3 +1,5 @@
discid==1.2.0
mutagen==1.42.0
pyobjc-core==5.2
pyobjc-framework-Cocoa==5.2
PyQt5==5.13.1