fix some translation issues

This commit is contained in:
jonaswinkler 2021-01-02 00:45:23 +01:00
parent 110ef17ed8
commit bcf17bfdc0
5 changed files with 29 additions and 13 deletions

View File

@ -1,10 +1,14 @@
from django.apps import AppConfig from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class DocumentsConfig(AppConfig): class DocumentsConfig(AppConfig):
name = "documents" name = "documents"
verbose_name = _("Documents")
def ready(self): def ready(self):
from .signals import document_consumption_finished from .signals import document_consumption_finished
from .signals.handlers import ( from .signals.handlers import (

View File

@ -29,12 +29,12 @@ class MatchingModel(models.Model):
MATCH_AUTO = 6 MATCH_AUTO = 6
MATCHING_ALGORITHMS = ( MATCHING_ALGORITHMS = (
(MATCH_ANY, _("Any")), (MATCH_ANY, _("Any word")),
(MATCH_ALL, _("All")), (MATCH_ALL, _("All words")),
(MATCH_LITERAL, _("Literal")), (MATCH_LITERAL, _("Exact match")),
(MATCH_REGEX, _("Regular Expression")), (MATCH_REGEX, _("Regular expression")),
(MATCH_FUZZY, _("Fuzzy Match")), (MATCH_FUZZY, _("Fuzzy word")),
(MATCH_AUTO, _("Automatic Classification")), (MATCH_AUTO, _("Automatic")),
) )
name = models.CharField( name = models.CharField(
@ -312,11 +312,11 @@ class Document(models.Model):
class Log(models.Model): class Log(models.Model):
LEVELS = ( LEVELS = (
(logging.DEBUG, "Debugging"), (logging.DEBUG, _("debug")),
(logging.INFO, "Informational"), (logging.INFO, _("information")),
(logging.WARNING, "Warning"), (logging.WARNING, _("warning")),
(logging.ERROR, "Error"), (logging.ERROR, _("error")),
(logging.CRITICAL, "Critical"), (logging.CRITICAL, _("critical")),
) )
group = models.UUIDField( group = models.UUIDField(

View File

@ -7,6 +7,8 @@ from django.views.generic import RedirectView
from rest_framework.authtoken import views from rest_framework.authtoken import views
from rest_framework.routers import DefaultRouter from rest_framework.routers import DefaultRouter
from django.utils.translation import gettext_lazy as _
from documents.views import ( from documents.views import (
CorrespondentViewSet, CorrespondentViewSet,
DocumentViewSet, DocumentViewSet,
@ -103,4 +105,4 @@ admin.site.site_header = 'Paperless-ng'
# Text at the end of each page's <title>. # Text at the end of each page's <title>.
admin.site.site_title = 'Paperless-ng' admin.site.site_title = 'Paperless-ng'
# Text at the top of the admin index page. # Text at the top of the admin index page.
admin.site.index_title = 'Paperless-ng administration' admin.site.index_title = _('Paperless-ng administration')

View File

@ -1,7 +1,9 @@
from django.apps import AppConfig from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class PaperlessMailConfig(AppConfig): class PaperlessMailConfig(AppConfig):
name = 'paperless_mail' name = 'paperless_mail'
verbose_name = 'Paperless Mail' verbose_name = _('Paperless mail')

View File

@ -7,6 +7,10 @@ from django.utils.translation import gettext_lazy as _
class MailAccount(models.Model): class MailAccount(models.Model):
class Meta:
verbose_name = _("mail account")
verbose_name_plural = _("mail accounts")
IMAP_SECURITY_NONE = 1 IMAP_SECURITY_NONE = 1
IMAP_SECURITY_SSL = 2 IMAP_SECURITY_SSL = 2
IMAP_SECURITY_STARTTLS = 3 IMAP_SECURITY_STARTTLS = 3
@ -52,6 +56,10 @@ class MailAccount(models.Model):
class MailRule(models.Model): class MailRule(models.Model):
class Meta:
verbose_name = _("mail rule")
verbose_name_plural = _("mail rules")
ACTION_DELETE = 1 ACTION_DELETE = 1
ACTION_MOVE = 2 ACTION_MOVE = 2
ACTION_MARK_READ = 3 ACTION_MARK_READ = 3