diff --git a/accounts/apps.py b/accounts/apps.py index 5670610..e2e4c10 100644 --- a/accounts/apps.py +++ b/accounts/apps.py @@ -1,6 +1,8 @@ from django.apps import AppConfig +from django.utils.translation import gettext_lazy as _ class AccountConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'accounts' + verbose_name = _('accounts') diff --git a/accounts/models.py b/accounts/models.py index e9f7f14..90e6c5d 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -19,8 +19,9 @@ class User(AbstractUser): Subject, blank=True, verbose_name=_('customers'), ) - class Meta(AbstractUser.Meta): - ... + class Meta: + verbose_name = _("user") + verbose_name_plural = _("users") def _get_m2m_ids(self, field: str): return list(getattr(self, field).values_list('id', flat=True)) diff --git a/facturio/settings/base.py b/facturio/settings/base.py index deea0b5..aa12454 100644 --- a/facturio/settings/base.py +++ b/facturio/settings/base.py @@ -28,9 +28,9 @@ SECRET_KEY = env( ) # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = env.bool("DEBUG", default=True) +DEBUG = env.bool('DEBUG', default=True) -ALLOWED_HOSTS = ['*'] +ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', str, default=['*']) # Application definition diff --git a/invoices/apps.py b/invoices/apps.py index b68fb44..a718002 100644 --- a/invoices/apps.py +++ b/invoices/apps.py @@ -1,6 +1,8 @@ from django.apps import AppConfig +from django.utils.translation import gettext_lazy as _ class InvoicesConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'invoices' + verbose_name = _('invoices') diff --git a/invoices/models.py b/invoices/models.py index 5ed4f3e..7a4072d 100644 --- a/invoices/models.py +++ b/invoices/models.py @@ -1,17 +1,13 @@ import decimal -import typing from django.contrib.auth import get_user_model from django.db import models from django.utils import timezone from django.utils.translation import gettext_lazy as _ -if typing.TYPE_CHECKING: - from accounts.models import User - from subjects import models as subject_models -UserModel: 'User' = get_user_model() +UserModel = get_user_model() class Invoice(models.Model): diff --git a/locale/cs/LC_MESSAGES/django.po b/locale/cs/LC_MESSAGES/django.po index 984f98f..08b5dae 100644 --- a/locale/cs/LC_MESSAGES/django.po +++ b/locale/cs/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-06 11:28+0000\n" +"POT-Creation-Date: 2025-02-17 20:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,17 +20,21 @@ msgstr "" "<= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" #: accounts/admin.py:12 subjects/models.py:8 -#: subjects/templates/subjects/index.html:6 templates/facturio/base.html:21 +#: subjects/templates/subjects/index.html:6 templates/facturio/base.html:20 msgid "Subjects" msgstr "Subjekty" +#: accounts/apps.py:7 +msgid "accounts" +msgstr "Účty" + #: accounts/forms.py:16 accounts/templates/account/login.html:6 -#: templates/facturio/base.html:41 +#: templates/facturio/base.html:39 msgid "Login" msgstr "Přihlásit se" #: accounts/forms.py:30 accounts/templates/account/register.html:6 -#: templates/facturio/base.html:44 +#: templates/facturio/base.html:42 msgid "Register" msgstr "Registrovat se" @@ -54,6 +58,14 @@ msgstr "dodavatel" msgid "customers" msgstr "odběratelé" +#: accounts/models.py:23 +msgid "user" +msgstr "Uživatel" + +#: accounts/models.py:24 +msgid "users" +msgstr "Uživatelé" + #: accounts/templates/account/me.html:4 accounts/templates/account/me.html:7 msgid "About Me" msgstr "O mně" @@ -92,23 +104,27 @@ msgstr "Angličtina" msgid "Czech" msgstr "Čeština" +#: invoices/apps.py:8 +msgid "invoices" +msgstr "Faktury" + #: invoices/forms.py:51 subjects/forms.py:66 msgid "Save" msgstr "Uložit" -#: invoices/models.py:19 invoices/templates/invoices/invoice.html:125 +#: invoices/models.py:19 invoices/templates/invoices/invoice.html:127 #: invoices/templates/invoices/view.html:4 #: invoices/templates/invoices/view.html:10 msgid "Invoice" msgstr "Faktura" #: invoices/models.py:20 invoices/templates/invoices/index.html:8 -#: invoices/templates/invoices/index.html:11 templates/facturio/base.html:24 +#: invoices/templates/invoices/index.html:11 templates/facturio/base.html:23 msgid "Invoices" msgstr "Faktury" #: invoices/models.py:24 invoices/templates/invoices/index.html:53 -#: invoices/templates/invoices/invoice.html:130 +#: invoices/templates/invoices/invoice.html:132 #: invoices/templates/invoices/view.html:14 msgid "Supplier" msgstr "Dodavatel" @@ -118,7 +134,7 @@ msgid "Supplier data" msgstr "Informace o dodavateli" #: invoices/models.py:31 invoices/templates/invoices/index.html:54 -#: invoices/templates/invoices/invoice.html:148 +#: invoices/templates/invoices/invoice.html:150 #: invoices/templates/invoices/view.html:32 msgid "Customer" msgstr "Zákazník" @@ -128,13 +144,13 @@ msgid "Customer data" msgstr "Informace o zákazníkovi" #: invoices/models.py:36 invoices/templates/invoices/index.html:52 -#: invoices/templates/invoices/invoice.html:160 +#: invoices/templates/invoices/invoice.html:162 #: invoices/templates/invoices/view.html:44 msgid "Invoice date" msgstr "Datum vystavení" #: invoices/models.py:37 invoices/templates/invoices/index.html:55 -#: invoices/templates/invoices/invoice.html:161 +#: invoices/templates/invoices/invoice.html:163 #: invoices/templates/invoices/view.html:45 msgid "Due date" msgstr "Datum splatnosti" @@ -147,22 +163,22 @@ msgstr "Prvek faktury" msgid "Invoice Items" msgstr "Prvky Faktury" -#: invoices/models.py:60 invoices/templates/invoices/invoice.html:172 +#: invoices/models.py:60 invoices/templates/invoices/invoice.html:174 #: invoices/templates/invoices/view.html:56 msgid "Amount" msgstr "Množství" -#: invoices/models.py:61 invoices/templates/invoices/invoice.html:173 +#: invoices/models.py:61 invoices/templates/invoices/invoice.html:175 #: invoices/templates/invoices/view.html:57 msgid "Amount unit" msgstr "Množstevní jednotka" -#: invoices/models.py:62 invoices/templates/invoices/invoice.html:174 +#: invoices/models.py:62 invoices/templates/invoices/invoice.html:176 #: invoices/templates/invoices/view.html:58 msgid "Description" msgstr "Popis" -#: invoices/models.py:64 invoices/templates/invoices/invoice.html:175 +#: invoices/models.py:64 invoices/templates/invoices/invoice.html:177 #: invoices/templates/invoices/view.html:59 msgid "Price for amount" msgstr "Cena za MJ" @@ -199,8 +215,8 @@ msgstr "Zobrazit" msgid "Print" msgstr "Tisk" -#: invoices/templates/invoices/invoice.html:137 -#: invoices/templates/invoices/invoice.html:155 +#: invoices/templates/invoices/invoice.html:139 +#: invoices/templates/invoices/invoice.html:157 #: invoices/templates/invoices/view.html:21 #: invoices/templates/invoices/view.html:39 subjects/forms.py:20 #: subjects/models.py:10 subjects/templates/subjects/index.html:15 @@ -208,8 +224,8 @@ msgstr "Tisk" msgid "CIN" msgstr "IČO" -#: invoices/templates/invoices/invoice.html:139 -#: invoices/templates/invoices/invoice.html:157 +#: invoices/templates/invoices/invoice.html:141 +#: invoices/templates/invoices/invoice.html:159 #: invoices/templates/invoices/view.html:23 #: invoices/templates/invoices/view.html:41 subjects/models.py:12 #: subjects/templates/subjects/index.html:16 @@ -217,22 +233,27 @@ msgstr "IČO" msgid "VAT ID" msgstr "DIČ" -#: invoices/templates/invoices/invoice.html:142 +#: invoices/templates/invoices/invoice.html:144 +#: invoices/templates/invoices/view.html:26 msgid "Bank Account" msgstr "Bankovní účet" -#: invoices/templates/invoices/invoice.html:168 +#: invoices/templates/invoices/invoice.html:170 #: invoices/templates/invoices/view.html:52 msgid "Invoice details" msgstr "Detaily faktury" -#: invoices/templates/invoices/invoice.html:176 -#: invoices/templates/invoices/invoice.html:193 +#: invoices/templates/invoices/invoice.html:178 +#: invoices/templates/invoices/invoice.html:195 #: invoices/templates/invoices/view.html:60 #: invoices/templates/invoices/view.html:77 msgid "Total" msgstr "Celkem" +#: subjects/apps.py:7 +msgid "subjects" +msgstr "Subjekty" + #: subjects/forms.py:16 msgid "Your provided CIN is not correct." msgstr "Vaše poskytnuté IČO není správné." @@ -315,14 +336,14 @@ msgstr "Přidat nový" msgid "Select" msgstr "Vybrat" -#: templates/facturio/base.html:8 templates/facturio/index.html:4 +#: templates/facturio/base.html:7 templates/facturio/index.html:4 msgid "App" msgstr "Aplikace" -#: templates/facturio/base.html:33 +#: templates/facturio/base.html:32 msgid "Profile" msgstr "Profil" -#: templates/facturio/base.html:36 +#: templates/facturio/base.html:35 msgid "Logout" msgstr "Odhlásit se" diff --git a/subjects/apps.py b/subjects/apps.py index c3bdd68..e40f4a1 100644 --- a/subjects/apps.py +++ b/subjects/apps.py @@ -1,6 +1,8 @@ from django.apps import AppConfig +from django.utils.translation import gettext_lazy as _ class SubjectsConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'subjects' + verbose_name = _('subjects') diff --git a/templates/facturio/base.html b/templates/facturio/base.html index a47513e..7775340 100644 --- a/templates/facturio/base.html +++ b/templates/facturio/base.html @@ -4,14 +4,13 @@ - {# FIXME: this is not translating correctly!! #} Facturio - {% block title %}{% trans "App" %}{% endblock %} {% block head %}{% endblock %} -