/[schmitzm]/trunk/src/skrueger/i8n/I8NUtil.java
ViewVC logotype

Diff of /trunk/src/skrueger/i8n/I8NUtil.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 44 by alfonx, Tue Apr 14 20:23:41 2009 UTC revision 140 by alfonx, Sun Jun 14 17:24:44 2009 UTC
# Line 44  public class I8NUtil { Line 44  public class I8NUtil {
44           */           */
45          public static Locale getLocaleFor(String code) {          public static Locale getLocaleFor(String code) {
46                  for (Locale l : Locale.getAvailableLocales()) {                  for (Locale l : Locale.getAvailableLocales()) {
47                          // System.out.println(l.getLanguage()+" not = "+code);                          if (l.getLanguage().equals(code.toLowerCase())) {
                         if (l.getLanguage().toLowerCase().equals(code.toLowerCase())) {  
48                                  return l;                                  return l;
49                          }                          }
50                            LOGGER.debug(l.getLanguage() + " not = " + code);
51                  }                  }
52    
53                  LOGGER.error("Can't create a Locale for code " + code                  LOGGER.error("Can't create a Locale for code " + code
54                                  + "! Returning the system default locale to avoid NPEs.");                                  + "! Returning the system default locale to avoid NPEs.");
55    
56                  return Locale.getDefault();                  return Locale.getDefault();
57          }          }
58    

Legend:
Removed from v.44  
changed lines
  Added in v.140

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26