From ce2efec61091d714127b9d07a003beb819090545 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 18 Dec 2018 18:13:02 -0800 Subject: Delete install/Info.plist, because PyInstaller doesn't actually even use it. And bump Mac Tor Browser version to 8.0.4, but I'll still need to bump it again before the 2.0 release --- install/Info.plist | 18 ------------------ install/get-tor-osx.py | 6 +++--- 2 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 install/Info.plist diff --git a/install/Info.plist b/install/Info.plist deleted file mode 100644 index 0125c1d5..00000000 --- a/install/Info.plist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - onionshare-gui - CFBundleIdentifier - com.micahflee.onionshare - NSHighResolutionCapable - - CFBundleShortVersionString - {VERSION} - CFBundleIconFile - icon.icns - - diff --git a/install/get-tor-osx.py b/install/get-tor-osx.py index ae20fd74..61c2a4bf 100644 --- a/install/get-tor-osx.py +++ b/install/get-tor-osx.py @@ -35,9 +35,9 @@ import subprocess import requests def main(): - dmg_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/8.0.1/TorBrowser-8.0.1-osx64_en-US.dmg' - dmg_filename = 'TorBrowser-8.0.1-osx64_en-US.dmg' - expected_dmg_sha256 = 'fb1be2a0f850a65bae38747c3abbf9061742c5d7799e1693405078aaf38d2b08' + dmg_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/8.0.4/TorBrowser-8.0.4-osx64_en-US.dmg' + dmg_filename = 'TorBrowser-8.0.4-osx64_en-US.dmg' + expected_dmg_sha256 = '44433ee2052cf3062e0dc29e640a6ae50db2775bc8939253f5f9d81614f2db07' # Build paths root_path = os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))) -- cgit v1.2.3-54-g00ecf From e6f26f65459489de6c59dda8bc8e4abc213ba762 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 18 Dec 2018 18:53:40 -0800 Subject: When discovering default locale, default to english if locale.getdefaultlocale() returns None. Also, make locales that include country codes (pt_PT and pt_BR) actually work as default locales --- onionshare/settings.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/onionshare/settings.py b/onionshare/settings.py index fc68ffc9..91844c8d 100644 --- a/onionshare/settings.py +++ b/onionshare/settings.py @@ -111,7 +111,19 @@ class Settings(object): # Choose the default locale based on the OS preference, and fall-back to English if self._settings['locale'] is None: - default_locale = locale.getdefaultlocale()[0][:2] + language_code, encoding = locale.getdefaultlocale() + + # Default to English + if not language_code: + language_code = 'en_US' + + if language_code == 'pt_PT' and language_code == 'pt_BR': + # Portuguese locales include country code + default_locale = language_code + else: + # All other locales cut off the country code + default_locale = language_code[:2] + if default_locale not in self.available_locales: default_locale = 'en' self._settings['locale'] = default_locale -- cgit v1.2.3-54-g00ecf