From 869566d732ea11e26613241534399d0dd4f94c48 Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Sun, 21 Jul 2024 14:35:12 -0500 Subject: [PATCH] implement support for international localizations --- firestar/src/main/java/Suggs.java | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/firestar/src/main/java/Suggs.java b/firestar/src/main/java/Suggs.java index 1137b7a..372eb16 100644 --- a/firestar/src/main/java/Suggs.java +++ b/firestar/src/main/java/Suggs.java @@ -414,7 +414,35 @@ public class Suggs implements ActionListener, ListSelectionListener { String ocmd = "modify"; if (i >= 12) ocmd = "create"; String oArtistLine = oArtist.replace("\"", "\\\"")+"\\n"; - ps.println("file \"data/plugins/languages/american/entries.xml\" xml "+ocmd+" StringTable.entry#MT_"+trackno+" set attribute \"string\" \""+oArtistLine+oTitle.replace("\"", "\\\"")+"\""); + int i2 = 0; + while (i2 < 17 /*17 languages*/) { + String language = "INTERNAL_ERROR"; + switch (i2) { + case 0: language = "american"; break; + case 1: language = "danish"; break; + case 2: language = "dutch"; break; + case 3: language = "english"; break; + case 4: language = "finnish"; break; + case 5: language = "french"; break; + case 6: language = "german"; break; + case 7: language = "italian"; break; + case 8: language = "japanese"; break; + case 9: language = "korean"; break; + case 10: language = "norwegian"; break; + case 11: language = "polish"; break; + case 12: language = "portuguese"; break; + case 13: language = "russian"; break; + case 14: language = "spanish"; break; + case 15: language = "swedish"; break; + case 16: language = "traditionalchinese"; break; + default: + int result = JOptionPane.showConfirmDialog(frame, "Firestar encountered an internal error.\nString 'language' exported to FSCRIPT was blank.", "Fatal Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE); + if (result == JOptionPane.OK_OPTION) {System.exit(1);} //user safety + break; + } + ps.println("file \"data/plugins/languages/"+language+"/entries.xml\" xml "+ocmd+" StringTable.entry#MT_"+trackno+" set attribute \"string\" \""+oArtistLine+oTitle.replace("\"", "\\\"")+"\""); + i2++; + } ps.println("file \"data/audio/music/"+trackno+"/music_stereo.fft\" delete"); progressDialog.setProgressValue(i+1); }