[Pkg-privacy-commits] [torbrowser-launcher] 64/476: made language default to en-US if the we can't figure out the default locale (#12)
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:23 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository torbrowser-launcher.
commit 720470e8ca71b6de52d08d8e7dcf6754efa58861
Author: Micah Lee <micahflee at riseup.net>
Date: Thu Feb 21 09:55:26 2013 -0800
made language default to en-US if the we can't figure out the default locale (#12)
---
torbrowser-launcher | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/torbrowser-launcher b/torbrowser-launcher
index bf560a2..9fe794b 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -62,16 +62,20 @@ class TorBrowserLauncher:
# figure out the language
available_languages = ['en-US', 'ar', 'de', 'es-ES', 'fa', 'fr', 'it', 'ko', 'nl', 'pl', 'pt-PT', 'ru', 'vi', 'zh-CN']
- self.language = locale.getdefaultlocale()[0].replace('_', '-')
- if self.language not in available_languages:
- self.language = self.language.split('-')[0]
- if self.language not in available_languages:
- for l in available_languages:
- if l[0:2] == self.language:
- self.language = l
- # if language isn't available, default to english
- if self.language not in available_languages:
+ default_locale = locale.getdefaultlocale()[0]
+ if default_locale == None:
self.language = 'en-US'
+ else:
+ self.language = default_locale.replace('_', '-')
+ if self.language not in available_languages:
+ self.language = self.language.split('-')[0]
+ if self.language not in available_languages:
+ for l in available_languages:
+ if l[0:2] == self.language:
+ self.language = l
+ # if language isn't available, default to english
+ if self.language not in available_languages:
+ self.language = 'en-US'
# build all relevant paths
def build_paths(self):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git
More information about the Pkg-privacy-commits
mailing list