Last active
October 1, 2018 03:35
-
-
Save mig5/ac809baa9592399806babf093b566f07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/onionshare/__init__.py b/onionshare/__init__.py | |
index 2f0ef14..069559c 100644 | |
--- a/onionshare/__init__.py | |
+++ b/onionshare/__init__.py | |
@@ -33,8 +33,12 @@ def main(cwd=None): | |
""" | |
common = Common() | |
- # Load settings right away, in order to get locale setting for strings | |
- common.load_settings(config) | |
+ # Load the default settings and strings early, for the sake of being able to parse options. | |
+ # These won't be in the user's chosen locale necessarily, but we need to parse them | |
+ # early in order to even display the option to pass alternate settings (which might | |
+ # contain a preferred locale). | |
+ # If an alternate --config is passed, we'll reload strings later. | |
+ common.load_settings() | |
strings.load_strings(common) | |
# Display OnionShare banner | |
@@ -95,6 +99,8 @@ def main(cwd=None): | |
# Re-load settings, if a custom config was passed in | |
if config: | |
common.load_settings(config) | |
+ # Re-load the strings, in case the provided config has changed locale | |
+ strings.load_strings(common) | |
# Debug mode? | |
common.debug = debug | |
diff --git a/onionshare_gui/__init__.py b/onionshare_gui/__init__.py | |
index b552007..675bb52 100644 | |
--- a/onionshare_gui/__init__.py | |
+++ b/onionshare_gui/__init__.py | |
@@ -59,7 +59,11 @@ def main(): | |
common = Common() | |
common.define_css() | |
- # Load settings right away, in order to get locale setting for strings | |
+ # Load the default settings and strings early, for the sake of being able to parse options. | |
+ # These won't be in the user's chosen locale necessarily, but we need to parse them | |
+ # early in order to even display the option to pass alternate settings (which might | |
+ # contain a preferred locale). | |
+ # If an alternate --config is passed, we'll reload strings later. | |
common.load_settings() | |
strings.load_strings(common) | |
@@ -88,6 +92,10 @@ def main(): | |
filenames[i] = os.path.abspath(filenames[i]) | |
config = args.config | |
+ if config: | |
+ # Re-load the strings, in case the provided config has changed locale | |
+ common.load_settings(config) | |
+ strings.load_strings(common) | |
local_only = bool(args.local_only) | |
debug = bool(args.debug) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment