- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Sat, 20 Mar 2010 17:07:22 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action In directory hutz:/tmp/cvs-serv31130/src/org/w3c/unicorn/action Modified Files: ObserveAction.java Log Message: uses ULocale objects instead of Strings to instantiate Message objects Index: ObserveAction.java =================================================================== RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/ObserveAction.java,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- ObserveAction.java 23 Oct 2009 11:44:38 -0000 1.56 +++ ObserveAction.java 20 Mar 2010 17:07:20 -0000 1.57 @@ -38,6 +38,8 @@ import org.w3c.unicorn.util.Property; import org.w3c.unicorn.Framework; +import com.ibm.icu.util.ULocale; + /** * ObserveAction * @@ -140,8 +142,9 @@ String paramName = key.substring(paramPrefix.length()); if (paramName.equals("lang")) { logger.trace("Lang parameter: " + key + " - " + (String) reqParams.get(key)); - String lang = getLanguage((String) reqParams.get(key), req, null); - messages.setLang(lang); + ULocale locale = getLanguage((String) reqParams.get(key), req, null); + String lang = locale.getName(); + messages.setLocale(locale); mapOfOutputParameter.put(paramName, lang); String aLocale = convertEnumerationToString(req.getLocales()); if (null == aLocale) @@ -199,8 +202,9 @@ // Check that all mandatory parameters are set if (!reqParams.containsKey(paramPrefix + "lang")) { - String lang = getLanguage(null, req, null); - messages.setLang(lang); + ULocale locale = getLanguage(null, req, null); + String lang = locale.getName(); + messages.setLocale(locale); reqParams.put(paramPrefix + "lang", getLanguage(null, req, null)); logger.debug("No language parameter found. Language negociation resolved language to: " + lang); mapOfOutputParameter.put("lang", lang);
Received on Saturday, 20 March 2010 17:07:24 UTC