OSDN Git Service

feat: add translation for JP and EN(US)
authorhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Tue, 14 Dec 2021 09:56:15 +0000 (18:56 +0900)
committerhizumiaoba <56146205+hizumiaoba@users.noreply.github.com>
Tue, 14 Dec 2021 09:56:15 +0000 (18:56 +0900)
BREAKING CHANGE: DelesteRandomSelector now became a multilingual! If you
aren't satisfied with this translation, you can submit issues from
github!

src/com/ranfa/languages/List_en_US.properties
src/com/ranfa/languages/List_ja_JP.properties
src/com/ranfa/lib/Scraping.java
src/com/ranfa/main/DelesteRandomSelector.java
src/com/ranfa/main/Messages.java
src/test/LanguageTest.java

index f69c4d6..c0ec3f6 100644 (file)
@@ -5,21 +5,17 @@ MSGNarrowingDownSongs:<html><body>Narrow down<br>songs</body></html>
 MSGTitle:DelesteRandomSelector
 MSGSelectDifficulty:Difficulty
 MSGNonSelected:Non-Select
-MSGAll:ALL
-MSGCute:CUTE
-MSGCool:COOL
-MSGPassion:PASSION
 MSGSongLevel:Level
-MSGBelowSpecificLevel:Below Specified Level
-MSGOverSpecificLevel:Above Specified Level
+MSGBelowSpecificLevel:Below Lv
+MSGOverSpecificLevel:Above Lv
 MSGLevelCheckboxInfo:<html><body>Only specified level songs will be selected if you mark both checkbox.</body></html>
 MSGUpdatingDatabase:<html><body>Updating<br>database</body></html>
 MSGCompleteNarrowDown:Narrowing down complete! Click \"Start!\" to play!
 MSGNumberOfSongs:tracks:
 MSGThisPhrase:Let's play these
 MSGPlayPhrase:songs!
-MSGTwitterIntegration:Post to Twitter
-MSGUsingThisAppPhrase:I played
+MSGTwitterIntegration:<html><body>Post to Twitter</body></html>
+MSGUsingThisAppPhrase:I played\n
 MSGNotPlayYet:It seems that you don't start playing yet?
 MSGTwitterPlayOtherwisePhrase:...and some songs!\n
 MSGTwitterPlayOnlyPhrase:songs!
index cd87309..009177a 100644 (file)
@@ -5,17 +5,13 @@ MSGNarrowingDownSongs:<html><body>\u697d\u66f2<br>\u7d5e\u308a\u8fbc\u307f</body
 MSGTitle:\u30c7\u30ec\u30b9\u30c6\u8ab2\u984c\u66f2\u30bb\u30ec\u30af\u30bf\u30fc
 MSGSelectDifficulty:\u96e3\u6613\u5ea6\u9078\u629e
 MSGNonSelected:\u6307\u5b9a\u306a\u3057
-MSGAll:\u5168\u30bf\u30a4\u30d7
-MSGCute:\u30ad\u30e5\u30fc\u30c8
-MSGCool:\u30af\u30fc\u30eb
-MSGPassion:\u30d1\u30c3\u30b7\u30e7\u30f3
 MSGSongLevel:\u697d\u66f2Lv
 MSGBelowSpecificLevel:\u6307\u5b9aLv\u4ee5\u4e0b
 MSGOverSpecificLevel:\u6307\u5b9aLv\u4ee5\u4e0a
-MSGLevelCheckboxInfo:<html><body>\u203b\u4ee5\u4e0b\u4ee5\u4e0a\u4e21\u65b9\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u6307\u5b9a\u30ec\u30d9\u30eb\u306e\u307f\u7d5e\u308a\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059</body></html>
+MSGLevelCheckboxInfo:<html><body>\u4ee5\u4e0b\u4ee5\u4e0a\u4e21\u65b9\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u6307\u5b9a\u30ec\u30d9\u30eb\u306e\u307f\u7d5e\u308a\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059</body></html>
 MSGUpdatingDatabase:<html><body>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9<br>\u66f4\u65b0\u4e2d\u2026</body></html>
 MSGCompleteNarrowDown:\u7d5e\u308a\u8fbc\u307f\u5b8c\u4e86\uff01\u300c\u958b\u59cb\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3053\u3068\u3067\u9078\u66f2\u3067\u304d\u307e\u3059\uff01
