Replace the DOCUMENTS_LANGUAGE_CHOICES setting option. Replaced with the new DOCUMENTS_LANGUAGE_CODES.

Reduce default language code choice from 7800 to the top 100 spoken languages and related (https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers).

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-06-03 02:53:45 -04:00
parent 9896f7d52a
commit 2ee73e12b4
8 changed files with 48 additions and 15 deletions

View File

@@ -0,0 +1,16 @@
from __future__ import unicode_literals
#import os
import pycountry
#from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from .settings import setting_language_codes
language_choices = [
(
iso639_3, _(pycountry.languages.get(alpha_3=iso639_3).name)
) for iso639_3 in setting_language_codes.value
]