Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored July 14, 2006

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  django/utils/translation/trans_null.py
8  django/utils/translation/trans_null.py
@@ -17,3 +17,11 @@ def ngettext(singular, plural, number):
17 17
 get_language_bidi = lambda: settings.LANGUAGE_CODE in settings.LANGUAGES_BIDI
18 18
 get_date_formats = lambda: (settings.DATE_FORMAT, settings.DATETIME_FORMAT, settings.TIME_FORMAT)
19 19
 get_partial_date_formats = lambda: (settings.YEAR_MONTH_FORMAT, settings.MONTH_DAY_FORMAT)
  20
+check_for_language = lambda x: True
  21
+
  22
+def to_locale(language):
  23
+    p = language.find('-')
  24
+    if p >= 0:
  25
+        return language[:p].lower()+'_'+language[p+1:].upper()
  26
+    else:
  27
+        return language.lower()

0 notes on commit dba1f95

Please sign in to comment.
Something went wrong with that request. Please try again.