Načítání názvů pro sestavy z properties souboru.
Properties soubory byly přesunuty do WEB-INF/locales, přesunuty lang addony do WEB-INF/lang-addons. closes #79
This commit is contained in:
@@ -28,7 +28,7 @@ public class StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String localize(String key) {
|
public static String localize(String key) {
|
||||||
return Labels.getLabel(key);
|
return Labels.getLabel(key) == null ? key : Labels.getLabel(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getLocalized(String str) {
|
private static String getLocalized(String str) {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package info.bukova.isspst.reporting;
|
package info.bukova.isspst.reporting;
|
||||||
|
|
||||||
|
import info.bukova.isspst.StringUtils;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -49,7 +51,7 @@ public class DynamicGenerator implements Generator {
|
|||||||
Class<?> clazz = colClass(col);
|
Class<?> clazz = colClass(col);
|
||||||
if (clazz != null) {
|
if (clazz != null) {
|
||||||
try {
|
try {
|
||||||
rb.addColumn(col, col, clazz, 30, false);
|
rb.addColumn(StringUtils.localize(col), col, clazz, 30, false);
|
||||||
} catch (ColumnBuilderException e) {
|
} catch (ColumnBuilderException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package info.bukova.isspst.ui;
|
||||||
|
|
||||||
|
import info.bukova.isspst.StringUtils;
|
||||||
|
|
||||||
|
import org.zkoss.bind.BindContext;
|
||||||
|
import org.zkoss.bind.Converter;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
|
||||||
|
public class LocaleConverter implements Converter<String, String, Component> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String coerceToBean(String str, Component component, BindContext ctx) {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String coerceToUi(String str, Component component, BindContext ctx) {
|
||||||
|
return StringUtils.localize(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -27,18 +27,24 @@ public class ReportDialogVM {
|
|||||||
private List<Object> data;
|
private List<Object> data;
|
||||||
@WireVariable
|
@WireVariable
|
||||||
private ReportDefinition reportDefinition;
|
private ReportDefinition reportDefinition;
|
||||||
|
private LocaleConverter locConverter;
|
||||||
|
|
||||||
@Init
|
@Init
|
||||||
public void init(@ExecutionArgParam("reports") List<Report> reports,
|
public void init(@ExecutionArgParam("reports") List<Report> reports,
|
||||||
@ExecutionArgParam("data") List<Object> data) {
|
@ExecutionArgParam("data") List<Object> data) {
|
||||||
this.reports = reports;
|
this.reports = reports;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
locConverter = new LocaleConverter();
|
||||||
|
|
||||||
if (data != null && data.size() > 0 && data.get(0).getClass() != reportDefinition.gatDataClass()) {
|
if (data != null && data.size() > 0 && data.get(0).getClass() != reportDefinition.gatDataClass()) {
|
||||||
reportDefinition.clear();
|
reportDefinition.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocaleConverter getLocConverter() {
|
||||||
|
return locConverter;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Report> getReports() {
|
public List<Report> getReports() {
|
||||||
return this.reports;
|
return this.reports;
|
||||||
}
|
}
|
||||||
@@ -64,8 +70,10 @@ public class ReportDialogVM {
|
|||||||
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
|
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
|
||||||
List<String> properties = new ArrayList<String>();
|
List<String> properties = new ArrayList<String>();
|
||||||
for (PropertyDescriptor pd : pds) {
|
for (PropertyDescriptor pd : pds) {
|
||||||
|
if (!(pd.getName().equals("password") || pd.getName().equals("class") || pd.getName().equals("id") || pd.getName().equals("valid"))) {
|
||||||
properties.add(pd.getName());
|
properties.add(pd.getName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ListChecks<String> columns = new ListChecks<String>(reportDefinition.getFieldsToPrint(), properties);
|
ListChecks<String> columns = new ListChecks<String>(reportDefinition.getFieldsToPrint(), properties);
|
||||||
|
|
||||||
return columns;
|
return columns;
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#Obecné
|
||||||
|
created=Vytvořeno
|
||||||
|
ownedBy=Vytvořil
|
||||||
|
modified=Změněno
|
||||||
|
modifiedBy=Změnil
|
||||||
|
|
||||||
|
#Adresa
|
||||||
|
city=Město
|
||||||
|
company=Firma
|
||||||
|
contactName=Kontaktní osoba
|
||||||
|
department=Oddělení
|
||||||
|
description=Poznámka
|
||||||
|
dic=DIČ
|
||||||
|
email=E-mail
|
||||||
|
houseNumber=Číslo domu
|
||||||
|
ic=IČ
|
||||||
|
phone=Telefon
|
||||||
|
state=Stát
|
||||||
|
street=Ulice
|
||||||
|
web=Webová adresa
|
||||||
|
zipCode=PSČ
|
||||||
|
|
||||||
|
#Budova
|
||||||
|
code=Kód
|
||||||
|
name=Název
|
||||||
|
|
||||||
|
#Uživatel
|
||||||
|
accountNonExpired=Platný
|
||||||
|
accountNonLocked=Odemknutý
|
||||||
|
authorities=Role
|
||||||
|
credentialsNonExpired=Heslo je platné
|
||||||
|
enabled=Povolený
|
||||||
|
firstName=Jméno
|
||||||
|
fullName=Plné jméno
|
||||||
|
lastName=Příjmení
|
||||||
|
notify=Posílat oznámení
|
||||||
|
personalNumber=Osobní číslo
|
||||||
|
username=Uživatelské jméno
|
||||||
+1
@@ -77,6 +77,7 @@ ReportSend=Odeslat
|
|||||||
ReportPrint=Tisk
|
ReportPrint=Tisk
|
||||||
ReportReports=Sestavy
|
ReportReports=Sestavy
|
||||||
ReportTitle=Nadpis sestavy:
|
ReportTitle=Nadpis sestavy:
|
||||||
|
ReportOptions=Volby sestavy
|
||||||
|
|
||||||
Error=Chyba
|
Error=Chyba
|
||||||
ErrorRights=K vykobání této operace nemáte dostatečná oprávnění
|
ErrorRights=K vykobání této operace nemáte dostatečná oprávnění
|
||||||
@@ -18,9 +18,14 @@
|
|||||||
<value>false</value>
|
<value>false</value>
|
||||||
</library-property>
|
</library-property>
|
||||||
|
|
||||||
|
<system-config>
|
||||||
|
<label-location>/WEB-INF/locales/zk-label.properties</label-location>
|
||||||
|
<label-location>/WEB-INF/locales/columns.properties</label-location>
|
||||||
|
</system-config>
|
||||||
|
|
||||||
<language-config>
|
<language-config>
|
||||||
<addon-uri>/WEB-INF/mapa-lang-addon.xml</addon-uri>
|
<addon-uri>/WEB-INF/lang-addons/mapa-lang-addon.xml</addon-uri>
|
||||||
<addon-uri>/WEB-INF/ckez-bind-lang-addon.xml</addon-uri>
|
<addon-uri>/WEB-INF/lang-addons/ckez-bind-lang-addon.xml</addon-uri>
|
||||||
<addon-uri>/WEB-INF/lang-addons/CzechSortListheader.xml</addon-uri>
|
<addon-uri>/WEB-INF/lang-addons/CzechSortListheader.xml</addon-uri>
|
||||||
</language-config>
|
</language-config>
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</hbox>
|
</hbox>
|
||||||
<vbox children="@load(vm.columns.checks)">
|
<vbox children="@load(vm.columns.checks)">
|
||||||
<template name="children">
|
<template name="children">
|
||||||
<checkbox label="@load(each.member)" checked="@bind(each.checked)"/>
|
<checkbox label="@load(each.member) @converter(vm.locConverter)" checked="@bind(each.checked)"/>
|
||||||
</template>
|
</template>
|
||||||
</vbox>
|
</vbox>
|
||||||
</groupbox>
|
</groupbox>
|
||||||
|
|||||||
Reference in New Issue
Block a user