[vosao] r1198 committed - French

0 views
Skip to first unread message

vo...@googlecode.com

unread,
May 13, 2015, 4:03:50 PM5/13/15
to vosao-cms-n...@googlegroups.com
Revision: 1198
Author: emili...@gmail.com
Date: Wed May 13 20:03:29 2015 UTC
Log: French
https://code.google.com/p/vosao/source/detail?r=1198

Modified:
/trunk/api/src/main/java/org/vosao/i18n/Messages.java

=======================================
--- /trunk/api/src/main/java/org/vosao/i18n/Messages.java Sun Jan 1
23:21:21 2012 UTC
+++ /trunk/api/src/main/java/org/vosao/i18n/Messages.java Wed May 13
20:03:29 2015 UTC
@@ -51,6 +51,7 @@
public static final String I18N_CACHE_KEY = "i18n_";

private static final Locale[] supportedLocales = {
+ Locale.FRANCE,
Locale.ENGLISH,
Locale.GERMAN,
new Locale("es"),
@@ -68,6 +69,7 @@

private static VosaoResourceBundle getBundle(HttpServletRequest request) {
Locale sessionLocale =
VosaoContext.getInstance().getSession().getLocale();
+
Locale locale = sessionLocale != null ? sessionLocale :
request.getLocale();
return getBundle(locale);
}
@@ -78,6 +80,7 @@

private static VosaoResourceBundle getBundle(Locale locale) {
if (!bundles.containsKey(locale)) {
+
bundles.put(locale, new VosaoResourceBundle(locale));
}
return bundles.get(locale);
@@ -86,10 +89,13 @@
public static String get(String key, Object...objects) {
VosaoContext ctx = VosaoContext.getInstance();
String pattern = "not found";
+
if (isLocaleSupported(ctx.getLocale())) {
+
pattern = getBundle(ctx.getRequest()).getString(key);
}
else {
+
pattern = getDefaultBundle().getString(key);
}
if (objects != null) {
@@ -185,7 +191,9 @@
}

public static boolean isLocaleSupported(Locale locale) {
+
for (Locale l : supportedLocales) {
+
if (l.equals(locale)) {
return true;
}
Reply all
Reply to author
Forward
0 new messages