Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Languages does Django support? I can't find a comprehensive list

Ok so I'm writing an international Django app, And the docs for doing localization are great except I can't seem to find a complete list of the supported languages anywhere. Where are they? What I really want to do is use the list to populate choices on a model, so if there is a way to get this programmatically that would be best.

Thanks!

like image 212
UserZer0 Avatar asked Feb 10 '11 01:02

UserZer0


2 Answers

Straight from the source. All languages Django (trunk) offers translations for.

http://code.djangoproject.com/browser/django/trunk/django/conf/locale

like image 147
Reiner Gerecke Avatar answered Sep 18 '22 01:09

Reiner Gerecke


Cleaning up the pieces of answers:

from django.conf.global_settings import LANGUAGES

class MyModel(models.Model)
    my_field = CharField(max_length=7, choices=LANGUAGES)

and you can see the code directly: global_settings and locale/__init__.py

For more complete instructions on how to build a more extensive list, check out the W3C Language Tag Page

like image 25
Stefano Avatar answered Sep 20 '22 01:09

Stefano