• R/O
  • SSH
  • HTTPS

aoiro: Commit


Commit MetaInfo

Revisão23 (tree)
Hora2019-02-25 19:20:34
Autorhirukawa_ryo

Mensagem de Log

* aoiro jlinkでjreを作成すると元号がHeiseiのようにローマ字で出力されてしまう問題への対応としてSystem.setProperty("java.locale.providers", "HOST,SPI,CLDR,COMPAT")をコードで設定するようにしました。

Mudança Sumário

Diff

--- aoiro/trunk/src/main/java/net/osdn/aoiro/Util.java (revision 22)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/Util.java (revision 23)
@@ -65,20 +65,4 @@
6565 public static Locale getLocale() {
6666 return locale;
6767 }
68-
69- /** アルファベット表記の元号を漢字に置換します。
70- * Java11のjlinkを使ってjreを作成すると、元号が漢字ではなくアルファベットになってしまうため。
71- * 原因を調べないと・・・。
72- *
73- * @param s 元号を含む文字列
74- * @return 元号を漢字に置換した文字列
75- */
76- public static String replaceWareki(String s) {
77- //FIXME:
78- return s
79- .replace("Meiji", "明治")
80- .replace("Taisho", "大正")
81- .replace("Showa", "昭和")
82- .replace("Heisei", "平成");
83- }
8468 }
--- aoiro/trunk/src/main/java/net/osdn/aoiro/cui/Main.java (revision 22)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/cui/Main.java (revision 23)
@@ -29,8 +29,13 @@
2929 public class Main {
3030
3131 public static void main(String[] args) {
32+
33+ if(System.getProperty("java.locale.providers") == null) {
34+ System.setProperty("java.locale.providers", "HOST,SPI,CLDR,COMPAT");
35+ }
36+ System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
37+
3238 try {
33- System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");
3439
3540 boolean skipSettlement = false;
3641 Boolean isSoloProprietorship = null;
--- aoiro/trunk/src/main/java/net/osdn/aoiro/report/BalanceSheet.java (revision 22)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/report/BalanceSheet.java (revision 23)
@@ -11,9 +11,6 @@
1111 import java.nio.charset.StandardCharsets;
1212 import java.text.DateFormat;
1313 import java.text.SimpleDateFormat;
14-import java.time.chrono.JapaneseChronology;
15-import java.time.chrono.JapaneseDate;
16-import java.time.format.DateTimeFormatter;
1714 import java.util.ArrayList;
1815 import java.util.Calendar;
1916 import java.util.Date;
@@ -248,11 +245,6 @@
248245 String closingMonth = Integer.toString(calendar.get(Calendar.MONTH) + 1);
249246 String closingDay = Integer.toString(calendar.get(Calendar.DAY_OF_MONTH));
250247
251- //FIXME:
252- openingDate = Util.replaceWareki(openingDate);
253- closingDate = Util.replaceWareki(closingDate);
254-
255-
256248 printData = new ArrayList<String>();
257249 printData.add("\\media A4");
258250
--- aoiro/trunk/src/main/java/net/osdn/aoiro/report/ProfitAndLoss.java (revision 22)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/report/ProfitAndLoss.java (revision 23)
@@ -253,11 +253,6 @@
253253 String openingDate = df.format(this.openingDate).replace(" 1 年", "元年");
254254 String closingDate = df.format(this.closingDate).replace(" 1 年", "元年");
255255
256- //FIXME:
257- openingDate = Util.replaceWareki(openingDate);
258- closingDate = Util.replaceWareki(closingDate);
259-
260-
261256 printData = new ArrayList<String>();
262257 printData.add("\\media A4");
263258
--- aoiro/trunk/src/main/java/net/osdn/aoiro/report/StatementOfChangesInEquity.java (revision 22)
+++ aoiro/trunk/src/main/java/net/osdn/aoiro/report/StatementOfChangesInEquity.java (revision 23)
@@ -376,10 +376,6 @@
376376 String openingDate = df.format(this.openingDate).replace(" 1 年", "元年");
377377 String closingDate = df.format(this.closingDate).replace(" 1 年", "元年");
378378
379- //FIXME:
380- openingDate = Util.replaceWareki(openingDate);
381- closingDate = Util.replaceWareki(closingDate);
382-
383379 printData = new ArrayList<String>();
384380 printData.add("\\media A4");
385381
Show on old repository browser