[Bugs] #4450 sugar HIGH: Sugar needs to be able to launch applications when ~/.i18n missing or corrupt

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Fri Mar 1 07:03:55 EST 2013


#4450: Sugar needs to be able to launch applications when ~/.i18n missing or
corrupt
--------------------------+-------------------------------------------------
    Reporter:  greenfeld  |          Owner:  erikos     
        Type:  defect     |         Status:  new        
    Priority:  High       |      Milestone:  0.98       
   Component:  sugar      |        Version:  0.98.x     
    Severity:  Major      |       Keywords:             
Distribution:  OLPC       |   Status_field:  Unconfirmed
--------------------------+-------------------------------------------------
Changes (by erikos):

  * priority:  Unspecified by Maintainer => High
  * milestone:  Unspecified by Release Team => 0.98


Comment:

 {{{
 [erikos at t61 sugar-toolkit-gtk3]$ git diff src/sugar3/activity/i18n.py
 diff --git a/src/sugar3/activity/i18n.py b/src/sugar3/activity/i18n.py
 index 8b8e663..ca8cda4 100644
 --- a/src/sugar3/activity/i18n.py
 +++ b/src/sugar3/activity/i18n.py
 @@ -135,10 +135,14 @@ def get_locale_path(bundle_id):

      candidate_dirs[os.path.join(sys.prefix, 'share', 'locale')] = 0

 +    default_locale = locale.getdefaultlocale()[0]
 +    if not default_locale:
 +        default_locale = 'en_US'
 +
      for candidate_dir in candidate_dirs.keys():
          if os.path.exists(candidate_dir):
              full_path = os.path.join(candidate_dir, \
 -                locale.getdefaultlocale()[0], 'LC_MESSAGES', \
 +                default_locale, 'LC_MESSAGES', \
                  bundle_id + '.mo')
              if os.path.exists(full_path):
                  try:
 }}}

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/4450#comment:4>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list