/[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 37 by mojays, Tue Feb 24 22:43:52 2009 UTC revision 38 by alfonx, Sun Apr 5 15:06:56 2009 UTC
# Line 1  Line 1 
1  package skrueger.i8n;  package skrueger.i8n;
2    
3  import java.util.LinkedList;  import java.util.Set;
4  import java.util.List;  import java.util.TreeSet;
5    
6  public class I8NUtil {  public class I8NUtil {
7                    
8          public static List<String> languageCodes = new LinkedList<String>();          private static Set<String> languageCodes = new TreeSet<String>();
9          static {          static {
10          for (String code : java.util.Locale.getISOLanguages()) {          for (String code : java.util.Locale.getISOLanguages()) {
11                  languageCodes.add(code);                  getLanguageCodes().add(code);
12          }          }
13      }      }
14  //        //      
# Line 42  public class I8NUtil { Line 42  public class I8NUtil {
42           * @return true if the code paramter is a valid ISO Language code           * @return true if the code paramter is a valid ISO Language code
43           */           */
44          public static boolean isValidISOLangCode(String code) {          public static boolean isValidISOLangCode(String code) {
45                  return languageCodes.contains(code);                  return getLanguageCodes().contains(code);
46            }
47    
48    
49            /**
50             * @return All language codes available in java.util.Locale.getISOLanguages() without duplicates.
51             */
52            public static Set<String> getLanguageCodes() {
53                    return languageCodes;
54          }          }
55  }  }
56    

Legend:
Removed from v.37  
changed lines
  Added in v.38

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26