From c3e0d3d4c834c718ee9682de5170d677b39018a3 Mon Sep 17 00:00:00 2001
From: Robert Goldmann <deadlocker@gmx.de>
Date: Sun, 14 Oct 2018 17:14:36 +0200
Subject: [PATCH] usability improvements (updated localization; new payment
 switch now defaults to expenditure)

---
 src/main/resources/languages/_de.properties               | 4 ++--
 src/main/resources/languages/_en.properties               | 4 ++--
 .../resources/templates/transactions/newTransaction.ftl   | 8 ++++++--
 .../resources/templates/transactions/transactions.ftl     | 2 +-
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/languages/_de.properties b/src/main/resources/languages/_de.properties
index aba0c7943..ac5facd87 100644
--- a/src/main/resources/languages/_de.properties
+++ b/src/main/resources/languages/_de.properties
@@ -25,8 +25,8 @@ error.database.import.unknown.version=Die hochgeladene JSON Datei enth
 # TITLE
 title.incomes=Einnahmen
 title.income=Einnahme
-title.transactions=Ausgaben
-title.transaction=Ausgabe
+title.expenditures=Expenditures
+title.expenditure=Expenditure
 title.rest=Rest
 title.category=Kategorie
 title.amount=Betrag
diff --git a/src/main/resources/languages/_en.properties b/src/main/resources/languages/_en.properties
index 6e1831d7a..f1f6fd061 100644
--- a/src/main/resources/languages/_en.properties
+++ b/src/main/resources/languages/_en.properties
@@ -25,8 +25,8 @@ error.database.import.unknown.version=The uploaded JSON File does not contain a
 # TITLE
 title.incomes=Incomes
 title.income=Income
-title.transactions=Transactions
-title.transaction=Transaction
+title.expenditures=Expenditures
+title.expenditure=Expenditure
 title.rest=Rest
 title.category=Category
 title.amount=Amount
diff --git a/src/main/resources/templates/transactions/newTransaction.ftl b/src/main/resources/templates/transactions/newTransaction.ftl
index 556226c34..b17d301c0 100644
--- a/src/main/resources/templates/transactions/newTransaction.ftl
+++ b/src/main/resources/templates/transactions/newTransaction.ftl
@@ -29,9 +29,13 @@
                                 <div class="switch">
                                     <label>
                                         ${locale.getString("title.income")}
-                                        <input type="checkbox" name="isPayment" <#if transaction.getAmount()?? && transaction.getAmount() < 0>checked</#if>>
+                                        <#if transaction.getAmount()??>
+                                            <input type="checkbox" name="isPayment" <#if transaction.getAmount() < 0>checked</#if>>
+                                        <#else>
+                                            <input type="checkbox" name="isPayment" checked>
+                                        </#if>
                                         <span class="lever"></span>
-                                        ${locale.getString("title.transaction")}
+                                        ${locale.getString("title.expenditure")}
                                     </label>
                                 </div>
                             </div>
diff --git a/src/main/resources/templates/transactions/transactions.ftl b/src/main/resources/templates/transactions/transactions.ftl
index 139b78751..7765f8d33 100644
--- a/src/main/resources/templates/transactions/transactions.ftl
+++ b/src/main/resources/templates/transactions/transactions.ftl
@@ -25,7 +25,7 @@
                             <div class="icon-block">
                                 <h1 class="center ${redTextColor} budget-headline-icon"><i class="material-icons icon-budget">file_upload</i></h1>
                                 <h5 class="center budget">${helpers.getCurrencyString(paymentSum)}</h5>
-                                <h5 class="center budget-headline">${locale.getString("title.transactions")}</h5>
+                                <h5 class="center budget-headline">${locale.getString("title.expenditures")}</h5>
                             </div>
                         </div>
                         <div class="col s4">
-- 
GitLab