Updated translations

This commit is contained in:
Edgar P. Burkhart 2022-12-19 11:19:22 +01:00
parent edf6ae0584
commit e6e7fa328a
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
7 changed files with 162 additions and 102 deletions

View File

@ -3,12 +3,11 @@
# This file is distributed under the same license as the nummi package.
# edpibu <git@edgarpierre.fr>, 2022.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-30 19:19+0200\n"
"POT-Creation-Date: 2022-12-19 11:17+0100\n"
"PO-Revision-Date: 2022-05-30 19:00+0200\n"
"Last-Translator: edpibu <git@edgarpierre.fr>\n"
"Language-Team: edpibu <git@edgarpierre.fr>\n"
@ -18,89 +17,119 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: main/templates/main/base.html:30 main/templates/main/category.html:22
#: main/templates/main/index.html:16 main/templates/main/index.html:27
#: main/templates/main/snapshot.html:87
#: main/templates/main/transactions.html:13
msgid "Transactions"
msgstr ""
#: main/templates/main/base.html:35
msgid "Add transaction"
msgstr "Nouvelle transaction"
#: main/templates/main/base.html:40
msgid "Add category"
msgstr "Nouvelle catégorie"
#: main/templates/main/base.html:45
msgid "Add snapshot"
msgstr "Nouveau relevé"
#: main/templates/main/base.html:50
msgid "Log Out"
msgstr "Se déconnecter"
#: main/templates/main/index.html:21
#, fuzzy
#| msgid "Add snapshot"
msgid "Snapshots"
msgstr "Nouveau relevé"
#: main/templates/main/index.html:24
#: main/templates/main/tag/transaction_table.html:6
msgid "Date"
msgstr "Date"
#: main/templates/main/index.html:25
#: main/templates/main/tag/transaction_table.html:8
msgid "Value"
msgstr "Valeur"
#: main/templates/main/index.html:26
msgid "Difference"
msgstr "Différence"
#: main/templates/main/index.html:28
msgid "Valid"
msgstr "Valide"
#: main/templates/main/index.html:59 main/templates/main/snapshot.html:33
msgid "Categories"
msgstr "Catégories"
#: main/templates/main/login.html:12
#, fuzzy
#| msgid "Log Out"
msgid "Log In"
msgstr "Se connecter"
#: main/templates/main/tag/form_buttons.html:6
msgid "Delete"
msgstr "Supprimer"
#: main/templates/main/tag/form_buttons.html:13
msgid "Save"
msgstr "Enregistrer"
#: main/templates/main/tag/transaction_table.html:7
msgid "Name"
msgstr "Nom"
#: main/templates/main/tag/transaction_table.html:9
msgid "Trader"
msgstr "Commerçant"
#: main/templates/main/tag/transaction_table.html:10
#, fuzzy
#| msgid "Add category"
#: .\main\models.py:13 .\main\models.py:22 .\main\models.py:56
#: .\main\templates\main\tag\transaction_table.html:10
msgid "Category"
msgstr "Catégorie"
#: main/templates/main/tag/transaction_table.html:11
#: .\main\models.py:13 .\main\models.py:37 .\main\models.py:91
#: .\main\templates\main\tag\transaction_table.html:7
msgid "Name"
msgstr "Nom"
#: .\main\models.py:15
msgid "Icon"
msgstr "Icône"
#: .\main\models.py:23 .\main\templates\main\index.html:57
#: .\main\templates\main\snapshot.html:33
msgid "Categories"
msgstr "Catégories"
#: .\main\models.py:37 .\main\models.py:67
msgid "Transaction"
msgstr "Transaction"
#: .\main\models.py:39 .\main\templates\main\tag\transaction_table.html:11
msgid "Description"
msgstr "Description"
#: main/templates/main/transaction.html:23
msgid "Invoices"
#: .\main\models.py:41 .\main\models.py:125 .\main\templates\main\index.html:23
#: .\main\templates\main\tag\transaction_table.html:8
msgid "Value"
msgstr "Valeur"
#: .\main\models.py:43 .\main\models.py:123 .\main\templates\main\index.html:22
#: .\main\templates\main\tag\transaction_table.html:6
msgid "Date"
msgstr "Date"
#: .\main\models.py:44
msgid "Real date"
msgstr "Date réelle"
#: .\main\models.py:46 .\main\templates\main\tag\transaction_table.html:9
msgid "Trader"
msgstr "Commerçant"
#: .\main\models.py:49
msgid "Payment"
msgstr "Paiement"
#: .\main\models.py:68 .\main\templates\main\base.html:30
#: .\main\templates\main\category.html:22 .\main\templates\main\index.html:14
#: .\main\templates\main\index.html:25 .\main\templates\main\snapshot.html:87
#: .\main\templates\main\transactions.html:13
msgid "Transactions"
msgstr "Transactions"
#: .\main\models.py:91 .\main\models.py:108
msgid "Invoice"
msgstr "Facture"
#: .\main\models.py:96
msgid "File"
msgstr "Fichier"
#: .\main\models.py:109 .\main\templates\main\transaction.html:23
msgid "Invoices"
msgstr "Factures"
#: .\main\models.py:217
msgid "Snapshot"
msgstr "Relevé"
#: .\main\models.py:218 .\main\templates\main\index.html:19
msgid "Snapshots"
msgstr "Relevés"
#: .\main\templates\main\base.html:35
msgid "New transaction"
msgstr "Nouvelle transaction"
#: .\main\templates\main\base.html:40
msgid "New category"
msgstr "Nouvelle catégorie"
#: .\main\templates\main\base.html:45
msgid "New snapshot"
msgstr "Nouveau relevé"
#: .\main\templates\main\index.html:24
msgid "Difference"
msgstr "Différence"
#: .\main\templates\main\index.html:26
msgid "Valid"
msgstr "Valide"
#: .\main\templates\main\login.html:12 .\main\templates\main\login.html:24
msgid "Log In"
msgstr "Se connecter"
#: .\main\templates\main\tag\form_buttons.html:4
#: .\main\templates\main\transaction.html:29
msgid "Delete"
msgstr "Supprimer"
#: .\main\templates\main\tag\form_buttons.html:14
msgid "Save"
msgstr "Enregistrer"
#: .\main\templates\main\transaction.html:36
msgid "Add invoice"
msgstr "Ajouter une facture"
#: .\main\templates\main\transaction.html:41
msgid "Add"
msgstr "Ajouter"