-MSGNumberOfSongs:\u66f2\u76ee:
+MSGNumberOfSongs:\u66f2\u76ee\uff1a
 MSGThisPhrase:\u3053\u306e
 MSGPlayPhrase:\u66f2\u3092\u30d7\u30ec\u30a4\u3057\u307e\u3057\u3087\u3046\uff01\uff01\uff01
 MSGTwitterIntegration:Twitter\u9023\u643a
@@ -29,4 +25,4 @@ MSGCompletePost:\u6295\u7a3f\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002
 MSGTerminate:\u7d42\u4e86
 MSGInternalYpdateNotDoneYet:\u5185\u90e8\u66f4\u65b0\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u5c11\u3057\u5f85\u3063\u3066\u304b\u3089\u3084\u308a\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002
 MSGNarrowDownProcedure:\u697d\u66f2\u9078\u629e\u306e\u624b\u9806\r\n\uff11\uff0e\u96e3\u6613\u5ea6\u3001\u5c5e\u6027\u3001\u30ec\u30d9\u30eb\u3092\u9078\u629e\u3059\u308b\r\n\uff12\uff0e\u300c\u697d\u66f2\u53d6\u308a\u8fbc\u307f\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3059\uff01\r\n\uff13\uff0e\u300c\u958b\u59cb\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3059\uff01\r\n\uff14\uff0e\u9078\u629e\u3055\u308c\u305f\u697d\u66f2\u304c\u3053\u3053\u306b\u8868\u793a\u3055\u308c\u307e\u3059\uff01\r\n\u73fe\u5728\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u697d\u66f2\u9078\u629e\u306e\u6700\u5927\u6570\uff1a
-MSGCurrentAlbumType:\n\u73fe\u5728\u306eMASTER+\u30a2\u30eb\u30d0\u30e0\u5468\u671f\uff08\u63a8\u5b9a\uff09:
\ No newline at end of file
+MSGCurrentAlbumType:\n\u73fe\u5728\u306eMASTER+\u30a2\u30eb\u30d0\u30e0\u5468\u671f\uff08\u63a8\u5b9a\uff09\uff1a
\ No newline at end of file
index bb0e03d..f326d06 100644 (file)
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.ObjectWriter;
 import com.ranfa.lib.AlbumTypeEstimate.MASTERPLUS_TYPE;
