private static void findLanguages() {

        File i18nDirectory = FreeColDirectories.getI18nDirectory();
        File[] files = i18nDirectory.listFiles();
        if (files == null) {
            throw new RuntimeException("No language files could be found in the <" + i18nDirectory +
                                       "> folder. Make sure you ran the ant correctly.");
        }
        String prefix = Messages.FILE_PREFIX + "_";
        int prefixLength = prefix.length();
        for (File file : files) {
            if (file.getName() == null) {
                continue;
            }
            if (file.getName().startsWith(prefix)) {
                try {
                    final String languageID =
                        file.getName().substring(prefixLength, file.getName().indexOf("."));
                    // qqq contains explanations only
                    if (!"qqq".equals(languageID)) {
                        languages.put(languageID, new Language(languageID, getLocale(languageID)));
                    }
                } catch (Exception e) {
                    logger.log(Level.WARNING, "Exception in findLanguages()", e);
                    continue;
                }
            }
        }
    }