def get_current_babel_locale(fallback='en-US-POSIX'):
 locale = get_babel_locale(locale_string=translation.get_language())
 if (not locale):
  if fallback:
   locale = get_babel_locale(fallback)
  if (not locale):
   raise ValueError(('Failed to get current babel locale (lang=%s)' % (translation.get_language(),)))
 return locale

def get_current_babel_locale ( fallback = 'en-US-POSIX' ) : locale = get_babel_locale ( locale_string = translation . get_language ( ) ) if ( not locale ) : if fallback : locale = get_babel_locale ( fallback ) if ( not locale ) : raise ValueError ( ( 'Failed to get current babel locale (lang=%s)' % ( translation . get_language ( ) , ) ) ) return locale
get a babel locale based on the threads locale context .