+ private static Locale[] supportedLocales;
+
+ static {
+ LinkedList<Locale> supported = new LinkedList<>();
+ File locales = new File("locale");
+ File[] listFiles = locales.listFiles();
+ if (listFiles != null) {
+ for (File f : listFiles) {
+ if ( !f.getName().endsWith(".xml")) {
+ continue;
+ }
+ String language = f.getName().split("\\.", 2)[0];
+ supported.add(getLocaleFromString(language));
+ }
+ }
+ Collections.sort(supported, new Comparator<Locale>() {
+
+ @Override
+ public int compare(Locale o1, Locale o2) {
+ return o1.toString().compareTo(o2.toString());
+ }