| 109 | |
| 110 | |
| 111 | static private String[] listSupported() { |
| 112 | StringList supported = new StringList(); |
| 113 | try { |
| 114 | File baseFolder = Base.getLibFile("languages"); |
| 115 | String[] names = baseFolder.list(); |
| 116 | if (names != null) { |
| 117 | for (String filename : names) { |
| 118 | if (filename.startsWith("PDE_") && filename.endsWith(".properties")) { |
| 119 | int dotIndex = filename.lastIndexOf(".properties"); |
| 120 | String language = filename.substring(4, dotIndex); |
| 121 | supported.append(language); |
| 122 | } |
| 123 | } |
| 124 | } else { |
| 125 | throw new IOException("Could not read list of files inside " + baseFolder); |
| 126 | } |
| 127 | } catch (IOException e) { |
| 128 | Messages.showError("Translation Trouble", |
| 129 | "There was a problem reading the language translations folder.\n" + |
| 130 | "You may need to reinstall, or report if the problem persists.", e); |
| 131 | } |
| 132 | return supported.toArray(); |
| 133 | } |
| 134 | |
| 135 | |
| 136 | /** Read the saved language */ |