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
This commit is contained in:
parent
04e83a0517
commit
dba1f95e12
|
@ -17,3 +17,11 @@ get_language = lambda: settings.LANGUAGE_CODE
|
||||||
get_language_bidi = lambda: settings.LANGUAGE_CODE in settings.LANGUAGES_BIDI
|
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_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)
|
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()
|
||||||
|
|
Loading…
Reference in New Issue