dabo Commit
Revision 6492
Date: 2011-03-05 07:47:56 -0800 (Sat, 05 Mar 2011)
Author: Werner
Trac: http://trac.dabodev.com/changeset/6492
Changed:
U trunk/dabo/dLocalize.py
U trunk/dabo/settings.py
Log:
- allow overriding of the language defined by locale.
Diff:
Modified: trunk/dabo/dLocalize.py
===================================================================
--- trunk/dabo/dLocalize.py 2011-03-04 21:40:34 UTC (rev 6491)
+++ trunk/dabo/dLocalize.py 2011-03-05 15:47:56 UTC (rev 6492)
@@ -14,6 +14,9 @@
if _defaultLanguage is None:
_defaultLanguage = dabo.defaultLanguage
+
+if dabo.overrideLocaleLanguage:
+ _defaultLanguage = dabo.defaultLanguage
if _defaultEncoding is None:
_defaultEncoding = dabo.getEncoding()
Modified: trunk/dabo/settings.py
===================================================================
--- trunk/dabo/settings.py 2011-03-04 21:40:34 UTC (rev 6491)
+++ trunk/dabo/settings.py 2011-03-05 15:47:56 UTC (rev 6492)
@@ -1,29 +1,32 @@
# -*- coding: utf-8 -*-
+"""
+Dabo Global Settings
-import os
-import sys
-import logging
+Do not modify this file directly. Instead, create a file called
+settings_override.py, and copy/paste the settings section below into the
+settings_override.py file. This way, when you update Dabo, you won't blow
+away your custom tweaks.
-# Dabo Global Settings
+Note that creating a settings_override.py isn't the only way to tweak the
+settings - your custom code can also just make the settings in the dabo
+namespace at runtime, eg::
-# Do not modify this file directly. Instead, create a file called
-# settings_override.py, and copy/paste the settings section below into the
-# settings_override.py file. This way, when you update Dabo, you won't blow
-# away your custom tweaks.
+ import dabo
+ dabo.eventLogging = True
+ <do stuff>
+ dabo.eventLogging = False
-# Note that creating a settings_override.py isn't the only way to tweak the
-# settings - your custom code can also just make the settings in the dabo
-# namespace at runtime, eg:
-#
-# import dabo
-# dabo.eventLogging = True
-# <do stuff>
-# dabo.eventLogging = False
+.. note::
+
+ settings_override.py is not the appropriate place to put
+ application-specific settings, although it may seem at first like an
easy
+ place to do so.
-# Also note that settings_override.py is not the appropriate place to put
-# application-specific settings, although it may seem at first like an easy
-# place to do so.
+"""
+import os
+import sys
+import logging
### Settings - begin
@@ -106,6 +109,9 @@
# Default language to use when none is specified
defaultLanguage = "en"
+# Override language set in python.locale.getdefaultlocale
+overrideLocaleLanguage = False
+
# Default encoding to use when none is specified
defaultEncoding = "utf-8"
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]