[Sugar-devel] [Feature] Starting an activity in a different locale than the system locale

Simon Schampijer simon at schampijer.de
Tue Feb 19 05:20:22 EST 2013


Hi,

when talking about the 'grab watch hands' feature [1] in the Clock 
activity I came across the desire to show the written clock information 
(e.g. ten minutes to 10 am) in different languages.

To make that easily manageable without reloading translations on 
run-time I was wondering if there would be a general desire to run 
activities in different locales independent from the system. One 
scenario would be that a teacher in a Spanish speaking country would 
start the Clock activity in the English locale to teach the clock in 
English.

The question is, if starting an activity in a different locale than the 
system locale that would be an interesting feature in general. 
Advantages would be that the locale of the system does not change, 
making experimenting with languages not as disruptive. Would people 
think that would be a pedagogical interesting feature?

Technically, one of doing this would be to set the 'LANG/LANGUAGE' env 
variable in sugar-activity, reading the config from a system file. That 
file could be modified in an activity section (e.g. control panel or the 
activity list view...)

diff --git a/bin/sugar-activity b/bin/sugar-activity
index abaa091..070a196 100644
--- a/bin/sugar-activity
+++ b/bin/sugar-activity
@@ -104,6 +104,8 @@ def main():
      os.environ['SUGAR_BUNDLE_ID'] = bundle.get_bundle_id()
      os.environ['SUGAR_BUNDLE_NAME'] = bundle.get_name()
      os.environ['SUGAR_BUNDLE_VERSION'] = 
str(bundle.get_activity_version())
+    os.environ['LANG'] = 'de_DE'
+    os.environ['LANGUAGE'] = 'de_DE'

      # must be done early, some activities set translations globally, 
SL #3654
      locale_path = i18n.get_locale_path(bundle.get_bundle_id())


Regards,
    Simon

[1] http://bugs.sugarlabs.org/ticket/1959


More information about the Sugar-devel mailing list