View File

@ -3,18 +3,24 @@ import uuid
from django.db import models
from django.forms import ModelForm
from django.core.validators import FileExtensionValidator
from django.utils.text import lazy
from django.utils.translation import gettext_lazy as _
class Category(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=64, default="New Category")
icon = models.CharField(max_length=64, default="folder")
name = models.CharField(
max_length=64, default=_("Category"), verbose_name=_("Name")
)
icon = models.CharField(max_length=64, default="folder", verbose_name=_("Icon"))
def __str__(self):
return self.name
return str(self.name)
class Meta:
ordering = ["name"]
verbose_name = _("Category")
verbose_name_plural = _("Categories")
class CategoryForm(ModelForm):
@ -27,15 +33,27 @@ class CategoryForm(ModelForm):
class Transaction(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=256, default="New Transaction")
description = models.TextField(null=True, blank=True)
value = models.DecimalField(max_digits=12, decimal_places=2, default=0)
date = models.DateField(default=date.today)
real_date = models.DateField(blank=True, null=True)
trader = models.CharField(max_length=128, blank=True, null=True)
payment = models.CharField(max_length=128, blank=True, null=True)
name = models.CharField(
max_length=256, default=_("Transaction"), verbose_name=_("Name")
)
description = models.TextField(null=True, blank=True, verbose_name=_("Description"))
value = models.DecimalField(
max_digits=12, decimal_places=2, default=0, verbose_name=_("Value")
)
date = models.DateField(default=date.today, verbose_name=_("Date"))
real_date = models.DateField(blank=True, null=True, verbose_name=_("Real date"))
trader = models.CharField(
max_length=128, blank=True, null=True, verbose_name=_("Trader")
)
payment = models.CharField(
max_length=128, blank=True, null=True, verbose_name=_("Payment")
)
category = models.ForeignKey(
Category, on_delete=models.SET_NULL, blank=True, null=True
Category,
on_delete=models.SET_NULL,
blank=True,
null=True,
verbose_name=_("Category"),
)
def __str__(self):
@ -46,6 +64,8 @@ class Transaction(models.Model):
class Meta:
ordering = ["-date"]
verbose_name = _("Transaction")
verbose_name_plural = _("Transactions")
class TransactionForm(ModelForm):
@ -67,9 +87,13 @@ class TransactionForm(ModelForm):
class Invoice(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=256, default="New Invoice")
name = models.CharField(
max_length=256, default=_("Invoice"), verbose_name=_("Name")
)
file = models.FileField(
upload_to="invoices/", validators=[FileExtensionValidator(["pdf"])]
upload_to="invoices/",
validators=[FileExtensionValidator(["pdf"])],
verbose_name=_("File"),
)
transaction = models.ForeignKey(Transaction, on_delete=models.CASCADE)
@ -80,6 +104,10 @@ class Invoice(models.Model):
self.file.delete()
super().delete(*args, **kwargs)
class Meta:
verbose_name = _("Invoice")
verbose_name_plural = _("Invoices")
class InvoiceForm(ModelForm):
template_name = "main/form.html"
@ -92,8 +120,10 @@ class InvoiceForm(ModelForm):
class Snapshot(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
date = models.DateField(unique=True)
value = models.DecimalField(max_digits=12, decimal_places=2, default=0)
date = models.DateField(unique=True, verbose_name=_("Date"))
value = models.DecimalField(
max_digits=12, decimal_places=2, default=0, verbose_name=_("Value")
)
previous = models.OneToOneField(
"self", on_delete=models.SET_NULL, blank=True, null=True, editable=False
)
@ -184,6 +214,8 @@ class Snapshot(models.Model):
class Meta:
ordering = ["-date"]
verbose_name = _("Snapshot")
verbose_name_plural = _("Snapshots")
class SnapshotForm(ModelForm):

View File

@ -21,7 +21,7 @@
<div class="buttons">
<input hidden value="{{ next }}" name="next" />
<input type="reset" />
<input type="submit" value="Log In" />
<input type="submit" value="{% translate "Log In" %}" />
</div>
</form>

View File

@ -11,5 +11,5 @@
{% endif %}
<input type="reset" />
<input type="submit" value="{% translate 'Save' %} {{ name }}" />
<input type="submit" value="{% translate 'Save' %}" />
</div>

View File

@ -26,18 +26,18 @@
<div class="invoice">
<a href="{% url 'invoice' inv.id %}">{{ inv.name }}</a>
<a href="{% url 'del_invoice' transaction.id inv.id %}"
onclick="return confirm('Supprimer <{{ inv.name }}> ?')">
onclick="return confirm('{% translate "Delete" %} <{{ inv.name }}> ?')">
<i class="fa-regular fa-trash-can"></i>
</a>
</div>
{% endfor %}
</div>
<h3>Add Invoice</h3>
<h3>{% translate "Add invoice" %}</h3>
<form action="{% url 'transaction' transaction.id %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<input type="hidden" name="form" value="invoice" />
{{ invoice_form }}
<div class="buttons"><input class="btn" type="submit" value="Add Invoice" /></div>
<div class="buttons"><input class="btn" type="submit" value="{% translate "Add" %}" /></div>
</form>
{% endblock %}

View File

@ -39,6 +39,5 @@ def form_buttons(instance):
return {
"instance": instance,
"adding": instance._state.adding,
"name": instance.__class__.__name__,
"del_url": f"del_{instance.__class__.__name__.lower()}",
}