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

View File

@ -52,13 +52,38 @@ public class CreamApiConfig {
//e.printStackTrace(); //e.printStackTrace();
} }
File langFile = new File("languages.txt"); // https://partner.steamgames.com/doc/store/localization#supported_languages
try { languages.addAll(Arrays.asList(
BufferedReader fIn = new BufferedReader(new FileReader(langFile)); "english",
fIn.lines().filter(line -> !line.isEmpty() && !line.startsWith("#")).forEach(languages::add); "latam",
} catch (IOException e) { "brazilian",
e.printStackTrace(); "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 { try {
read(); read();