Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added check_for_language and to_locale to utils.translation.trans_null

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3344 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit dba1f95e126060edd52d682339e9a811a916719b 1 parent 04e83a0
@adrianholovaty adrianholovaty authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 django/utils/translation/trans_null.py
View
8 django/utils/translation/trans_null.py
@@ -17,3 +17,11 @@ def ngettext(singular, plural, number):
get_language_bidi = lambda: settings.LANGUAGE_CODE in settings.LANGUAGES_BIDI
get_date_formats = lambda: (settings.DATE_FORMAT, settings.DATETIME_FORMAT, settings.TIME_FORMAT)
get_partial_date_formats = lambda: (settings.YEAR_MONTH_FORMAT, settings.MONTH_DAY_FORMAT)
+check_for_language = lambda x: True
+
+def to_locale(language):
+ p = language.find('-')
+ if p >= 0:
+ return language[:p].lower()+'_'+language[p+1:].upper()
+ else:
+ return language.lower()
Please sign in to comment.
Something went wrong with that request. Please try again.