Skip to content

Commit c573a23

Browse files
committed
Fixed correct wordings thai translation
1 parent 107453d commit c573a23

2 files changed

Lines changed: 48 additions & 50 deletions

File tree

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

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,86 +10,86 @@ public class Resources_th extends ListResourceBundle
1010
private static final Object[][] OBJECTS = new Object[][] {
1111
{ "CenturyPattern", "%n %u" },
1212
{ "CenturyFuturePrefix", "" },
13-
{ "CenturyFutureSuffix", " ต่อจากนี้" },
13+
{ "CenturyFutureSuffix", "ต่อจากนี้" },
1414
{ "CenturyPastPrefix", "" },
15-
{ "CenturyPastSuffix", " ที่แล้ว" },
15+
{ "CenturyPastSuffix", "ก่อน" },
1616
{ "CenturySingularName", "ศตวรรษ" },
1717
{ "CenturyPluralName", "ศตวรรษ" },
1818
{ "DayPattern", "%n %u" },
1919
{ "DayFuturePrefix", "" },
20-
{ "DayFutureSuffix", " ต่อจากนี้" },
20+
{ "DayFutureSuffix", "ต่อจากนี้ี้" },
2121
{ "DayPastPrefix", "" },
22-
{ "DayPastSuffix", " ที่แล้ว" },
22+
{ "DayPastSuffix", "ก่อน" },
2323
{ "DaySingularName", "วัน" },
2424
{ "DayPluralName", "วัน" },
2525
{ "DecadePattern", "%n %u" },
2626
{ "DecadeFuturePrefix", "" },
27-
{ "DecadeFutureSuffix", " ต่อจากนี้" },
27+
{ "DecadeFutureSuffix", "ต่อจากนี้" },
2828
{ "DecadePastPrefix", "" },
29-
{ "DecadePastSuffix", " ที่แล้ว" },
29+
{ "DecadePastSuffix", "ก่อน" },
3030
{ "DecadeSingularName", "ทศวรรษ" },
3131
{ "DecadePluralName", "ทศวรรษ" },
3232
{ "HourPattern", "%n %u" },
3333
{ "HourFuturePrefix", "" },
34-
{ "HourFutureSuffix", " ต่อจากนี้" },
34+
{ "HourFutureSuffix", "ต่อจากนี้" },
3535
{ "HourPastPrefix", "" },
36-
{ "HourPastSuffix", " ที่แล้ว" },
36+
{ "HourPastSuffix", "ก่อน" },
3737
{ "HourSingularName", "ชั่วโมง" },
3838
{ "HourPluralName", "ชั่วโมง" },
3939
{ "JustNowPattern", "%u" },
4040
{ "JustNowFuturePrefix", "" },
41-
{ "JustNowFutureSuffix", "ชั่วขณะต่อจากนี้้" },
41+
{ "JustNowFutureSuffix", "ชั่วขณะต่อจากนี้้ี้้" },
4242
{ "JustNowPastPrefix", "ชั่วขณะก่อน" },
4343
{ "JustNowPastSuffix", "" },
4444
{ "JustNowSingularName", "" },
4545
{ "JustNowPluralName", "" },
4646
{ "MillenniumPattern", "%n %u" },
4747
{ "MillenniumFuturePrefix", "" },
48-
{ "MillenniumFutureSuffix", " ต่อจากนี้" },
48+
{ "MillenniumFutureSuffix", "ต่อจากนี้" },
4949
{ "MillenniumPastPrefix", "" },
50-
{ "MillenniumPastSuffix", " ที่แล้ว" },
50+
{ "MillenniumPastSuffix", "ก่อน" },
5151
{ "MillenniumSingularName", "รอบพันปี" },
5252
{ "MillenniumPluralName", "รอบพันปี" },
5353
{ "MillisecondPattern", "%n %u" },
5454
{ "MillisecondFuturePrefix", "" },
55-
{ "MillisecondFutureSuffix", " ต่อจากนี้" },
55+
{ "MillisecondFutureSuffix", "ต่อจากนี้" },
5656
{ "MillisecondPastPrefix", "" },
57-
{ "MillisecondPastSuffix", " ที่แล้ว" },
57+
{ "MillisecondPastSuffix", "ก่อน" },
5858
{ "MillisecondSingularName", "หนึ่งในพันของวินาที" },
5959
{ "MillisecondPluralName", "หนึ่งในพันของวินาที" },
6060
{ "MinutePattern", "%n %u" },
6161
{ "MinuteFuturePrefix", "" },
62-
{ "MinuteFutureSuffix", " ต่อจากนี้" },
62+
{ "MinuteFutureSuffix", "ต่อจากนี้ี้" },
6363
{ "MinutePastPrefix", "" },
64-
{ "MinutePastSuffix", " ที่แล้ว" },
64+
{ "MinutePastSuffix", "ก่อน" },
6565
{ "MinuteSingularName", "นาที" },
6666
{ "MinutePluralName", "นาที" },
6767
{ "MonthPattern", "%n %u" },
6868
{ "MonthFuturePrefix", "" },
69-
{ "MonthFutureSuffix", " ต่อจากนี้" },
69+
{ "MonthFutureSuffix", "ต่อจากนี้" },
7070
{ "MonthPastPrefix", "" },
71-
{ "MonthPastSuffix", " ที่แล้ว" },
71+
{ "MonthPastSuffix", "ก่อน" },
7272
{ "MonthSingularName", "เดือน" },
7373
{ "MonthPluralName", "เดือน" },
7474
{ "SecondPattern", "%n %u" },
7575
{ "SecondFuturePrefix", "" },
76-
{ "SecondFutureSuffix", " ต่อจากนี้" },
76+
{ "SecondFutureSuffix", "ต่อจากนี้" },
7777
{ "SecondPastPrefix", "" },
78-
{ "SecondPastSuffix", " ที่แล้ว" },
78+
{ "SecondPastSuffix", "ก่อน" },
7979
{ "SecondSingularName", "วินาที" },
8080
{ "SecondPluralName", "วินาที" },
8181
{ "WeekPattern", "%n %u" },
8282
{ "WeekFuturePrefix", "" },
83-
{ "WeekFutureSuffix", " ต่อจากนี้" },
83+
{ "WeekFutureSuffix", "ต่อจากนี้ี้" },
8484
{ "WeekPastPrefix", "" },
85-
{ "WeekPastSuffix", " ที่แล้ว" },
85+
{ "WeekPastSuffix", "ก่อน" },
8686
{ "WeekSingularName", "อาทิตย์" },
8787
{ "WeekPluralName", "อาทิตย์" },
8888
{ "YearPattern", "%n %u" },
8989
{ "YearFuturePrefix", "" },
90-
{ "YearFutureSuffix", " ต่อจากนี้" },
90+
{ "YearFutureSuffix", "ต่อจากนี้" },
9191
{ "YearPastPrefix", "" },
92-
{ "YearPastSuffix", " ที่แล้ว" },
92+
{ "YearPastSuffix", "ก่อน" },
9393
{ "YearSingularName", "ปี" },
9494
{ "YearPluralName", "ปี" },
9595
{ "AbstractTimeUnitPattern", "" },

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

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,83 +19,81 @@ public class PrettyTimeI18n_TH_Test
1919
@Before
2020
public void setUp() throws Exception
2121
{
22-
locale = Locale.getDefault();
22+
locale = new Locale("TH");
23+
Locale.setDefault(locale);
2324
}
2425

2526
@Test
26-
public void testFromNow()
27+
public void testLocaleISOCorrectness()
2728
{
28-
PrettyTime prettyTime = new PrettyTime(locale);
29-
prettyTime.format(new Date());
30-
Assert.assertEquals("ต่อจากนี้", prettyTime.format(new Date()));
29+
assertEquals("th", this.locale.getLanguage());
30+
assertEquals("ไทย", this.locale.getDisplayLanguage());
3131
}
3232

3333
@Test
34-
public void testCeilingInterval() throws Exception
34+
public void testFromNow()
3535
{
36-
Date then = format.parse("7/8/2015");
37-
Date ref = format.parse("8/7/2015");
38-
PrettyTime t = new PrettyTime(ref);
39-
Assert.assertEquals("1 เดือนก่อน", t.format(then));
36+
PrettyTime prettyTime = new PrettyTime(locale);
37+
assertEquals("ชั่วขณะต่อจากนี้้ี้้", prettyTime.format(new Date()));
4038
}
4139

4240
@Test
4341
public void testNullDate() throws Exception
4442
{
4543
PrettyTime t = new PrettyTime();
4644
Date date = null;
47-
Assert.assertEquals("ต่อจากนี้", t.format(date));
45+
assertEquals("ชั่วขณะต่อจากนี้้ี้้", t.format(date));
4846
}
4947

5048
@Test
5149
public void testPrettyTimeDefault()
5250
{
53-
PrettyTime p = new PrettyTime(new Date(0), Locale.ROOT);
54-
assertEquals("ชั่วขณะต่อจากนี้้", p.format(new Date(1)));
51+
PrettyTime p = new PrettyTime(locale);
52+
assertEquals(p.format(new Date()), "ชั่วขณะต่อจากนี้้ี้้");
5553
}
5654

5755
@Test
5856
public void testMinutesFromNow() throws Exception
5957
{
6058
PrettyTime t = new PrettyTime(new Date(0));
61-
Assert.assertEquals("12 นาทีต่อจากนี้", t.format(new Date(1000 * 60 * 12)));
59+
assertEquals("12 นาที ต่อจากนี้ี้", t.format(new Date(1000 * 60 * 12)));
6260
}
6361

6462
@Test
6563
public void testHoursFromNow() throws Exception
6664
{
6765
PrettyTime t = new PrettyTime(new Date(0));
68-
Assert.assertEquals("3 ชั่วโมงต่อจากนี้", t.format(new Date(1000 * 60 * 60 * 3)));
66+
assertEquals("3 ชั่วโมง ต่อจากนี้", t.format(new Date(1000 * 60 * 60 * 3)));
6967
}
7068

7169
@Test
7270
public void testDaysFromNow() throws Exception
7371
{
7472
PrettyTime t = new PrettyTime(new Date(0));
75-
Assert.assertEquals("3 วันต่อจากนี้",
73+
assertEquals("3 วัน ต่อจากนี้ี้",
7674
t.format(new Date(1000 * 60 * 60 * 24 * 3)));
7775
}
7876

7977
@Test
8078
public void testWeeksFromNow() throws Exception
8179
{
8280
PrettyTime t = new PrettyTime(new Date(0));
83-
Assert.assertEquals("3 อาทิตย์ต่อจากนี้",
81+
assertEquals("3 อาทิตย์ ต่อจากนี้ี้",
8482
t.format(new Date(1000 * 60 * 60 * 24 * 7 * 3)));
8583
}
8684

8785
@Test
8886
public void testMonthsFromNow() throws Exception
8987
{
9088
PrettyTime t = new PrettyTime(new Date(0));
91-
Assert.assertEquals("3 เดือนต่อจากนี้", t.format(new Date(2629743830L * 3L)));
89+
assertEquals("3 เดือน ต่อจากนี้", t.format(new Date(2629743830L * 3L)));
9290
}
9391

9492
@Test
9593
public void testCenturiesFromNow() throws Exception
9694
{
9795
PrettyTime t = new PrettyTime(new Date(0));
98-
Assert.assertEquals("3 ทศวรรษต่อจากนี้",
96+
assertEquals("3 ศตวรรษ ต่อจากนี้",
9997
t.format(new Date(3155692597470L * 3L)));
10098
}
10199

@@ -106,56 +104,56 @@ public void testCenturiesFromNow() throws Exception
106104
public void testMomentsAgo() throws Exception
107105
{
108106
PrettyTime t = new PrettyTime(new Date(6000));
109-
Assert.assertEquals("ชั่วขณะก่อน", t.format(new Date(0)));
107+
assertEquals("ชั่วขณะก่อน", t.format(new Date(0)));
110108
}
111109

112110
@Test
113111
public void testMinutesAgo() throws Exception
114112
{
115113
PrettyTime t = new PrettyTime(new Date(1000 * 60 * 12));
116-
Assert.assertEquals("12 นาทีก่อน", t.format(new Date(0)));
114+
assertEquals("12 นาที ก่อน", t.format(new Date(0)));
117115
}
118116

119117
@Test
120118
public void testHoursAgo() throws Exception
121119
{
122120
PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 3));
123-
Assert.assertEquals("3 ชั่วโมงก่อน", t.format(new Date(0)));
121+
assertEquals("3 ชั่วโมง ก่อน", t.format(new Date(0)));
124122
}
125123

126124
@Test
127125
public void testDaysAgo() throws Exception
128126
{
129127
PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 24 * 3));
130-
Assert.assertEquals("3 วันก่อน", t.format(new Date(0)));
128+
assertEquals("3 วัน ก่อน", t.format(new Date(0)));
131129
}
132130

