def __get_current_locale(self): locale = translation.to_locale(translation.get_language()) if _FORMATTER.get_formatting_definition(locale): return locale if _FORMATTER.get_formatting_definition('%s_%s' % (locale, locale)): return '%s_%s' % (locale, locale) return ''
def __get_current_locale(self): # get_language can return None starting on django 1.8 language = translation.get_language() or settings.LANGUAGE_CODE locale = translation.to_locale(language) if _FORMATTER.get_formatting_definition(locale): return locale if _FORMATTER.get_formatting_definition('%s_%s' % (locale, locale)): return '%s_%s' % (locale, locale) return ''