MCPcopy Index your code
hub / github.com/benfry/processing4 / listSupported

Method listSupported

app/src/processing/app/Language.java:111–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 */

Callers 1

LanguageMethod · 0.95

Calls 5

getLibFileMethod · 0.95
appendMethod · 0.95
showErrorMethod · 0.95
toArrayMethod · 0.95
listMethod · 0.45

Tested by

no test coverage detected