+import com.ranfa.main.Messages;
 
 public class Scraping {
 
@@ -93,15 +94,17 @@ public class Scraping {
                                tmp.setNotes(notes);
                                if(difficulty.equals(LEGACYMASTERPLUS)) {
                                        ArrayList<Album> newTypeList = typeLists.get(MASTERPLUS_TYPE.LEGACYMASTERPLUS.ordinal());
-                                       for(int j = 0; j < newTypeList.size(); j++) {
-                                               if(newTypeList.get(j).getSongName().equals(name))
-                                                       tmp.setAlbumType(newTypeList.get(j).getAlbumType());
+                                       for (Album element : newTypeList) {
+                                               if(element.getSongName().equals(name)) {
+                                                       tmp.setAlbumType(element.getAlbumType());
+                                               }
                                        }
                                } else if(difficulty.equals(MASTERPLUS)) {
                                        ArrayList<Album> legacyTypeList = typeLists.get(MASTERPLUS_TYPE.NEWMASTERPLUS.ordinal());
-                                       for(int j = 0; j < legacyTypeList.size(); j++) {
-                                               if(legacyTypeList.get(j).getSongName().equals(name))
-                                                       tmp.setAlbumType(legacyTypeList.get(j).getAlbumType());
+                                       for (Album element : legacyTypeList) {
+                                               if(element.getSongName().equals(name)) {
+                                                       tmp.setAlbumType(element.getAlbumType());
+                                               }
                                        }
                                } else {
                                        tmp.setAlbumType("Not-Implemented");
@@ -120,14 +123,15 @@ public class Scraping {
                                && !attribute.equals(CUTE)
                                && !attribute.equals(COOL)
                                && !attribute.equals(PASSION)
-                               && !attribute.equals(NONSELECTED))
+                               && !attribute.equals(Messages.MSGNonSelected.toString())) {
                        throw new IllegalArgumentException("Illegal attribute value: " + attribute);
+               }
                if(data.isEmpty()) {
                        JOptionPane.showMessageDialog(null, "指定された属性の曲は存在しません。\n条件を変えてみてください");
                        throw new IllegalArgumentException("ArrayList must not empty.");
                }
-               ArrayList<Song> res = new ArrayList<Song>();
-               if(attribute.equals(NONSELECTED)) {
+               ArrayList<Song> res = new ArrayList<>();
+               if(attribute.equals(Messages.MSGNonSelected.toString())) {
                        res = data;
                } else {
                        data.stream()
@@ -149,12 +153,14 @@ public class Scraping {
                                && !difficulty.equals(PIANO)
                                && !difficulty.equals(FORTE)
                                && !difficulty.equals(WITCH)
-                               && !difficulty.equals(NONSELECTED))
+                               && !difficulty.equals(Messages.MSGNonSelected.toString())) {
                        throw new IllegalArgumentException("Illegal difficulty value.");
-               if(data.isEmpty())
+               }
+               if(data.isEmpty()) {
                        throw new IllegalArgumentException("ArrayList must not empty.");
-               ArrayList<Song> res = new ArrayList<Song>();
-               if(difficulty.equals(NONSELECTED)) {
+               }
+               ArrayList<Song> res = new ArrayList<>();
+               if(difficulty.equals(Messages.MSGNonSelected.toString())) {
                        res = data;
                } else {
                        data.stream()
@@ -165,15 +171,19 @@ public class Scraping {
        }
 
        public static  ArrayList<Song> getSpecificLevelSongs(ArrayList<Song> data, int level, boolean isLess, boolean isMore) {
-               if(level <= 0)
+               if(level <= 0) {
                        throw new IllegalArgumentException("Level must not negative.");
-               if(data.isEmpty())
+               }
+               if(data.isEmpty()) {
                        throw new IllegalArgumentException("ArrayList must not empty.");
-               if(!(isLess || isMore))
+               }
+               if(!(isLess || isMore)) {
                        throw new IllegalArgumentException("Illegal boolean value.");
-               if(isLess && isMore)
+               }
+               if(isLess && isMore) {
                        return getOnlyLevelSongs(data, level);
-               ArrayList<Song> res = new ArrayList<Song>();
+               }
+               ArrayList<Song> res = new ArrayList<>();
                if(isLess) {
                        data.stream()
                        .filter(element -> element.getLevel() < level)
@@ -187,19 +197,21 @@ public class Scraping {
        }
 
        public static ArrayList<Song> getSpecificAlbumTypeSongs(ArrayList<Song> data, String type) {
-               if(type == null)
+               if(type == null) {
                        throw new IllegalArgumentException("type must not null.");
-               if(data.isEmpty())
+               }
+               if(data.isEmpty()) {
                        throw new IllegalArgumentException("ArrayList must not empty");
+               }
                ArrayList<Song> res = new ArrayList<>();
                data.stream()
-                       .filter(element -> element.getAlbumType().equals(type))
-                       .forEach(res::add);
+               .filter(element -> element.getAlbumType().equals(type))
+               .forEach(res::add);
                return res;
        }
 
        private static ArrayList<Song> getOnlyLevelSongs(ArrayList<Song> data, int level) {
-               ArrayList<Song> res = new ArrayList<Song>();
+               ArrayList<Song> res = new ArrayList<>();
                data.stream()
                .filter(element -> element.getLevel() == level)
                .forEach(res::add);
@@ -215,7 +227,7 @@ public class Scraping {
                } catch (IOException e) {
                        logger.error("IOException was thrown during reading From JSON Database file.", e);
                }
-               ArrayList<Song> res = new ArrayList<Song>();
+               ArrayList<Song> res = new ArrayList<>();
                if(property != null) {
                        res.addAll(property.getList());
                } else {
@@ -231,8 +243,9 @@ public class Scraping {
                property.setList(list);
                ObjectWriter writer = new ObjectMapper().writer(new DefaultPrettyPrinter());
                try {
-                       if(Files.notExists(Paths.get("generated")))
+                       if(Files.notExists(Paths.get("generated"))) {
                                Files.createDirectory(Paths.get("generated"));
+                       }
                        writer.writeValue(Paths.get(DBPATH).toFile(), property);
                } catch (IOException e) {
                        logger.error("IOException was thrown during writing to JSON database file.", e);
index a742170..7c0d994 100644 (file)
@@ -180,7 +180,7 @@ public class DelesteRandomSelector extends JFrame {
                                new RowSpec[] {
                                                RowSpec.decode("20px"),}));
 
-               this.labelTitle = new JLabel("デレステ課題曲セレクター");
+               this.labelTitle = new JLabel(Messages.MSGTitle.toString());
                this.labelTitle.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 16));
                this.panelNorth.add(this.labelTitle, "1, 1, center, top");
 
@@ -211,36 +211,36 @@ public class DelesteRandomSelector extends JFrame {
                                                FormSpecs.RELATED_GAP_ROWSPEC,
                                                RowSpec.decode("max(52dlu;default)"),}));
 
-               this.labelDifficulty = new JLabel("難易度選択");
+               this.labelDifficulty = new JLabel(Messages.MSGSelectDifficulty.toString());
                this.labelDifficulty.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
                this.panelWest.add(this.labelDifficulty, "2, 2, center, default");
 
                this.comboDifficultySelect = new JComboBox();
                this.comboDifficultySelect.setFont(new Font("Dialog", Font.BOLD, 12));
-               this.comboDifficultySelect.setModel(new DefaultComboBoxModel(new String[] {"指定なし", "DEBUT", "REGULAR", "PRO", "MASTER", "MASTER+", "ⓁMASTER+", "LIGHT", "TRICK", "PIANO", "FORTE", "WITCH"}));
+               this.comboDifficultySelect.setModel(new DefaultComboBoxModel(new String[] {Messages.MSGNonSelected.toString(), "DEBUT", "REGULAR", "PRO", "MASTER", "MASTER+", "ⓁMASTER+", "LIGHT", "TRICK", "PIANO", "FORTE", "WITCH"}));
                this.panelWest.add(this.comboDifficultySelect, "2, 4, fill, default");
 
                this.comboAttribute = new JComboBox();
                this.comboAttribute.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
-               this.comboAttribute.setModel(new DefaultComboBoxModel(new String[] {"指定なし", "全タイプ", "キュート", "クール", "パッション"}));
+               this.comboAttribute.setModel(new DefaultComboBoxModel(new String[] {Messages.MSGNonSelected.toString(), "全タイプ", "キュート", "クール", "パッション"}));
                this.panelWest.add(this.comboAttribute, "2, 6, fill, default");
 
-               this.labelLevel = new JLabel("楽曲Lv");
+               this.labelLevel = new JLabel(Messages.MSGSongLevel.toString());
                this.labelLevel.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
                this.panelWest.add(this.labelLevel, "2, 8, center, default");
 
                this.spinnerLevel = new JSpinner();
                this.panelWest.add(this.spinnerLevel, "2, 10");
 
-               this.checkLessLv = new JCheckBox("指定Lv以下");
+               this.checkLessLv = new JCheckBox(Messages.MSGBelowSpecificLevel.toString());
                this.checkLessLv.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
                this.panelWest.add(this.checkLessLv, "2, 12");
 
-               this.checkMoreLv = new JCheckBox("指定Lv以上");
+               this.checkMoreLv = new JCheckBox(Messages.MSGOverSpecificLevel.toString());
                this.checkMoreLv.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
                this.panelWest.add(this.checkMoreLv, "2, 14");
 
-               this.labelLvCaution = new JLabel("<html><body>※以下以上両方にチェックをつけることで指定レベルのみ絞り込むことができます</body></html>");
+               this.labelLvCaution = new JLabel(Messages.MSGLevelCheckboxInfo.toString());
                this.labelLvCaution.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
                this.panelWest.add(this.labelLvCaution, "2, 16, fill, fill");
 
@@ -267,7 +267,7 @@ public class DelesteRandomSelector extends JFrame {
                                                FormSpecs.RELATED_GAP_ROWSPEC,
                                                FormSpecs.DEFAULT_ROWSPEC,}));
 
-               this.btnImport = new JButton("<html><body>データベース<br>更新中…</body></html>");
+               this.btnImport = new JButton(Messages.MSGUpdatingDatabase.toString());
                this.btnImport.setEnabled(false);
                this.btnImport.addActionListener(e -> {
                        ArrayList<Song> fromJson = Scraping.getFromJson();
@@ -280,7 +280,7 @@ public class DelesteRandomSelector extends JFrame {
                        }
                        selectedSongsList.addAll((DelesteRandomSelector.this.comboDifficultySelect.getSelectedItem().equals(Scraping.MASTERPLUS) || DelesteRandomSelector.this.comboDifficultySelect.getSelectedItem().equals(Scraping.LEGACYMASTERPLUS)) ? specificTypeList : specificAttributeList);
                        DelesteRandomSelector.this.logger.info("Songs are selected.We are Ready to go.");
-                       JOptionPane.showMessageDialog(null, "絞り込み完了!「開始」をクリックすることで選曲できます!");
+                       JOptionPane.showMessageDialog(null, Messages.MSGCompleteNarrowDown.toString());
                });
                this.btnImport.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
                this.panelEast.add(this.btnImport, "1, 3, fill, fill");
@@ -293,10 +293,10 @@ public class DelesteRandomSelector extends JFrame {
                        for(int i = 0; i < DelesteRandomSelector.this.property.getSongLimit(); i++) {
                                int randomInt = random.nextInt(selectedSongsList.size());
                                String typeString = DelesteRandomSelector.this.comboDifficultySelect.getSelectedItem().equals(Scraping.MASTERPLUS) || DelesteRandomSelector.this.comboDifficultySelect.getSelectedItem().equals(Scraping.LEGACYMASTERPLUS) ? EstimateAlbumTypeCycle.getCurrentCycle() : "";
-                               paneString = paneString + (i + 1) + "曲目: " + selectedSongsList.get(randomInt).getAttribute() + " [" + selectedSongsList.get(randomInt).getDifficulty() + "]「" + selectedSongsList.get(randomInt).getName() + "」!(Lv:" + selectedSongsList.get(randomInt).getLevel() + " " + typeString + ")\n\n";
+                               paneString = paneString + (i + 1) + Messages.MSGNumberOfSongs.toString() + " " + selectedSongsList.get(randomInt).getAttribute() + " [" + selectedSongsList.get(randomInt).getDifficulty() + "]「" + selectedSongsList.get(randomInt).getName() + "」!(Lv:" + selectedSongsList.get(randomInt).getLevel() + " " + typeString + ")\n\n";
                                DelesteRandomSelector.this.integratorArray[i] = selectedSongsList.get(randomInt).getName() + "(Lv" + selectedSongsList.get(randomInt).getLevel() + ")\n";
                        }
-                       paneString = paneString + "この" + DelesteRandomSelector.this.property.getSongLimit() + "曲をプレイしましょう!!!";
+                       paneString = paneString + Messages.MSGThisPhrase.toString() + DelesteRandomSelector.this.property.getSongLimit() + Messages.MSGPlayPhrase.toString();
                        DelesteRandomSelector.this.textArea.setText(paneString);
                        DelesteRandomSelector.this.integratorBool = true;
                        DelesteRandomSelector.this.logger.info("show up completed.");
@@ -304,15 +304,15 @@ public class DelesteRandomSelector extends JFrame {
                this.btnStart.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
                this.panelEast.add(this.btnStart, "1, 7, fill, fill");
 
-               this.btnTwitterIntegration = new JButton("Twitter連携");
+               this.btnTwitterIntegration = new JButton(Messages.MSGTwitterIntegration.toString());
                this.btnTwitterIntegration.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 11));
                this.btnTwitterIntegration.addActionListener(e -> {
                        boolean authorizationStatus = TwitterIntegration.authorization();
-                       String updatedStatus = "デレステ課題曲セレクターで\n";
+                       String updatedStatus = Messages.MSGUsingThisAppPhrase.toString();
                        int lengthLimit = updatedStatus.length();
                        boolean isBroken = false;
                        if(!DelesteRandomSelector.this.integratorBool) {
-                               JOptionPane.showMessageDialog(null, "ちひろ「まだプレイを始めていないみたいですね」");
+                               JOptionPane.showMessageDialog(null, Messages.MSGNotPlayYet.toString());
                                return;
                        }
                        for (String element : DelesteRandomSelector.this.integratorArray) {
@@ -324,20 +324,20 @@ public class DelesteRandomSelector extends JFrame {
                                }
                        }
                        if(isBroken) {
-                               updatedStatus = updatedStatus + "…その他数曲\nをプレイしました!\n#DelesteRandomSelector #デレステ ";
+                               updatedStatus = updatedStatus + Messages.MSGTwitterPlayOtherwisePhrase.toString() + "\n#DelesteRandomSelector #デレステ ";
                        } else {
-                               updatedStatus = updatedStatus + "をプレイしました!\n#DelesteRandomSelector #デレステ ";
+                               updatedStatus = updatedStatus + Messages.MSGTwitterPlayOnlyPhrase.toString() + "\n#DelesteRandomSelector #デレステ ";
                        }
                        DelesteRandomSelector.this.logger.info("status message constructed.");
                        lengthLimit = updatedStatus.length();
                        if(authorizationStatus) {
-                               int option = JOptionPane.showConfirmDialog(null, "Twitterへ以下の内容を投稿します。よろしいですか?\n\n" + updatedStatus + "\n\n文字数:" + lengthLimit);
+                               int option = JOptionPane.showConfirmDialog(null, Messages.MSGTwitterIntegrationConfirm.toString() + updatedStatus + Messages.MSGStringLength.toString() + lengthLimit);
                                DelesteRandomSelector.this.logger.info("user seletced: " + option);
                                switch(option) {
                                case JOptionPane.OK_OPTION:
                                        TwitterIntegration.PostTwitter(updatedStatus);
                                        DelesteRandomSelector.this.logger.info("Success to update the status.");
-                                       JOptionPane.showMessageDialog(null, "投稿が完了しました。");
+                                       JOptionPane.showMessageDialog(null, Messages.MSGCompletePost.toString());
                                        break;
                                case JOptionPane.NO_OPTION:
                                        DelesteRandomSelector.this.logger.info("There is no will to post.");
@@ -354,13 +354,13 @@ public class DelesteRandomSelector extends JFrame {
                });
                this.panelEast.add(this.btnTwitterIntegration, "1, 11");
 
-               this.btnExit = new JButton("終了");
+               this.btnExit = new JButton(Messages.MSGTerminate.toString());
                this.btnExit.addActionListener(e -> {
                        if(DelesteRandomSelector.this.softwareUpdateFuture.isDone() || DelesteRandomSelector.this.albumTypeEstimateFuture.isDone()) {
                                DelesteRandomSelector.this.logger.info("Requested Exit by Button");
                                System.exit(0);
                        } else {
-                               JOptionPane.showMessageDialog(null, "内部更新処理が完了していません。少し待ってからやり直してください。");
+                               JOptionPane.showMessageDialog(null, Messages.MSGInternalYpdateNotDoneYet.toString());
                        }
                });
                this.btnExit.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));
@@ -371,7 +371,7 @@ public class DelesteRandomSelector extends JFrame {
                this.panelCentre.setLayout(new BorderLayout(0, 0));
 
                this.textArea = new JTextArea();
-               this.textArea.setText("楽曲選択の手順\r\n1.難易度、属性、レベルを選択する\r\n2.「楽曲取り込み」ボタンを押す!\r\n3.「開始」ボタンを押す!\r\n4.選択された楽曲がここに表示されます!\r\n現在設定されている楽曲選択の最大数:" + this.property.getSongLimit() + "\n現在のMASTER+アルバム周期(推定):" + this.albumType);
+               this.textArea.setText(Messages.MSGNarrowDownProcedure.toString() + this.property.getSongLimit() + Messages.MSGCurrentAlbumType.toString() + this.albumType);
                this.textArea.setEditable(false);
 
                this.scrollPane = new JScrollPane(this.textArea);
index 9235612..47300cc 100644 (file)
@@ -15,10 +15,6 @@ public enum Messages {
        MSGTitle,
        MSGSelectDifficulty,
        MSGNonSelected,
-       MSGAll,
-       MSGCute,
-       MSGCool,
-       MSGPassion,
        MSGSongLevel,
        MSGBelowSpecificLevel,
        MSGOverSpecificLevel,
index d4c6ecb..985fa7e 100644 (file)
@@ -26,6 +26,30 @@ public class LanguageTest {
                assertTrue(Messages.MSGDatabaseNotExist.toString().equals("楽曲データベースが見つかりませんでした。自動的に作成されます…\n注意:初回起動ではなく、かつ、Jarファイルと同じ階層に\"database.json\"というファイルが存在するにも関わらず\nこのポップアップが出た場合、開発者までご一報ください。\nGithub URL: https://github.com/hizumiaoba/DelesteRandomSelector/issues"));
                assertTrue(Messages.MSGAlbumTypeBeingCalculated.toString().equals("計算中..."));
                assertTrue(Messages.MSGNarrowingDownSongs.toString().equals("<html><body>楽曲<br>絞り込み</body></html>"));
+               assertTrue(Messages.MSGTitle.toString().equals("デレステ課題曲セレクター"));
+               assertTrue(Messages.MSGSelectDifficulty.toString().equals("難易度選択"));
+               assertTrue(Messages.MSGNonSelected.toString().equals("指定なし"));
+               assertTrue(Messages.MSGSongLevel.toString().equals("楽曲Lv"));
+               assertTrue(Messages.MSGBelowSpecificLevel.toString().equals("指定Lv以下"));
+               assertTrue(Messages.MSGOverSpecificLevel.toString().equals("指定Lv以上"));
+               assertTrue(Messages.MSGLevelCheckboxInfo.toString().equals("<html><body>以下以上両方にチェックをつけることで指定レベルのみ絞り込むことができます</body></html>"));
+               assertTrue(Messages.MSGUpdatingDatabase.toString().equals("<html><body>データベース<br>更新中…</body></html>"));
+               assertTrue(Messages.MSGCompleteNarrowDown.toString().equals("絞り込み完了!「開始」をクリックすることで選曲できます!"));
+               assertTrue(Messages.MSGNumberOfSongs.toString().equals("曲目:"));
+               assertTrue(Messages.MSGThisPhrase.toString().equals("この"));
+               assertTrue(Messages.MSGPlayPhrase.toString().equals("曲をプレイしましょう!!!"));
+               assertTrue(Messages.MSGTwitterIntegration.toString().equals("Twitter連携"));
+               assertTrue(Messages.MSGUsingThisAppPhrase.toString().equals("デレステ課題曲セレクターで\n"));
+               assertTrue(Messages.MSGNotPlayYet.toString().equals("ちひろ「まだプレイを始めていないみたいですね」"));
+               assertTrue(Messages.MSGTwitterPlayOtherwisePhrase.toString().equals("…その他数曲\nをプレイしました!\n"));
+               assertTrue(Messages.MSGTwitterPlayOnlyPhrase.toString().equals("をプレイしました!"));
+               assertTrue(Messages.MSGTwitterIntegrationConfirm.toString().equals("Twitterへ以下の内容を投稿します。よろしいですか?\n\n"));
+               assertTrue(Messages.MSGStringLength.toString().equals("\n\n文字数:"));
+               assertTrue(Messages.MSGCompletePost.toString().equals("投稿が完了しました。"));
+               assertTrue(Messages.MSGTerminate.toString().equals("終了"));
+               assertTrue(Messages.MSGInternalYpdateNotDoneYet.toString().equals("内部更新処理が完了していません。少し待ってからやり直してください。"));
+               assertTrue(Messages.MSGNarrowDownProcedure.toString().equals("楽曲選択の手順\r\n1.難易度、属性、レベルを選択する\r\n2.「楽曲取り込み」ボタンを押す!\r\n3.「開始」ボタンを押す!\r\n4.選択された楽曲がここに表示されます!\r\n現在設定されている楽曲選択の最大数:"));
+               assertTrue(Messages.MSGCurrentAlbumType.toString().equals("\n現在のMASTER+アルバム周期(推定):"));
        }
 
        @Test
@@ -38,6 +62,30 @@ public class LanguageTest {
                assertTrue(Messages.MSGDatabaseNotExist.toString().equals("Music database does not exist.\nIt will be automatically created.\nATTENTION:There is the JSON file named \"database.json\" in the same directory which executable is contained and you see this pop up,\nPlease contact the Developer.\nGithub URL: https://github.com/hizumiaoba/DelesteRandomSelector/issues"));
                assertTrue(Messages.MSGAlbumTypeBeingCalculated.toString().equals("Simulating..."));
                assertTrue(Messages.MSGNarrowingDownSongs.toString().equals("<html><body>Narrow down<br>songs</body></html>"));
+               assertTrue(Messages.MSGTitle.toString().equals("DelesteRandomSelector"));
+               assertTrue(Messages.MSGSelectDifficulty.toString().equals("Difficulty"));
+               assertTrue(Messages.MSGNonSelected.toString().equals("Non-Select"));
+               assertTrue(Messages.MSGSongLevel.toString().equals("Level"));
+               assertTrue(Messages.MSGBelowSpecificLevel.toString().equals("Below Lv"));
+               assertTrue(Messages.MSGOverSpecificLevel.toString().equals("Above Lv"));
+               assertTrue(Messages.MSGLevelCheckboxInfo.toString().equals("<html><body>Only specified level songs will be selected if you mark both checkbox.</body></html>"));
+               assertTrue(Messages.MSGUpdatingDatabase.toString().equals("<html><body>Updating<br>database</body></html>"));
+               assertTrue(Messages.MSGCompleteNarrowDown.toString().equals("Narrowing down complete! Click \"Start!\" to play!"));
+               assertTrue(Messages.MSGNumberOfSongs.toString().equals("tracks:"));
+               assertTrue(Messages.MSGThisPhrase.toString().equals("Let's play these"));
+               assertTrue(Messages.MSGPlayPhrase.toString().equals("songs!"));
+               assertTrue(Messages.MSGTwitterIntegration.toString().equals("<html><body>Post to Twitter</body></html>"));
+               assertTrue(Messages.MSGUsingThisAppPhrase.toString().equals("I played\n"));
+               assertTrue(Messages.MSGNotPlayYet.toString().equals("It seems that you don't start playing yet?"));
+               assertTrue(Messages.MSGTwitterPlayOtherwisePhrase.toString().equals("...and some songs!\n"));
+               assertTrue(Messages.MSGTwitterPlayOnlyPhrase.toString().equals("songs!"));
+               assertTrue(Messages.MSGTwitterIntegrationConfirm.toString().equals("Are you sure you want to post this?\n\n"));
+               assertTrue(Messages.MSGStringLength.toString().equals("\n\nNumber of Characters"));
+               assertTrue(Messages.MSGCompletePost.toString().equals("Complete to post."));
+               assertTrue(Messages.MSGTerminate.toString().equals("End"));
+               assertTrue(Messages.MSGInternalYpdateNotDoneYet.toString().equals("Internal update in progress. Please wait a moment."));
+               assertTrue(Messages.MSGNarrowDownProcedure.toString().equals("How to select songs\r\n1.Select difficulty, attribute, and level.\r\n2.Click [Narrow down songs] button.\r\n3.Click [start!] button.\r\n4.Selected songs will be shown here!\r\nThe maximum number of selected songs:"));
+               assertTrue(Messages.MSGCurrentAlbumType.toString().equals("\nCurrent MASTER+ ALBUM type(based on simulation):"));
        }
 
        @After