Skip to content

Commit

Permalink
Fixed correct wordings thai translation
Browse files Browse the repository at this point in the history
  • Loading branch information
droiddevgirl committed Aug 18, 2015
1 parent 107453d commit c573a23
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 50 deletions.
46 changes: 23 additions & 23 deletions core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_th.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,86 +10,86 @@ public class Resources_th extends ListResourceBundle
private static final Object[][] OBJECTS = new Object[][] {
{ "CenturyPattern", "%n %u" },
{ "CenturyFuturePrefix", "" },
{ "CenturyFutureSuffix", " ต่อจากนี้" },
{ "CenturyFutureSuffix", "ต่อจากนี้" },
{ "CenturyPastPrefix", "" },
{ "CenturyPastSuffix", " ที่แล้ว" },
{ "CenturyPastSuffix", "ก่อน" },
{ "CenturySingularName", "ศตวรรษ" },
{ "CenturyPluralName", "ศตวรรษ" },
{ "DayPattern", "%n %u" },
{ "DayFuturePrefix", "" },
{ "DayFutureSuffix", " ต่อจากนี้" },
{ "DayFutureSuffix", "ต่อจากนี้ี้" },
{ "DayPastPrefix", "" },
{ "DayPastSuffix", " ที่แล้ว" },
{ "DayPastSuffix", "ก่อน" },
{ "DaySingularName", "วัน" },
{ "DayPluralName", "วัน" },
{ "DecadePattern", "%n %u" },
{ "DecadeFuturePrefix", "" },
{ "DecadeFutureSuffix", " ต่อจากนี้" },
{ "DecadeFutureSuffix", "ต่อจากนี้" },
{ "DecadePastPrefix", "" },
{ "DecadePastSuffix", " ที่แล้ว" },
{ "DecadePastSuffix", "ก่อน" },
{ "DecadeSingularName", "ทศวรรษ" },
{ "DecadePluralName", "ทศวรรษ" },
{ "HourPattern", "%n %u" },
{ "HourFuturePrefix", "" },
{ "HourFutureSuffix", " ต่อจากนี้" },
{ "HourFutureSuffix", "ต่อจากนี้" },
{ "HourPastPrefix", "" },
{ "HourPastSuffix", " ที่แล้ว" },
{ "HourPastSuffix", "ก่อน" },
{ "HourSingularName", "ชั่วโมง" },
{ "HourPluralName", "ชั่วโมง" },
{ "JustNowPattern", "%u" },
{ "JustNowFuturePrefix", "" },
{ "JustNowFutureSuffix", "ชั่วขณะต่อจากนี้้" },
{ "JustNowFutureSuffix", "ชั่วขณะต่อจากนี้้ี้้" },
{ "JustNowPastPrefix", "ชั่วขณะก่อน" },
{ "JustNowPastSuffix", "" },
{ "JustNowSingularName", "" },
{ "JustNowPluralName", "" },
{ "MillenniumPattern", "%n %u" },
{ "MillenniumFuturePrefix", "" },
{ "MillenniumFutureSuffix", " ต่อจากนี้" },
{ "MillenniumFutureSuffix", "ต่อจากนี้" },
{ "MillenniumPastPrefix", "" },
{ "MillenniumPastSuffix", " ที่แล้ว" },
{ "MillenniumPastSuffix", "ก่อน" },
{ "MillenniumSingularName", "รอบพันปี" },
{ "MillenniumPluralName", "รอบพันปี" },
{ "MillisecondPattern", "%n %u" },
{ "MillisecondFuturePrefix", "" },
{ "MillisecondFutureSuffix", " ต่อจากนี้" },
{ "MillisecondFutureSuffix", "ต่อจากนี้" },
{ "MillisecondPastPrefix", "" },
{ "MillisecondPastSuffix", " ที่แล้ว" },
{ "MillisecondPastSuffix", "ก่อน" },
{ "MillisecondSingularName", "หนึ่งในพันของวินาที" },
{ "MillisecondPluralName", "หนึ่งในพันของวินาที" },
{ "MinutePattern", "%n %u" },
{ "MinuteFuturePrefix", "" },
{ "MinuteFutureSuffix", " ต่อจากนี้" },
{ "MinuteFutureSuffix", "ต่อจากนี้ี้" },
{ "MinutePastPrefix", "" },
{ "MinutePastSuffix", " ที่แล้ว" },
{ "MinutePastSuffix", "ก่อน" },
{ "MinuteSingularName", "นาที" },
{ "MinutePluralName", "นาที" },
{ "MonthPattern", "%n %u" },
{ "MonthFuturePrefix", "" },
{ "MonthFutureSuffix", " ต่อจากนี้" },
{ "MonthFutureSuffix", "ต่อจากนี้" },
{ "MonthPastPrefix", "" },
{ "MonthPastSuffix", " ที่แล้ว" },
{ "MonthPastSuffix", "ก่อน" },
{ "MonthSingularName", "เดือน" },
{ "MonthPluralName", "เดือน" },
{ "SecondPattern", "%n %u" },
{ "SecondFuturePrefix", "" },
{ "SecondFutureSuffix", " ต่อจากนี้" },
{ "SecondFutureSuffix", "ต่อจากนี้" },
{ "SecondPastPrefix", "" },
{ "SecondPastSuffix", " ที่แล้ว" },
{ "SecondPastSuffix", "ก่อน" },
{ "SecondSingularName", "วินาที" },
{ "SecondPluralName", "วินาที" },
{ "WeekPattern", "%n %u" },
{ "WeekFuturePrefix", "" },
{ "WeekFutureSuffix", " ต่อจากนี้" },
{ "WeekFutureSuffix", "ต่อจากนี้ี้" },
{ "WeekPastPrefix", "" },
{ "WeekPastSuffix", " ที่แล้ว" },
{ "WeekPastSuffix", "ก่อน" },
{ "WeekSingularName", "อาทิตย์" },
{ "WeekPluralName", "อาทิตย์" },
{ "YearPattern", "%n %u" },
{ "YearFuturePrefix", "" },
{ "YearFutureSuffix", " ต่อจากนี้" },
{ "YearFutureSuffix", "ต่อจากนี้" },
{ "YearPastPrefix", "" },
{ "YearPastSuffix", " ที่แล้ว" },
{ "YearPastSuffix", "ก่อน" },
{ "YearSingularName", "ปี" },
{ "YearPluralName", "ปี" },
{ "AbstractTimeUnitPattern", "" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,83 +19,81 @@ public class PrettyTimeI18n_TH_Test
@Before
public void setUp() throws Exception
{
locale = Locale.getDefault();
locale = new Locale("TH");
Locale.setDefault(locale);
}

@Test
public void testFromNow()
public void testLocaleISOCorrectness()
{
PrettyTime prettyTime = new PrettyTime(locale);
prettyTime.format(new Date());
Assert.assertEquals("ต่อจากนี้", prettyTime.format(new Date()));
assertEquals("th", this.locale.getLanguage());
assertEquals("ไทย", this.locale.getDisplayLanguage());
}

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

@Test
public void testNullDate() throws Exception
{
PrettyTime t = new PrettyTime();
Date date = null;
Assert.assertEquals("ต่อจากนี้", t.format(date));
assertEquals("ชั่วขณะต่อจากนี้้ี้้", t.format(date));
}

@Test
public void testPrettyTimeDefault()
{
PrettyTime p = new PrettyTime(new Date(0), Locale.ROOT);
assertEquals("ชั่วขณะต่อจากนี้้", p.format(new Date(1)));
PrettyTime p = new PrettyTime(locale);
assertEquals(p.format(new Date()), "ชั่วขณะต่อจากนี้้ี้้");
}

@Test
public void testMinutesFromNow() throws Exception
{
PrettyTime t = new PrettyTime(new Date(0));
Assert.assertEquals("12 นาทีต่อจากนี้", t.format(new Date(1000 * 60 * 12)));
assertEquals("12 นาที ต่อจากนี้ี้", t.format(new Date(1000 * 60 * 12)));
}

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

@Test
public void testDaysFromNow() throws Exception
{
PrettyTime t = new PrettyTime(new Date(0));
Assert.assertEquals("3 วันต่อจากนี้",
assertEquals("3 วัน ต่อจากนี้ี้",
t.format(new Date(1000 * 60 * 60 * 24 * 3)));
}

@Test
public void testWeeksFromNow() throws Exception
{
PrettyTime t = new PrettyTime(new Date(0));
Assert.assertEquals("3 อาทิตย์ต่อจากนี้",
assertEquals("3 อาทิตย์ ต่อจากนี้ี้",
t.format(new Date(1000 * 60 * 60 * 24 * 7 * 3)));
}

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

@Test
public void testCenturiesFromNow() throws Exception
{
PrettyTime t = new PrettyTime(new Date(0));
Assert.assertEquals("3 ทศวรรษต่อจากนี้",
assertEquals("3 ศตวรรษ ต่อจากนี้",
t.format(new Date(3155692597470L * 3L)));
}

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

@Test
public void testMinutesAgo() throws Exception
{
PrettyTime t = new PrettyTime(new Date(1000 * 60 * 12));
Assert.assertEquals("12 นาทีก่อน", t.format(new Date(0)));
assertEquals("12 นาที ก่อน", t.format(new Date(0)));
}

@Test
public void testHoursAgo() throws Exception
{
PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 3));
Assert.assertEquals("3 ชั่วโมงก่อน", t.format(new Date(0)));
assertEquals("3 ชั่วโมง ก่อน", t.format(new Date(0)));
}

@Test
public void testDaysAgo() throws Exception
{
PrettyTime t = new PrettyTime(new Date(1000 * 60 * 60 * 24 * 3));
Assert.assertEquals("3 วันก่อน", t.format(new Date(0)));
assertEquals("3 วัน ก่อน", t.format(new Date(0)));
}

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

@Test
public void testMonthsAgo() throws Exception
{
PrettyTime t = new PrettyTime(new Date(2629743830L * 3L));
Assert.assertEquals("3 เดือนก่อน", t.format(new Date(0)));
assertEquals("3 เดือน ก่อน", t.format(new Date(0)));
}

@Test
public void testDecadesAgo() throws Exception
{
PrettyTime t = new PrettyTime(new Date(315569259747L * 3L));
Assert.assertEquals("3 ทศวรรษก่อน", t.format(new Date(0)));
assertEquals("3 ทศวรรษ ก่อน", t.format(new Date(0)));
}

@Test
public void testCenturiesAgo() throws Exception
{
PrettyTime t = new PrettyTime(new Date(3155692597470L * 3L));
Assert.assertEquals("3 ศตวรรษก่อน", t.format(new Date(0)));
assertEquals("3 ศตวรรษ ก่อน", t.format(new Date(0)));
}

@After
Expand Down

0 comments on commit c573a23

Please sign in to comment.