views:

52

answers:

2

What is the link to find the list of languages i.e, language_code

      (Swedish,sv)
      (English,en) ..........

Please provide the link

Thanks..

+3  A: 

Wiki:

http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

histrio
A: 

If you want something you can use from within django, try:

from django.conf.global_settings import LANGUAGES

this will be in the format above, making it perfect for assignment in one of your models choices= fields. (i.e. user_language = models.CharField(max_length=4, choices=LANGUAGES))

LANGUAGES = (
    ('ar', gettext_noop('Arabic')),
    ('bg', gettext_noop('Bulgarian')),
    ('bn', gettext_noop('Bengali')),
    etc....
    )
Thomas
Added bonus to this method: since the gettext_noop() is a lazy lookup, the language names will be translated based upon your user's locale at template render time. Meaning an english user will see "French" but a french user will see "Francais"
Thomas
is there any reference Pages for the above languages ..
Hulk
http://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py will give you the full list of languages django supports out of the box, and http://docs.djangoproject.com/en/dev/ref/settings/#languages gives you an overview of usage. Hope this helps.
Thomas