Adding unsupported language

Article Content


Django currently not handling all languages. You can see list of supported languages there.

You can simply add language to that list by extending in settings.py django languages dictionary - LANG_INFO.

Below example showing how to do it, in that case language Tagalog will be added to project.


import django.conf.locale
 
EXTRA_LANG_INFO = {
    'tl': {
        'bidi': False, # right-to-left
        'code': 'tl',
        'name': 'Tagalog',
        'name_local': u'Tagalog',
    },
}
 
LANG_INFO = dict(django.conf.locale.LANG_INFO.items() + EXTRA_LANG_INFO.items())
 
# update the language info
django.conf.locale.LANG_INFO = LANG_INFO
    

SubArticles


About

Added by dominik

Date: Dec. 5, 2017, 6:31 p.m.

Comments