summaryrefslogtreecommitdiff
path: root/onionshare/strings.py
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-10-13 14:35:40 -0400
committerGitHub <noreply@github.com>2019-10-13 14:35:40 -0400
commit896659c6963c14c4e047cff7f3d421977060ed23 (patch)
tree660468dd7478fb001ced211a4a33ae28a1b5f9a4 /onionshare/strings.py
parentbbf6c02da645fcd4fc50db18dd341178ad4fa2e6 (diff)
parent7d24bf9ffcd1e21e087431c21bfc658803a61ab6 (diff)
downloadonionshare-ef18b4b310216abf6f48bfe2a8bb52b70a782d76.tar.gz
onionshare-ef18b4b310216abf6f48bfe2a8bb52b70a782d76.zip
Merge pull request #1048 from micahflee/developv2.2
Version 2.2
Diffstat (limited to 'onionshare/strings.py')
-rw-r--r--onionshare/strings.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/onionshare/strings.py b/onionshare/strings.py
index 643186dd..76360a42 100644
--- a/onionshare/strings.py
+++ b/onionshare/strings.py
@@ -35,14 +35,14 @@ def load_strings(common):
# Load all translations
translations = {}
for locale in common.settings.available_locales:
- locale_dir = common.get_resource_path('locale')
+ locale_dir = common.get_resource_path("locale")
filename = os.path.join(locale_dir, "{}.json".format(locale))
- with open(filename, encoding='utf-8') as f:
+ with open(filename, encoding="utf-8") as f:
translations[locale] = json.load(f)
# Build strings
- default_locale = 'en'
- current_locale = common.settings.get('locale')
+ default_locale = "en"
+ current_locale = common.settings.get("locale")
strings = {}
for s in translations[default_locale]:
if s in translations[current_locale] and translations[current_locale][s] != "":
@@ -57,4 +57,5 @@ def translated(k):
"""
return strings[k]
+
_ = translated