| 73 | } |
| 74 | |
| 75 | public static void loadLocaleData(InputStream is, Map localeProperties) throws IOException |
| 76 | { |
| 77 | Iterator iterator = IOUtils.readLines(is, Charsets.UTF_8).iterator(); |
| 78 | is.close(); |
| 79 | |
| 80 | while (iterator.hasNext()) |
| 81 | { |
| 82 | String s = (String)iterator.next(); |
| 83 | |
| 84 | if (!s.isEmpty() && s.charAt(0) != 35) |
| 85 | { |
| 86 | String[] astring = (String[])((String[])Iterables.toArray(splitter.split(s), String.class)); |
| 87 | |
| 88 | if (astring != null && astring.length == 2) |
| 89 | { |
| 90 | String s1 = astring[0]; |
| 91 | String s2 = pattern.matcher(astring[1]).replaceAll("%$1s"); |
| 92 | localeProperties.put(s1, s2); |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | public static String get(String key) |
| 99 | { |