FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Load supported locales from locales.txt file by Stefterv · Pull Request #1360 · processing/processing4 · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) .txt  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
17 changes: 17 additions & 0 deletions app/src/main/resources/languages/locales.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ar
ca
de
el
en
es
fr
it
ja
ko
nl
pt
ru
tr
uk
zh-CN
zh-TW
17 changes: 5 additions & 12 deletions app/src/processing/app/Language.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package processing.app;

import processing.core.PApplet;
import processing.data.StringList;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -114,19 +113,13 @@ private Language() {


static private String[] listSupported() {
StringList supported = new StringList();
var locales = Locale.getAvailableLocales();
var loader = Language.class.getClassLoader();
for (var locale : locales) {
var language = locale.toLanguageTag();
var baseFilename = "languages/PDE_" + language + ".properties";
var file = loader.getResource(baseFilename);
if (file == null) {
continue;
}
supported.append(language);
try (var localeFile = loader.getResourceAsStream("languages/locales.txt")) {
return PApplet.loadStrings(localeFile);
} catch (IOException e) {
e.printStackTrace();
}
return supported.toArray();
return new String[]{"en"};
}


Expand Down

Back | FazBrowse Home | New Git URL