summaryrefslogtreecommitdiff
path: root/onionshare
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2018-10-01 15:32:53 +1000
committerMiguel Jacq <mig@mig5.net>2018-10-01 15:32:53 +1000
commit7e8a76be8ae716d49c3c1f4a996b175361afcd97 (patch)
tree6a94129c90019517d970b9e42793a2bba3525755 /onionshare
parent9aa9dc39a1d83992665746f722f3d279046ac1fd (diff)
downloadonionshare-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')
-rw-r--r--onionshare/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/onionshare/__init__.py b/onionshare/__init__.py
index 2f0ef14c..069559c5 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