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) {
|
||||
return Labels.getLabel(key);
|
||||
return Labels.getLabel(key) == null ? key : Labels.getLabel(key);
|
||||
}
|
||||
|
||||
private static String getLocalized(String str) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package info.bukova.isspst.reporting;
|
||||
|
||||
import info.bukova.isspst.StringUtils;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -49,7 +51,7 @@ public class DynamicGenerator implements Generator {
|
||||
Class<?> clazz = colClass(col);
|
||||
if (clazz != null) {
|
||||
try {
|
||||
rb.addColumn(col, col, clazz, 30, false);
|
||||
rb.addColumn(StringUtils.localize(col), col, clazz, 30, false);
|
||||
} catch (ColumnBuilderException e) {
|
||||
// TODO Auto-generated catch block
|
||||
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;
|
||||
@WireVariable
|
||||
private ReportDefinition reportDefinition;
|
||||
private LocaleConverter locConverter;
|
||||
|
||||
@Init
|
||||
public void init(@ExecutionArgParam("reports") List<Report> reports,
|
||||
@ExecutionArgParam("data") List<Object> data) {
|
||||
this.reports = reports;
|
||||
this.data = data;
|
||||
locConverter = new LocaleConverter();
|
||||
|
||||
if (data != null && data.size() > 0 && data.get(0).getClass() != reportDefinition.gatDataClass()) {
|
||||
reportDefinition.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public LocaleConverter getLocConverter() {
|
||||
return locConverter;
|
||||
}
|
||||
|
||||
public List<Report> getReports() {
|
||||
return this.reports;
|
||||
}
|
||||
@@ -64,7 +70,9 @@ public class ReportDialogVM {
|
||||
PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
|
||||
List<String> properties = new ArrayList<String>();
|
||||
for (PropertyDescriptor pd : pds) {
|
||||
properties.add(pd.getName());
|
||||
if (!(pd.getName().equals("password") || pd.getName().equals("class") || pd.getName().equals("id") || pd.getName().equals("valid"))) {
|
||||
properties.add(pd.getName());
|
||||
}
|
||||
}
|
||||
ListChecks<String> columns = new ListChecks<String>(reportDefinition.getFieldsToPrint(), properties);
|
||||
|
||||
|
||||
@@ -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
|
||||
ReportReports=Sestavy
|
||||
ReportTitle=Nadpis sestavy:
|
||||
ReportOptions=Volby sestavy
|
||||
|
||||
Error=Chyba
|
||||
ErrorRights=K vykobání této operace nemáte dostatečná oprávnění
|
||||
@@ -17,10 +17,15 @@
|
||||
<name>org.zkoss.web.classWebResource.cache</name>
|
||||
<value>false</value>
|
||||
</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>
|
||||
<addon-uri>/WEB-INF/mapa-lang-addon.xml</addon-uri>
|
||||
<addon-uri>/WEB-INF/ckez-bind-lang-addon.xml</addon-uri>
|
||||
<addon-uri>/WEB-INF/lang-addons/mapa-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>
|
||||
</language-config>
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</hbox>
|
||||
<vbox children="@load(vm.columns.checks)">
|
||||
<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>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
Reference in New Issue
Block a user