Skip to content
Snippets Groups Projects
Commit a44833ba authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#462 - added localization

parent 24bbd5b2
Branches
Tags
No related merge requests found
Pipeline #2058 failed
...@@ -10,7 +10,7 @@ import java.util.List; ...@@ -10,7 +10,7 @@ import java.util.List;
public class DefaultCharts public class DefaultCharts
{ {
private static final Chart CHART_TEST = new Chart("charts.default.test", getChartFromFile("charts/AccountSumPerDay.js"), ChartType.DEFAULT); private static final Chart CHART_TEST = new Chart("charts.default.accountsum", getChartFromFile("charts/AccountSumPerDay.js"), ChartType.DEFAULT);
public static List<Chart> getDefaultCharts() public static List<Chart> getDefaultCharts()
{ {
......
...@@ -52,12 +52,13 @@ var plotlyData = [ ...@@ -52,12 +52,13 @@ var plotlyData = [
]; ];
// Add your Plotly layout settings here (optional) // Add your Plotly layout settings here (optional)
// Note: All variables starting with "localized" are only available inside default charts.
var plotlyLayout = { var plotlyLayout = {
title: { title: {
text: 'Account sum per day', text: localizedTitle,
}, },
yaxis: { yaxis: {
title: 'Sum in €', title: localizedAxisY + localizedCurrency,
rangemode: 'tozero', rangemode: 'tozero',
tickformat: '.2f', tickformat: '.2f',
showline: true showline: true
......
...@@ -325,7 +325,8 @@ hotkeys.search=Suchen ...@@ -325,7 +325,8 @@ hotkeys.search=Suchen
hotkeys.search.key=s hotkeys.search.key=s
# charts # charts
charts.default.test=Test charts.default.accountsum=Kontostand pro Tag
charts.default.accountsum.axis.x=Summe in
charts.default.categories=Eingaben/Ausgaben nach Kategorien charts.default.categories=Eingaben/Ausgaben nach Kategorien
charts.default.month=Eingaben/Ausgaben pro Monat charts.default.month=Eingaben/Ausgaben pro Monat
charts.default.categoryBudget=Verbrauch nach Kategorien charts.default.categoryBudget=Verbrauch nach Kategorien
......
...@@ -325,9 +325,10 @@ hotkeys.search=Search ...@@ -325,9 +325,10 @@ hotkeys.search=Search
hotkeys.search.key=s hotkeys.search.key=s
# charts # charts
charts.default.test=Test charts.default.accountsum=Account sum per day
charts.default.categories=Income/Payments per Category charts.default.accountsum.axis.x=Sum in
charts.default.month=Income/Payments per Month charts.default.categories=Incomes/Expenditures per category
charts.default.month=Income/Expenditures per month
charts.default.categoryBudget=Consumption by categories charts.default.categoryBudget=Consumption by categories
chart.new.label.name=Name chart.new.label.name=Name
......
...@@ -163,6 +163,12 @@ ...@@ -163,6 +163,12 @@
<#if chart??> <#if chart??>
<script> <script>
<#if chart.getType().name() == "DEFAULT">
localizedTitle = "${locale.getString(chart.getName())}";
localizedAxisY = "${locale.getString(chart.getName() + ".axis.x")}";
localizedCurrency = "${settings.getCurrency()}";
</#if>
${chart.getScript()?replace("var transactionData = []", "var transactionData = ${transactionData};")} ${chart.getScript()?replace("var transactionData = []", "var transactionData = ${transactionData};")}
</script> </script>
</#if> </#if>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment