List of languages is now hardcoded!

This commit is contained in:
Jeddunk 2020-08-28 15:36:08 +02:00
parent d71d8ed789
commit 308f20cb81
3 changed files with 33 additions and 24 deletions

View File

@ -1,16 +0,0 @@
# List of languages
# https://partner.steamgames.com/doc/store/localization#supported_languages
english
latam
brazilian
german
french
italian
portuguese
spanish
russian
schinese
tchinese
japanese
koreana

View File

@ -108,6 +108,7 @@ public class Controller {
@FXML
public void initialize() {
appId_textfield.textProperty().addListener(appIdChangesGameName());
language_combobox.setItems(FXCollections.observableArrayList(config.getLanguages()));
//retrieveDlcList_button.setDisable(true); // WIP
generate_tooltips();
fix_dlc_textarea_prompt_text();
@ -115,7 +116,6 @@ public class Controller {
}
private void read() {
language_combobox.setItems(FXCollections.observableArrayList(config.getLanguages()));
language_combobox.getSelectionModel().select(config.getLanguage());
appId_textfield.setText(config.getAppId().toString());
dlc_textarea.setText(config.getDlcListAsString());

View File

@ -52,13 +52,38 @@ public class CreamApiConfig {
//e.printStackTrace();
}
File langFile = new File("languages.txt");
try {
BufferedReader fIn = new BufferedReader(new FileReader(langFile));
fIn.lines().filter(line -> !line.isEmpty() && !line.startsWith("#")).forEach(languages::add);
} catch (IOException e) {
e.printStackTrace();
}
// https://partner.steamgames.com/doc/store/localization#supported_languages
languages.addAll(Arrays.asList(
"english",
"latam",
"brazilian",
"german",
"french",
"italian",
"portuguese",
"spanish",
"russian",
"schinese",
"tchinese",
"japanese",
"koreana",
"arabic",
"bulgarian",
"czech",
"danish",
"dutch",
"finnish",
"greek",
"hungarian",
"norwegian",
"polish",
"romanian",
"swedish",
"thai",
"turkish",
"ukrainian",
"vietnamese"
));
try {
read();