def set_pootle_locale_from_settings():
 if (os.name == 'nt'):
  return
 lang = translation.to_locale(settings.LANGUAGE_CODE)
 try:
  if ((lang == 'tr') or lang.startswith('tr_')):
   raise ValueError('Turkish locale broken due to changed meaning of lower()')
  locale.setlocale(locale.LC_ALL, (lang, 'UTF-8'))
 except:
  logging.debug('Failed to set locale to Pootle default (%s); loading system default', lang)
  locale.setlocale(locale.LC_ALL, '')

def set_pootle_locale_from_settings ( ) : if ( os . name == 'nt' ) : return lang = translation . to_locale ( settings . LANGUAGE_CODE ) try : if ( ( lang == 'tr' ) or lang . startswith ( 'tr_' ) ) : raise ValueError ( 'Turkish locale broken due to changed meaning of lower()' ) locale . setlocale ( locale . LC_ALL , ( lang , 'UTF-8' ) ) except : logging . debug ( 'Failed to set locale to Pootle default (%s); loading system default' , lang ) locale . setlocale ( locale . LC_ALL , '' )
try to set pootle locale based on the language specified in settings .