开发者

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

开发者 https://www.devze.com 2023-02-09 09:15 出处:网络
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 l开发者_StackOverflowanguages anywhere. Wher

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 l开发者_StackOverflowanguages 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!


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

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


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


This may be what you're looking for:

http://code.djangoproject.com/browser/django/tags/releases/1.2.4/django/conf/locale


Instructions within django's settings file itself.

http://www.i18nguy.com/unicode/language-identifiers.html

0

精彩评论

暂无评论...
验证码 换一张
取 消