Attachments you submit will be routed for moderation. If you have an account, please
log in first.
|
File sugar-979.patch, 1.4 KB
(added by alsroot, 4 years ago)
|
|
|
-
From 6e1ce26c4d7c72d48d6088388f94ca299025edde Mon Sep 17 00:00:00 2001
From: Aleksey Lim <alsroot@member.fsf.org>
Date: Tue, 28 Jul 2009 19:54:24 +0000
Subject: Browse activity does not start if LANG=C #979
---
webactivity.py | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/webactivity.py b/webactivity.py
index a7c55bb..07469c1 100644
|
a
|
b
|
|
| 30 | 30 | import sqlite3 |
| 31 | 31 | import cjson |
| 32 | 32 | import gconf |
| | 33 | import locale |
| 33 | 34 | |
| 34 | 35 | # HACK: Needed by http://dev.sugarlabs.org/ticket/456 |
| 35 | 36 | import gnome |
| … |
… |
|
| 134 | 135 | def _set_accept_languages(): |
| 135 | 136 | ''' Set intl.accept_languages based on the locale |
| 136 | 137 | ''' |
| 137 | | try: |
| 138 | | lang = os.environ['LANG'].strip('\n') # e.g. es_UY.UTF-8 |
| 139 | | except KeyError: |
| 140 | | return |
| 141 | 138 | |
| 142 | | if (not lang.endswith(".utf8") or not lang.endswith(".UTF-8")) \ |
| 143 | | and lang[2] != "_": |
| | 139 | lang = locale.getdefaultlocale()[0] |
| | 140 | if not lang: |
| 144 | 141 | _logger.debug("Set_Accept_language: unrecognised LANG format") |
| 145 | | return |
| | 142 | return |
| | 143 | lang = lang.split('_') |
| 146 | 144 | |
| 147 | 145 | # e.g. es-uy, es |
| 148 | | pref = lang[0:2] + "-" + lang[3:5].lower() + ", " + lang[0:2] |
| | 146 | pref = lang[0] + "-" + lang[1].lower() + ", " + lang[0] |
| 149 | 147 | cls = components.classes["@mozilla.org/preferences-service;1"] |
| 150 | 148 | prefService = cls.getService(components.interfaces.nsIPrefService) |
| 151 | 149 | branch = prefService.getBranch('') |
Download in other formats: