diff options
author | Miguel Jacq <mig@mig5.net> | 2018-10-01 15:32:53 +1000 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2018-10-01 15:32:53 +1000 |
commit | 7e8a76be8ae716d49c3c1f4a996b175361afcd97 (patch) | |
tree | 6a94129c90019517d970b9e42793a2bba3525755 /onionshare_gui | |
parent | 9aa9dc39a1d83992665746f722f3d279046ac1fd (diff) | |
download | onionshare-7e8a76be8ae716d49c3c1f4a996b175361afcd97.tar.gz onionshare-7e8a76be8ae716d49c3c1f4a996b175361afcd97.zip |
Load default settings before parsing for any alternate config. Reload strings if an alternate config was passed in after
Diffstat (limited to 'onionshare_gui')
-rw-r--r-- | onionshare_gui/__init__.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/onionshare_gui/__init__.py b/onionshare_gui/__init__.py index b5520071..675bb52d 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) |