Make document language choices a configurable list. Issue #137.

To override the default list of 600+ languages add a configuration entry to your settings/local.py like so:
DOCUMENTS_LANGUAGE_CHOICES = [('eng', 'English'), ('deu', 'German')]

to make the list translatable import ugettext_lazy and enclose the language name with _():

from django.utils.translation import ugettext_lazy as _
DOCUMENTS_LANGUAGE_CHOICES = [('eng', _('English')), ('deu', _('German'))]
This commit is contained in:
Roberto Rosario
2015-01-14 02:22:47 -04:00
parent adcf621ee1
commit fd1f5d1dad
4 changed files with 7 additions and 8 deletions
+2 -3
View File
@@ -32,12 +32,11 @@ from mimetype.api import get_mimetype
from .events import event_document_create
from .exceptions import NewDocumentVersionNotAllowed
from .literals import LANGUAGE_CHOICES
from .managers import (DocumentManager, DocumentPageTransformationManager,
DocumentTypeManager, RecentDocumentManager)
from .runtime import storage_backend
from .settings import (CACHE_PATH, DISPLAY_SIZE, LANGUAGE, ZOOM_MAX_LEVEL,
ZOOM_MIN_LEVEL)
from .settings import (CACHE_PATH, DISPLAY_SIZE, LANGUAGE, LANGUAGE_CHOICES,
ZOOM_MAX_LEVEL, ZOOM_MIN_LEVEL)
from .signals import post_version_upload, post_document_type_change
HASH_FUNCTION = lambda x: hashlib.sha256(x).hexdigest() # document image cache name hash function