Language

Django already has excellent support for internationalization, but there’s currently no built-in field to store the user’s language (though there is middleware that can take the user’s locale from the browser). This module provides a field that allows you to store the user’s language in his profile.

All languages defined in the CLDR are defined in this module. Note that CLDR will use names such as zh-Hans, though we normalize that to all-lowercase, i.e. zh-hans, as this is how Django stores language codes.

class internationalflavor.language.models.LanguageField(languages=None, exclude=None, *args, **kwargs)

A model field that allows users to choose their language. By default, all languages that are defined in your settings file are available. Use the langagues argument to specify your own langagues, and use exclude to exclude specific languages.

class internationalflavor.language.forms.LanguageFormField(languages=None, exclude=None, *args, **kwargs)