11package org .ocpsoft .prettytime .i18n ;
22
3- import org .ocpsoft .prettytime .Duration ;
4- import org .ocpsoft .prettytime .TimeFormat ;
5- import org .ocpsoft .prettytime .TimeUnit ;
6- import org .ocpsoft .prettytime .impl .TimeFormatProvider ;
7-
83import java .util .ListResourceBundle ;
94import java .util .ResourceBundle ;
105import java .util .concurrent .ConcurrentHashMap ;
116import java .util .concurrent .ConcurrentMap ;
127
8+ import org .ocpsoft .prettytime .Duration ;
9+ import org .ocpsoft .prettytime .TimeFormat ;
10+ import org .ocpsoft .prettytime .TimeUnit ;
11+ import org .ocpsoft .prettytime .impl .TimeFormatProvider ;
12+ import org .ocpsoft .prettytime .units .Decade ;
13+ import org .ocpsoft .prettytime .units .Millennium ;
14+
1315public class Resources_ja extends ListResourceBundle implements TimeFormatProvider
1416{
1517 private static final Object [][] OBJECTS = new Object [][] {
1618 { "CenturyPattern" , "%n%u" },
1719 { "CenturyFuturePrefix" , "今から" },
18- { "CenturyFutureSuffix" , "世紀にもわたっ " },
20+ { "CenturyFutureSuffix" , "後 " },
1921 { "CenturyPastPrefix" , "" },
20- { "CenturyPastSuffix" , "世紀前 " },
21- { "CenturySingularName" , "" },
22- { "CenturyPluralName" , "" },
22+ { "CenturyPastSuffix" , "前 " },
23+ { "CenturySingularName" , "世紀 " },
24+ { "CenturyPluralName" , "世紀 " },
2325 { "DayPattern" , "%n%u" },
2426 { "DayFuturePrefix" , "今から" },
25- { "DayFutureSuffix" , "間 " },
27+ { "DayFutureSuffix" , "後 " },
2628 { "DayPastPrefix" , "" },
2729 { "DayPastSuffix" , "前" },
2830 { "DaySingularName" , "日" },
2931 { "DayPluralName" , "日" },
3032 { "DecadePattern" , "%n%u" },
3133 { "DecadeFuturePrefix" , "今から" },
32- { "DecadeFutureSuffix" , "年間 " },
34+ { "DecadeFutureSuffix" , "後 " },
3335 { "DecadePastPrefix" , "" },
34- { "DecadePastSuffix" , "年前 " },
35- { "DecadeSingularName" , "" },
36- { "DecadePluralName" , "" },
36+ { "DecadePastSuffix" , "前 " },
37+ { "DecadeSingularName" , "年 " },
38+ { "DecadePluralName" , "年 " },
3739 { "HourPattern" , "%n%u" },
3840 { "HourFuturePrefix" , "今から" },
39- { "HourFutureSuffix" , "" },
41+ { "HourFutureSuffix" , "後 " },
4042 { "HourPastPrefix" , "" },
4143 { "HourPastSuffix" , "前" },
4244 { "HourSingularName" , "時間" },
4345 { "HourPluralName" , "時間" },
4446 { "JustNowPattern" , "%u" },
45- { "JustNowFuturePrefix" , "" },
46- { "JustNowFutureSuffix" , "今からすぐ " },
47+ { "JustNowFuturePrefix" , "今から " },
48+ { "JustNowFutureSuffix" , "すぐ " },
4749 { "JustNowPastPrefix" , "" },
48- { "JustNowPastSuffix" , "さっき " },
50+ { "JustNowPastSuffix" , "たった今 " },
4951 { "JustNowSingularName" , "" },
5052 { "JustNowPluralName" , "" },
51- { "MillenniumPattern" , "%n %u" },
52- { "MillenniumFuturePrefix" , "" },
53- { "MillenniumFutureSuffix" , "今から " },
53+ { "MillenniumPattern" , "%n%u" },
54+ { "MillenniumFuturePrefix" , "今から " },
55+ { "MillenniumFutureSuffix" , "後 " },
5456 { "MillenniumPastPrefix" , "" },
5557 { "MillenniumPastSuffix" , "前" },
56- { "MillenniumSingularName" , "千年 " },
57- { "MillenniumPluralName" , "千年 " },
58+ { "MillenniumSingularName" , "年 " },
59+ { "MillenniumPluralName" , "年 " },
5860 { "MillisecondPattern" , "%n%u" },
5961 { "MillisecondFuturePrefix" , "" },
6062 { "MillisecondFutureSuffix" , "今から" },
@@ -64,14 +66,14 @@ public class Resources_ja extends ListResourceBundle implements TimeFormatProvid
6466 { "MillisecondPluralName" , "ミリ秒" },
6567 { "MinutePattern" , "%n%u" },
6668 { "MinuteFuturePrefix" , "今から" },
67- { "MinuteFutureSuffix" , "" },
69+ { "MinuteFutureSuffix" , "後 " },
6870 { "MinutePastPrefix" , "" },
6971 { "MinutePastSuffix" , "前" },
7072 { "MinuteSingularName" , "分" },
7173 { "MinutePluralName" , "分" },
7274 { "MonthPattern" , "%n%u" },
7375 { "MonthFuturePrefix" , "今から" },
74- { "MonthFutureSuffix" , "" },
76+ { "MonthFutureSuffix" , "後 " },
7577 { "MonthPastPrefix" , "" },
7678 { "MonthPastSuffix" , "前" },
7779 { "MonthSingularName" , "ヶ月" },
@@ -85,18 +87,18 @@ public class Resources_ja extends ListResourceBundle implements TimeFormatProvid
8587 { "SecondPluralName" , "秒" },
8688 { "WeekPattern" , "%n%u" },
8789 { "WeekFuturePrefix" , "今から" },
88- { "WeekFutureSuffix" , "週間 " },
90+ { "WeekFutureSuffix" , "後 " },
8991 { "WeekPastPrefix" , "" },
90- { "WeekPastSuffix" , "週間前 " },
91- { "WeekSingularName" , "" },
92- { "WeekPluralName" , "" },
92+ { "WeekPastSuffix" , "前 " },
93+ { "WeekSingularName" , "週間 " },
94+ { "WeekPluralName" , "週間 " },
9395 { "YearPattern" , "%n%u" },
94- { "YearFuturePrefix" , "" },
95- { "YearFutureSuffix" , "年後の " },
96+ { "YearFuturePrefix" , "今から " },
97+ { "YearFutureSuffix" , "後 " },
9698 { "YearPastPrefix" , "" },
97- { "YearPastSuffix" , "年前 " },
98- { "YearSingularName" , "" },
99- { "YearPluralName" , "" },
99+ { "YearPastSuffix" , "前 " },
100+ { "YearSingularName" , "年 " },
101+ { "YearPluralName" , "年 " },
100102 { "AbstractTimeUnitPattern" , "" },
101103 { "AbstractTimeUnitFuturePrefix" , "" },
102104 { "AbstractTimeUnitFutureSuffix" , "" },
@@ -199,6 +201,8 @@ private String format(final Duration duration, final boolean round)
199201 String sign = getSign (duration );
200202 String unit = getGramaticallyCorrectName (duration , round );
201203 long quantity = getQuantity (duration , round );
204+ if (duration .getUnit () instanceof Decade ) quantity *= 10 ;
205+ if (duration .getUnit () instanceof Millennium ) quantity *= 1000 ;
202206
203207 return applyPattern (sign , unit , quantity );
204208 }
@@ -208,6 +212,7 @@ private String applyPattern(final String sign, final String unit, final long qua
208212 String result = getPattern (quantity ).replaceAll (SIGN , sign );
209213 result = result .replaceAll (QUANTITY , String .valueOf (quantity ));
210214 result = result .replaceAll (UNIT , unit );
215+
211216 return result ;
212217 }
213218
@@ -380,4 +385,4 @@ public String toString()
380385 }
381386
382387 }
383- }
388+ }
0 commit comments