133131
@Test
134132
public void testWeeksAgo() throws Exception
135133
{
136134
PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 24 * 7 * 3));
137-
Assert.assertEquals("3 อาทิตย์ก่อน", t.format(new Date(0)));
135+
assertEquals("3 อาทิตย์ ก่อน", t.format(new Date(0)));
138136
}
139137

140138
@Test
141139
public void testMonthsAgo() throws Exception
142140
{
143141
PrettyTime t = new PrettyTime(new Date(2629743830L * 3L));
144-
Assert.assertEquals("3 เดือนก่อน", t.format(new Date(0)));
142+
assertEquals("3 เดือน ก่อน", t.format(new Date(0)));
145143
}
146144

147145
@Test
148146
public void testDecadesAgo() throws Exception
149147
{
150148
PrettyTime t = new PrettyTime(new Date(315569259747L * 3L));
151-
Assert.assertEquals("3 ทศวรรษก่อน", t.format(new Date(0)));
149+
assertEquals("3 ทศวรรษ ก่อน", t.format(new Date(0)));
152150
}
153151

154152
@Test
155153
public void testCenturiesAgo() throws Exception
156154
{
157155
PrettyTime t = new PrettyTime(new Date(3155692597470L * 3L));
158-
Assert.assertEquals("3 ศตวรรษก่อน", t.format(new Date(0)));
156+
assertEquals("3 ศตวรรษ ก่อน", t.format(new Date(0)));
159157
}
160158

161159
@After

0 commit comments

Comments
 (0)