ItEr34S15ArquitecturaServidorItEr33S13: Added I18nHelper in navalplanner-gantt-zk
This commit is contained in:
parent
d7ac9886f4
commit
8bb31127c4
4 changed files with 76 additions and 13 deletions
|
|
@ -18,7 +18,7 @@
|
|||
<groupId>org.xnap.commons</groupId>
|
||||
<artifactId>maven-gettext-plugin</artifactId>
|
||||
<configuration>
|
||||
<targetBundle>i18n.Messages</targetBundle>
|
||||
<targetBundle>app.i18n.Messages</targetBundle>
|
||||
<poDirectory>${project.build.sourceDirectory}/../resources/i18n</poDirectory>
|
||||
<keywords>-k_</keywords>
|
||||
</configuration>
|
||||
|
|
|
|||
72
ganttzk/src/main/java/org/zkoss/ganttz/i18n/I18nHelper.java
Normal file
72
ganttzk/src/main/java/org/zkoss/ganttz/i18n/I18nHelper.java
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* This file is part of ###PROJECT_NAME###
|
||||
*
|
||||
* Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.zkoss.ganttz.i18n;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.xnap.commons.i18n.I18n;
|
||||
import org.xnap.commons.i18n.I18nFactory;
|
||||
import org.zkoss.util.Locales;
|
||||
|
||||
|
||||
public class I18nHelper {
|
||||
|
||||
private static HashMap<Locale, I18n> localesCache = new HashMap<Locale, I18n>();
|
||||
|
||||
public static I18n getI18n() {
|
||||
if (localesCache.keySet().contains(Locales.getCurrent())) {
|
||||
return localesCache.get(Locales.getCurrent());
|
||||
}
|
||||
|
||||
I18n i18n = I18nFactory.getI18n(I18nHelper.class, "app.i18n.Messages", Locales.getCurrent(),
|
||||
org.xnap.commons.i18n.I18nFactory.FALLBACK);
|
||||
localesCache.put(Locales.getCurrent(), i18n);
|
||||
|
||||
return i18n;
|
||||
}
|
||||
|
||||
public static String _(String str) {
|
||||
return getI18n().tr(str);
|
||||
}
|
||||
|
||||
public static String _(String text, Object o1) {
|
||||
return getI18n().tr(text, o1);
|
||||
}
|
||||
|
||||
public static String _(String text, Object o1, Object o2) {
|
||||
return getI18n().tr(text, o1, o2);
|
||||
}
|
||||
|
||||
public static String _(String text, Object o1, Object o2, Object o3) {
|
||||
return getI18n().tr(text, o1, o2, o3);
|
||||
}
|
||||
|
||||
public static String _(String text, Object o1, Object o2, Object o3,
|
||||
Object o4) {
|
||||
return getI18n().tr(text, o1, o2, o3, o4);
|
||||
}
|
||||
|
||||
public static String _(String text, Object[] objects) {
|
||||
return getI18n().tr(text, objects);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -18,6 +18,9 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?xel-method prefix="i18n" name="_" class="org.zkoss.ganttz.i18n.I18nHelper"
|
||||
signature="java.lang.String _(java.lang.String name)" ?>
|
||||
|
||||
<zk xmlns:n="http://www.zkoss.org/2005/zk/native">
|
||||
<zscript><![CDATA[
|
||||
resourcesLoadPanel = self;
|
||||
|
|
|
|||
|
|
@ -2192,15 +2192,3 @@ msgstr "Borrar"
|
|||
msgid ""
|
||||
"The date is not valid, the date must be unique for this advanced assignment"
|
||||
msgstr "La fecha no es válida, debe ser única para esta asignación de avance"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "The Spread values are not valid, there are several true spread values"
|
||||
#~ msgstr ""
|
||||
#~ "Los valores de propagación no son válidos, hay varios valores activados"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Filters:"
|
||||
#~ msgstr "Filtro"
|
||||
|
||||
#~ msgid "Planification"
|
||||
#~ msgstr "Planificación"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue