diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7c719d5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.idea/workspaces.xml
diff --git a/.idea/artifacts/build.xml b/.idea/artifacts/build.xml
index 766ae9c..5022987 100644
--- a/.idea/artifacts/build.xml
+++ b/.idea/artifacts/build.xml
@@ -3,10 +3,10 @@
$PROJECT_DIR$/out/artifacts/build
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 309e68a..a92647a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,12 +7,79 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
@@ -76,8 +143,8 @@
-
-
+
+
@@ -177,10 +244,8 @@
-
-
-
-
+
+
@@ -226,6 +291,8 @@
+
+
@@ -356,15 +423,13 @@
-
+
-
-
@@ -384,7 +449,7 @@
-
+
@@ -736,6 +801,7 @@
+
1444218455154
@@ -843,7 +909,7 @@
-
+
@@ -855,34 +921,34 @@
-
+
-
-
-
+
-
+
-
+
+
+
@@ -977,14 +1043,14 @@
+
+
+
-
-
-
@@ -997,11 +1063,6 @@
-
-
-
-
-
@@ -1023,7 +1084,6 @@
-
@@ -1031,11 +1091,6 @@
-
-
-
-
-
@@ -1064,7 +1119,6 @@
-
@@ -1072,7 +1126,6 @@
-
@@ -1112,7 +1165,6 @@
-
@@ -1120,7 +1172,6 @@
-
@@ -1135,9 +1186,6 @@
-
-
-
@@ -1145,13 +1193,6 @@
-
-
-
-
-
-
-
@@ -1173,7 +1214,6 @@
-
@@ -1188,7 +1228,6 @@
-
@@ -1196,7 +1235,6 @@
-
@@ -1204,7 +1242,6 @@
-
@@ -1219,7 +1256,6 @@
-
@@ -1238,32 +1274,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1271,10 +1281,6 @@
-
-
-
-
@@ -1293,7 +1299,6 @@
-
@@ -1312,7 +1317,6 @@
-
@@ -1320,7 +1324,6 @@
-
@@ -1340,7 +1343,6 @@
-
@@ -1350,7 +1352,6 @@
-
@@ -1364,7 +1365,6 @@
-
@@ -1372,7 +1372,6 @@
-
@@ -1380,9 +1379,6 @@
-
-
-
@@ -1408,10 +1404,7 @@
-
-
-
-
+
@@ -1419,18 +1412,14 @@
-
-
-
-
-
+
-
-
+
+
@@ -1494,6 +1483,7 @@
diff --git a/Undefined.iml b/Undefined.iml
index a74277b..b4c7f0a 100644
--- a/Undefined.iml
+++ b/Undefined.iml
@@ -7,6 +7,6 @@
-
+
\ No newline at end of file
diff --git a/makebundles.sh b/makebundles.sh
new file mode 100755
index 0000000..f75685d
--- /dev/null
+++ b/makebundles.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+cd ./src/bundles
+native2ascii -encoding UTF-8 bundle_zh_utf8.properties bundle_zh.properties
+native2ascii -encoding UTF-8 bundle_ja_utf8.properties bundle_ja.properties
diff --git a/src/bundles/bundle.properties b/src/bundles/bundle.properties
new file mode 100644
index 0000000..259ccd9
--- /dev/null
+++ b/src/bundles/bundle.properties
@@ -0,0 +1,9 @@
+appdescription = Stream and host your music privately.
+title = Title
+artist = Artist
+artists = Artists
+album = Album
+albums = Albums
+track = Track
+tracks = Tracks
+length = Length
\ No newline at end of file
diff --git a/src/bundles/bundle_ja.properties b/src/bundles/bundle_ja.properties
new file mode 100644
index 0000000..5aa75c5
--- /dev/null
+++ b/src/bundles/bundle_ja.properties
@@ -0,0 +1,9 @@
+appdescription = \u3042\u306a\u305f\u306e\u97f3\u697d
+title = \u30bf\u30a4\u30c8\u30eb
+artist = \u30a2\u30fc\u30c6\u30a3\u30b9\u30c8
+artists = \u30a2\u30fc\u30c6\u30a3\u30b9\u30c8
+album = \u30a2\u30eb\u30d0\u30e0
+albums = \u30a2\u30eb\u30d0\u30e0
+track = \u30c8\u30e9\u30c3\u30af
+tracks = \u30c8\u30e9\u30c3\u30af
+length = \u9577\u3055
diff --git a/src/bundles/bundle_ja_utf8.properties b/src/bundles/bundle_ja_utf8.properties
new file mode 100644
index 0000000..4e03001
--- /dev/null
+++ b/src/bundles/bundle_ja_utf8.properties
@@ -0,0 +1,9 @@
+appdescription = あなたの音楽
+title = タイトル
+artist = アーティスト
+artists = アーティスト
+album = アルバム
+albums = アルバム
+track = トラック
+tracks = トラック
+length = 長さ
\ No newline at end of file
diff --git a/src/bundles/bundle_zh.properties b/src/bundles/bundle_zh.properties
new file mode 100644
index 0000000..fd99e09
--- /dev/null
+++ b/src/bundles/bundle_zh.properties
@@ -0,0 +1,9 @@
+appdescription = \u4f60\u7684\u97f3\u4e50.
+title = \u66f2\u540d
+artist = \u6f14\u5531\u8005
+artists = \u6f14\u5531\u8005
+album = \u4e13\u8f91
+albums = \u4e13\u8f91
+track = \u6b4c\u66f2
+tracks = \u6b4c\u66f2
+length = \u957f\u5ea6
diff --git a/src/bundles/bundle_zh_utf8.properties b/src/bundles/bundle_zh_utf8.properties
new file mode 100644
index 0000000..088d50c
--- /dev/null
+++ b/src/bundles/bundle_zh_utf8.properties
@@ -0,0 +1,9 @@
+appdescription = 你的音乐.
+title = 曲名
+artist = 演唱者
+artists = 演唱者
+album = 专辑
+albums = 专辑
+track = 歌曲
+tracks = 歌曲
+length = 长度
\ No newline at end of file
diff --git a/src/io/makerforce/undefined/Main.java b/src/io/makerforce/undefined/Main.java
index 317456a..df81996 100644
--- a/src/io/makerforce/undefined/Main.java
+++ b/src/io/makerforce/undefined/Main.java
@@ -13,12 +13,17 @@ import javafx.stage.Stage;
import javafx.stage.StageStyle;
import java.io.IOException;
+import java.nio.file.Watchable;
+import java.util.Locale;
+import java.util.ResourceBundle;
public class Main extends Application {
ChangeListener ch = null; // Because it doesn't work in there
private Stage mainStage;
+ public static ResourceBundle bundle = ResourceBundle.getBundle("bundles/bundle", Locale.getDefault());
+
public static void main(String[] args) {
launch(args);
}
@@ -26,7 +31,8 @@ public class Main extends Application {
@Override
public void start(Stage initStage) throws Exception {
- Parent splashRoot = FXMLLoader.load(getClass().getResource("view/splash.fxml"));
+
+ Parent splashRoot = FXMLLoader.load(getClass().getResource("view/splash.fxml"), bundle);
Scene splashScene = new Scene(splashRoot, 300, 200);
initStage.initStyle(StageStyle.UNDECORATED);
initStage.setScene(splashScene);
@@ -41,7 +47,7 @@ public class Main extends Application {
Platform.runLater(() -> {
Parent root = null;
try {
- root = FXMLLoader.load(Main.this.getClass().getResource("view/interface.fxml"));
+ root = FXMLLoader.load(Main.this.getClass().getResource("view/interface.fxml"), bundle);
} catch (IOException e) {
e.printStackTrace();
System.exit(284);
diff --git a/src/io/makerforce/undefined/view/InterfaceController.java b/src/io/makerforce/undefined/view/InterfaceController.java
index 473d5d3..79cc866 100644
--- a/src/io/makerforce/undefined/view/InterfaceController.java
+++ b/src/io/makerforce/undefined/view/InterfaceController.java
@@ -1,5 +1,6 @@
package io.makerforce.undefined.view;
+import io.makerforce.undefined.Main;
import io.makerforce.undefined.model.Item;
import io.makerforce.undefined.model.ItemList;
import io.makerforce.undefined.model.Track;
@@ -39,7 +40,6 @@ public class InterfaceController {
private Label currentArtist;
@FXML
private ListView showList;
- private ObservableList showListItems = FXCollections.observableArrayList("Artists", "Albums", "Songs");
@FXML
private ScrollPane scrollPane;
//@FXML
@@ -112,7 +112,7 @@ public class InterfaceController {
// Raw bindings
- showList.setItems(showListItems);
+ showList.setItems(FXCollections.observableArrayList(Main.bundle.getString("artists"), Main.bundle.getString("albums"), Main.bundle.getString("tracks")));
showList.selectionModelProperty().get().clearAndSelect(0);
showList.selectionModelProperty().get().selectedIndexProperty().addListener(observable2 -> {
int sel = showList.selectionModelProperty().get().getSelectedIndex();
diff --git a/src/io/makerforce/undefined/view/TrackListController.java b/src/io/makerforce/undefined/view/TrackListController.java
index 46970df..8797f80 100644
--- a/src/io/makerforce/undefined/view/TrackListController.java
+++ b/src/io/makerforce/undefined/view/TrackListController.java
@@ -1,5 +1,6 @@
package io.makerforce.undefined.view;
+import io.makerforce.undefined.Main;
import io.makerforce.undefined.model.ItemList;
import io.makerforce.undefined.model.Track;
import javafx.beans.value.ObservableIntegerValue;
@@ -42,7 +43,7 @@ public class TrackListController extends VBox {
private ItemList itemList;
public TrackListController(Image image, String title, String subtitle) {
- FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("tracklist.fxml"));
+ FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("tracklist.fxml"), Main.bundle);
fxmlLoader.setRoot(this);
fxmlLoader.setController(this);
try {
diff --git a/src/io/makerforce/undefined/view/interface.fxml b/src/io/makerforce/undefined/view/interface.fxml
index 410519f..6457781 100644
--- a/src/io/makerforce/undefined/view/interface.fxml
+++ b/src/io/makerforce/undefined/view/interface.fxml
@@ -5,6 +5,8 @@
+
+
@@ -150,7 +152,15 @@
-
+
+
+
+
+
-
+
+
-
diff --git a/src/io/makerforce/undefined/view/tracklist.fxml b/src/io/makerforce/undefined/view/tracklist.fxml
index 86fa84a..616cfb1 100644
--- a/src/io/makerforce/undefined/view/tracklist.fxml
+++ b/src/io/makerforce/undefined/view/tracklist.fxml
@@ -1,47 +1,47 @@
+
+
+
+
+
-
+
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+