updated translations
This commit is contained in:
		
							parent
							
								
									5c7c770402
								
							
						
					
					
						commit
						8c8a3bd47a
					
				
					 9 changed files with 59 additions and 228 deletions
				
			
		|  | @ -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') | ||||
|  |  | |||
|  | @ -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)) | ||||
|  |  | |||
|  | @ -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 | ||||
| 
 | ||||
|  |  | |||
|  | @ -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') | ||||
|  |  | |||
|  | @ -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): | ||||
|  |  | |||
|  | @ -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 <EMAIL@ADDRESS>\n" | ||||
| "Language-Team: LANGUAGE <LL@li.org>\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" | ||||
|  |  | |||
|  | @ -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') | ||||
|  |  | |||
|  | @ -4,14 +4,13 @@ | |||
| <head> | ||||
|     <meta charset="UTF-8"> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||||
|     {# FIXME: this is not translating correctly!! #} | ||||
|     <title>Facturio - {% block title %}{% trans "App" %}{% endblock %}</title> | ||||
|     <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" | ||||
|           integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> | ||||
|     {% block head %}{% endblock %} | ||||
| </head> | ||||
| <body> | ||||
| <nav class="navbar navbar-expand-md navbar-dark bg-primary"> | ||||
| <nav class="navbar sticky-top navbar-expand-md navbar-dark bg-primary"> | ||||
|     <div class="container-fluid"> | ||||
|         <a class="navbar-brand" href="{% url "main-page" %}">Facturio</a> | ||||
|         {% if request.user.is_authenticated %} | ||||
|  | @ -36,7 +35,6 @@ | |||
|                         <a class="nav-link" href="{% url 'accounts:logout' %}">{% trans "Logout" %}</a> | ||||
|                     </li> | ||||
|                 {% else %} | ||||
|                     {# FIXME: this is not translating correctly!! #} | ||||
|                     <li class="nav-item"> | ||||
|                         <a class="nav-link" href="{% url 'accounts:login' %}">{% trans "Login" %}</a> | ||||
|                     </li> | ||||
|  |  | |||
|  | @ -1,191 +0,0 @@ | |||
| <!DOCTYPE html> | ||||
| <html lang="cs"> | ||||
| <head> | ||||
|     <meta charset="UTF-8"/> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||||
|     <title>Faktura</title> | ||||
|     <style> | ||||
|         @import url("https://fonts.googleapis.com/css2?family=Ubuntu&display=swap"); | ||||
| 
 | ||||
|         :root { | ||||
|             --font-family: "Ubuntu", sans-serif; | ||||
|             --main-color: #333; | ||||
|             --secondary-color: #888; | ||||
|             --border-color: #ddd; | ||||
|             --background-color: #fff; | ||||
|         } | ||||
| 
 | ||||
|         body { | ||||
|             font-family: var(--font-family), sans-serif; | ||||
|             margin: 20px; | ||||
|             color: var(--main-color); | ||||
|             background-color: var(--background-color); | ||||
|         } | ||||
| 
 | ||||
|         header { | ||||
|             text-align: left; | ||||
|             margin-bottom: 20px; | ||||
|         } | ||||
| 
 | ||||
|         .parties ul { | ||||
|             list-style-type: none; | ||||
|             padding: 0; | ||||
|             margin: 0; | ||||
|         } | ||||
| 
 | ||||
|         .parties li { | ||||
|             margin-top: 5px; | ||||
|         } | ||||
| 
 | ||||
|         .parties h2 { | ||||
|             border-bottom: 1px solid var(--border-color); | ||||
|             padding-bottom: 8px; | ||||
|             font-size: 1.2rem; | ||||
|         } | ||||
| 
 | ||||
|         .invoice-id { | ||||
|             color: var(--secondary-color); | ||||
|         } | ||||
| 
 | ||||
|         #invoice { | ||||
|             border-collapse: collapse; | ||||
|             width: 100%; | ||||
|         } | ||||
| 
 | ||||
|         #invoice th, | ||||
|         #invoice td { | ||||
|             padding: 12px; | ||||
|             text-align: left; | ||||
|             border-bottom: 1px solid var(--border-color); | ||||
|         } | ||||
| 
 | ||||
|         .invoice-total { | ||||
|             margin-top: 20px; | ||||
|             text-align: right; | ||||
|         } | ||||
| 
 | ||||
|         .parties-section { | ||||
|             display: flex; | ||||
|             justify-content: space-between; | ||||
|             margin-bottom: 20px; | ||||
|         } | ||||
| 
 | ||||
