From 120beec92467959759e26efef5456e48ca181f6a Mon Sep 17 00:00:00 2001
From: Robert Goldmann <deadlocker@gmx.de>
Date: Sun, 18 Mar 2018 14:26:45 +0100
Subject: [PATCH] #286 - localized payment and category delete modals

---
 src/main/resources/languages/_de.properties            | 7 ++++---
 src/main/resources/languages/_en.properties            | 5 +++--
 src/main/resources/templates/categories/categories.ftl | 8 ++++----
 src/main/resources/templates/payments/payments.ftl     | 8 ++++----
 4 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/src/main/resources/languages/_de.properties b/src/main/resources/languages/_de.properties
index aa8125e4b..71f48a474 100644
--- a/src/main/resources/languages/_de.properties
+++ b/src/main/resources/languages/_de.properties
@@ -69,6 +69,7 @@ chart.categories.title.payments=Ausgaben nach Kategorien
 ok=OK
 cancel=Abbrechen
 save=Speichern
+delete=L�schen
 home.placeholder=Keine Daten verf�gbar
 home.budget=von {0} verbleibend
 payments.placeholder=Keine Daten verf�gbar
@@ -132,9 +133,9 @@ notification.no.update.available=Kein Update verf
 
 # INFO
 info.title.category.delete=Kategorie l�schen
-info.text.category.delete=M�chtest du diese Kategorie wirklich unwiderruflich l�schen?
-info.title.payment.delete=Zahlung l�schen
-info.text.payment.delete=M�chtest du diese Zahlung wirklich unwiderruflich l�schen?
+info.text.category.delete=M�chtest du die Kategorie "{0}" wirklich unwiderruflich l�schen?
+info.title.payment.delete=Buchung l�schen
+info.text.payment.delete=M�chtest du die Buchung "{0}" wirklich unwiderruflich l�schen?
 info.text.payment.repeating.delete=Es handelt sich um eine wiederkehrende Zahlung. Welche Zahlungen sollen gel�scht werden?
 info.text.payment.repeating.delete.all=Alle
 info.text.payment.repeating.delete.futures=Alle zuk�nftigen
diff --git a/src/main/resources/languages/_en.properties b/src/main/resources/languages/_en.properties
index 2a594be9d..13c7e7242 100644
--- a/src/main/resources/languages/_en.properties
+++ b/src/main/resources/languages/_en.properties
@@ -69,6 +69,7 @@ chart.categories.title.payments=Payments by Categories
 ok=OK
 cancel=Cancel
 save=Save
+delete=Delete
 home.placeholder=No data available
 home.budget=of {0} remaining
 payments.placeholder=No data available
@@ -132,9 +133,9 @@ notification.no.update.available=No update available.
 
 # INFO
 info.title.category.delete=Delete Category
-info.text.category.delete=Do you really want to delete this category? This can't be undone.
+info.text.category.delete=Do you really want to delete the category "{0}"? This can't be undone.
 info.title.payment.delete=Delete Entry
-info.text.payment.delete=Do you really want to delete this entry? This can't be undone.
+info.text.payment.delete=Do you really want to delete the entry "{0}"? This can't be undone.
 info.text.payment.repeating.delete=The entry you want to delete is a repeating entry. What entries should be deleted?
 info.text.payment.repeating.delete.all=All Entries
 info.text.payment.repeating.delete.futures=Future Entries
diff --git a/src/main/resources/templates/categories/categories.ftl b/src/main/resources/templates/categories/categories.ftl
index c9bdc81c7..e07b4b307 100644
--- a/src/main/resources/templates/categories/categories.ftl
+++ b/src/main/resources/templates/categories/categories.ftl
@@ -47,12 +47,12 @@
                 <!-- confirm delete modal -->
                 <div id="modalConfirmDelete" class="modal">
                     <div class="modal-content">
-                        <h4>Kategorie löschen</h4>
-                        <p>Möchtest du die Kategorie "${currentCategory.name}" wirklich löschen?</p>
+                        <h4>${locale.getString("info.title.category.delete")}</h4>
+                        <p>${locale.getString("info.text.category.delete", currentCategory.name)}</p>
                     </div>
                     <div class="modal-footer">
-                        <a href="/categories" class="modal-action modal-close waves-effect waves-red btn-flat ">Abbrechen</a>
-                        <a href="/categories/${currentCategory.ID}/delete" class="modal-action modal-close waves-effect waves-green btn-flat ">Löschen</a>
+                        <a href="/categories" class="modal-action modal-close waves-effect waves-red btn-flat ">${locale.getString("cancel")}</a>
+                        <a href="/categories/${currentCategory.ID}/delete" class="modal-action modal-close waves-effect waves-green btn-flat ">${locale.getString("delete")}</a>
                     </div>
                 </div>
             </#if>
diff --git a/src/main/resources/templates/payments/payments.ftl b/src/main/resources/templates/payments/payments.ftl
index a4b1efbe1..2b3577362 100644
--- a/src/main/resources/templates/payments/payments.ftl
+++ b/src/main/resources/templates/payments/payments.ftl
@@ -56,12 +56,12 @@
                 <!-- confirm delete modal -->
                 <div id="modalConfirmDelete" class="modal">
                     <div class="modal-content">
-                        <h4>Buchung löschen</h4>
-                        <p>Möchtest du die Buchung "${currentPayment.name}" wirklich löschen?</p>
+                        <h4>${locale.getString("info.title.payment.delete")}</h4>
+                        <p>${locale.getString("info.text.payment.delete", currentPayment.name)}</p>
                     </div>
                     <div class="modal-footer">
-                        <a href="/payments" class="modal-action modal-close waves-effect waves-red btn-flat ">Abbrechen</a>
-                        <a href="/payments/${currentPayment.ID}/delete" class="modal-action modal-close waves-effect waves-green btn-flat ">Löschen</a>
+                        <a href="/payments" class="modal-action modal-close waves-effect waves-red btn-flat ">${locale.getString("cancel")}</a>
+                        <a href="/payments/${currentPayment.ID}/delete" class="modal-action modal-close waves-effect waves-green btn-flat ">${locale.getString("delete")}</a>
                     </div>
                 </div>
             </#if>
-- 
GitLab