Skip to content

Commit 34e991a

Browse files
committed
Fix Japanese translation (typo).
2 parents efbcd62 + 6e3a422 commit 34e991a

3 files changed

Lines changed: 50 additions & 6 deletions

File tree

‎core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_es.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public class Resources_es extends ListResourceBundle
6161
{ "MillenniumFutureSuffix", "" },
6262
{ "MillenniumPastPrefix", "hace " },
6363
{ "MillenniumPastSuffix", "" },
64-
{ "MillenniumSingularName", "milenario" },
65-
{ "MillenniumPluralName", "milenarios" },
64+
{ "MillenniumSingularName", "milenio" },
65+
{ "MillenniumPluralName", "milenios" },
6666
{ "MillisecondPattern", "%n %u" },
6767
{ "MillisecondFuturePrefix", "dentro de " },
6868
{ "MillisecondFutureSuffix", "" },

‎core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_ja.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public class Resources_ja extends ListResourceBundle implements TimeFormatProvid
5858
{ "MillenniumSingularName", "年" },
5959
{ "MillenniumPluralName", "年" },
6060
{ "MillisecondPattern", "%n%u" },
61-
{ "MillisecondFuturePrefix", "" },
62-
{ "MillisecondFutureSuffix", "今から" },
61+
{ "MillisecondFuturePrefix", "今から" },
62+
{ "MillisecondFutureSuffix", "後" },
6363
{ "MillisecondPastPrefix", "" },
6464
{ "MillisecondPastSuffix", "前" },
6565
{ "MillisecondSingularName", "ミリ秒" },
@@ -79,8 +79,8 @@ public class Resources_ja extends ListResourceBundle implements TimeFormatProvid
7979
{ "MonthSingularName", "ヶ月" },
8080
{ "MonthPluralName", "ヶ月" },
8181
{ "SecondPattern", "%n%u" },
82-
{ "SecondFuturePrefix", "" },
83-
{ "SecondFutureSuffix", "今から" },
82+
{ "SecondFuturePrefix", "今から" },
83+
{ "SecondFutureSuffix", "後" },
8484
{ "SecondPastPrefix", "" },
8585
{ "SecondPastSuffix", "前" },
8686
{ "SecondSingularName", "秒" },

‎core/src/test/java/org/ocpsoft/prettytime/PrettyTimeI18n_JA_Test.java‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,29 @@ public void testRightNowVariance() throws Exception
5656
assertEquals("今からすぐ", t.format(new Date(600)));
5757
}
5858

59+
@Test
60+
public void testMillisecondsFromNow() throws Exception
61+
{
62+
PrettyTime t = new PrettyTime(new Date(0), locale);
63+
t.removeUnit(org.ocpsoft.prettytime.units.JustNow.class);
64+
// 450 milliseconds from now
65+
assertEquals("450 milliseconds from now", "今から450ミリ秒後", t.format(new Date(450L)));
66+
}
67+
68+
@Test
69+
public void testSecondsFromNow() throws Exception
70+
{
71+
PrettyTime t = new PrettyTime(new Date(0), locale);
72+
t.removeUnit(org.ocpsoft.prettytime.units.JustNow.class);
73+
// 36 seconds from now
74+
assertEquals("36 seconds from now", "今から36秒後", t.format(new Date(1000L * 36L)));
75+
t.removeUnit(org.ocpsoft.prettytime.units.Millisecond.class);
76+
// 1 second from now
77+
assertEquals("1 second from now", "今から1秒後", t.format(new Date(10)));
78+
// 1 second from now
79+
assertEquals("1 second from now", "今から1秒後", t.formatUnrounded(new Date(10)));
80+
}
81+
5982
@Test
6083
public void testMinutesFromNow() throws Exception
6184
{
@@ -139,6 +162,27 @@ public void testMomentsAgo() throws Exception
139162
assertEquals("たった今", t.format(new Date(0)));
140163
}
141164

165+
@Test
166+
public void testMillisecondsAgo() throws Exception
167+
{
168+
PrettyTime t = new PrettyTime(new Date(450L), locale);
169+
t.removeUnit(org.ocpsoft.prettytime.units.JustNow.class);
170+
// 450 milliseconds ago
171+
assertEquals("450 milliseconds ago", "450ミリ秒前", t.format(new Date(0)));
172+
}
173+
174+
@Test
175+
public void testSecondsAgo() throws Exception
176+
{
177+
PrettyTime t = new PrettyTime(new Date(1000 * 36), locale);
178+
t.removeUnit(org.ocpsoft.prettytime.units.JustNow.class);
179+
// 36 seconds ago
180+
assertEquals("36 seconds ago", "36秒前", t.format(new Date(0)));
181+
t.setReference(new Date(10)).removeUnit(org.ocpsoft.prettytime.units.Millisecond.class);
182+
// 1 second ago
183+
assertEquals("1 second ago", "1秒前", t.format(new Date(0)));
184+
}
185+
142186
@Test
143187
public void testMinutesAgo() throws Exception
144188
{

0 commit comments

Comments
 (0)