|         .parties { | ||||
|             width: 48%; | ||||
|         } | ||||
| 
 | ||||
|         #invoice tbody tr { | ||||
|             border-bottom: 1px solid var(--border-color); | ||||
|         } | ||||
| 
 | ||||
|         .small-col { | ||||
|             width: 5%; | ||||
|         } | ||||
| 
 | ||||
|         .medium-col { | ||||
|             width: 15%; | ||||
|         } | ||||
| 
 | ||||
|         .big-col { | ||||
|             width: 25%; | ||||
|         } | ||||
| 
 | ||||
|         .right-align { | ||||
|             text-align: right; | ||||
|         } | ||||
| 
 | ||||
|         footer { | ||||
|             position: fixed; | ||||
|             bottom: 0; | ||||
|             width: 100%; | ||||
|             text-align: center; | ||||
|             left: 0; | ||||
|             right: 0; | ||||
|             padding: 0; | ||||
|             margin-top: 20px; | ||||
|             color: var(--main-color); | ||||
|             background-color: var(--background-color); | ||||
|         } | ||||
| 
 | ||||
|         @media print { | ||||
|             @page { | ||||
|                 size: auto; | ||||
|                 margin: 0; | ||||
|             } | ||||
| 
 | ||||
|             body { | ||||
|                 margin: 10mm 10mm; | ||||
|             } | ||||
|         } | ||||
|     </style> | ||||
| </head> | ||||
| <body> | ||||
| <header> | ||||
|     <h1>Faktura <span class="invoice-id">2023-0001</span></h1> | ||||
| </header> | ||||
| 
 | ||||
| <section class="parties-section"> | ||||
|     <div class="parties"> | ||||
|         <h2>Dodavatel</h2> | ||||
|         <ul> | ||||
|             <li>Název Vaší společnosti nebo jméno</li> | ||||
|             <li>Vaše adresa</li> | ||||
|             <li>Vaše město, PSČ</li> | ||||
|             <p></p> | ||||
|             <li>IČO: 123456789</li> | ||||
|             <li>DIČ: CZ123456789 jestli jste plátce DPH</li> | ||||
|             <p></p> | ||||
|             <li>Bankovní účet: 123-456789</li> | ||||
|         </ul> | ||||
|     </div> | ||||
| 
 | ||||
|     <div class="parties"> | ||||
|         <h2>Odběratel</h2> | ||||
|         <ul> | ||||
|             <li>Název společnosti nebo jméno zákazníka</li> | ||||
|             <li>Adresa zákazníka</li> | ||||
|             <li>Město zákazníka, PSČ</li> | ||||
|             <p></p> | ||||
|             <li>IČO zákazníka: 987654321</li> | ||||
|             <li>DIČ zákazníka: CZ987654321 jestli je plátce DPH</li> | ||||
|             <p></p> | ||||
|             <li><strong>Datum vystavení:</strong> 16. prosince 2023</li> | ||||
|             <li><strong>Datum splatnosti:</strong> 16. prosince 2023</li> | ||||
|         </ul> | ||||
|     </div> | ||||
| </section> | ||||
| 
 | ||||
| <section> | ||||
|     <h2>Detaily faktury</h2> | ||||
|     <table id="invoice"> | ||||
|         <thead> | ||||
|         <tr> | ||||
|             <th class="small-col">Počet</th> | ||||
|             <th class="small-col">Jednotka</th> | ||||
|             <th class="big-col">Popis položky</th> | ||||
|             <th class="medium-col right-align">Cena za MJ</th> | ||||
|             <th class="medium-col right-align">Celkem</th> | ||||
|         </tr> | ||||
|         </thead> | ||||
|         <tbody> | ||||
|         <tr> | ||||
|             <td>1</td> | ||||
|             <td>ks</td> | ||||
|             <td>Položka 1</td> | ||||
|             <td class="right-align">50,00 Kč</td> | ||||
|             <td class="right-align">50,00 Kč</td> | ||||
|         </tr> | ||||
|         </tbody> | ||||
|     </table> | ||||
| 
 | ||||
|     <div class="invoice-total"> | ||||
|         <p><strong>Celkem: 100,00 Kč</strong></p> | ||||
|     </div> | ||||
| </section> | ||||
| 
 | ||||
| <footer> | ||||
|     <p>Fyzická osoba zapsaná v živnostenském rejstříku.</p> | ||||
|     <p>Fakturu vygenerovala aplikace Facturio</p> | ||||
| </footer> | ||||
| </body> | ||||
| </html> | ||||
		Reference in a new issue