You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ended up creating my own method with fallback to the default language.
def get_language():
lang = django_get_language()
if lang:
return lang
else:
return settings.LANGUAGE_CODE
def get_real_fieldname(field, lang=None):
if lang is None:
lang = get_language()
lang = lang.split('-')[0] # both 'en-US' and 'en' -> 'en'
return str('%s_%s' % (field, lang))
When get_language returns None (supported in Django 1.8)
fails
The text was updated successfully, but these errors were encountered: