Vietnamese resource bundle for PrettyTime
Posted on 9:48 AM under 2 comments
I've just come across a Grails plugin called PrettyTime and I find it's really interesting library. Basically, it's utility library to format Date/Time value in a human-friendly form (eg: "right now", "two days ago", "3 months from now"...), it also supports localization for many languages but Vietnamese. So I decide to write a small resource bundle class for it.
Hopefully they will integrate this snippet into the next release of PrettyTime.
package com.ocpsoft.pretty.time.i18n; import java.util.ListResourceBundle; public class Resources_vi extends ListResourceBundle { private static final Object[][] OBJECTS = new Object[][] { { "CenturyPattern", "%n %u" }, { "CenturyFuturePrefix", "" }, { "CenturyFutureSuffix", " sau" }, { "CenturyPastPrefix", "cách đây " }, { "CenturyPastSuffix", "" }, { "CenturyName", "thế kỷ" }, { "CenturyPluralName", "thế kỷ" }, { "DayPattern", "%n %u" }, { "DayFuturePrefix", "" }, { "DayFutureSuffix", " sau" }, { "DayPastPrefix", "cách đây " }, { "DayPastSuffix", "" }, { "DayName", "ngày" }, { "DayPluralName", "ngày" }, { "DecadePattern", "%n %u" }, { "DecadeFuturePrefix", "" }, { "DecadeFutureSuffix", " sau" }, { "DecadePastPrefix", "cách đây " }, { "DecadePastSuffix", "" }, { "DecadeName", "thập kỷ" }, { "DecadePluralName", "thập kỷ" }, { "HourPattern", "%n %u" }, { "HourFuturePrefix", "" }, { "HourFutureSuffix", " sau" }, { "HourPastPrefix", "cách đây " }, { "HourPastSuffix", "" }, { "HourName", "giờ" }, { "HourPluralName", "giờ" }, { "JustNowPattern", "%u" }, { "JustNowFuturePrefix", "" }, { "JustNowFutureSuffix", " khắc sau" }, { "JustNowPastPrefix", "cách đây " }, { "JustNowPastSuffix", " khắc" }, { "JustNowName", "" }, { "JustNowPluralName", "" }, { "MillenniumPattern", "%n %u" }, { "MillenniumFuturePrefix", "" }, { "MillenniumFutureSuffix", " sau" }, { "MillenniumPastPrefix", "cách đây " }, { "MillenniumPastSuffix", "" }, { "MillenniumName", "thiên niên kỷ" }, { "MillenniumPluralName", "thiên niên kỷ" }, { "MillisecondPattern", "%n %u" }, { "MillisecondFuturePrefix", "" }, { "MillisecondFutureSuffix", " sau" }, { "MillisecondPastPrefix", "cách đây " }, { "MillisecondPastSuffix", "" }, { "MillisecondName", "mili giây" }, { "MillisecondPluralName", "mili giây" }, { "MinutePattern", "%n %u" }, { "MinuteFuturePrefix", "" }, { "MinuteFutureSuffix", " sau" }, { "MinutePastPrefix", "cách đây " }, { "MinutePastSuffix", "" }, { "MinuteName", "phút" }, { "MinutePluralName", "phút" }, { "MonthPattern", "%n %u" }, { "MonthFuturePrefix", "" }, { "MonthFutureSuffix", " sau" }, { "MonthPastPrefix", "cách đây " }, { "MonthPastSuffix", "" }, { "MonthName", "tháng" }, { "MonthPluralName", "tháng" }, { "SecondPattern", "%n %u" }, { "SecondFuturePrefix", "" }, { "SecondFutureSuffix", " sau" }, { "SecondPastPrefix", "cách đây " }, { "SecondPastSuffix", "" }, { "SecondName", "giây" }, { "SecondPluralName", "giây" }, { "WeekPattern", "%n %u" }, { "WeekFuturePrefix", "" }, { "WeekFutureSuffix", " sau" }, { "WeekPastPrefix", "cách đây " }, { "WeekPastSuffix", "" }, { "WeekName", "tuần" }, { "WeekPluralName", "tuần" }, { "YearPattern", "%n %u" }, { "YearFuturePrefix", "" }, { "YearFutureSuffix", " sau" }, { "YearPastPrefix", "cách đay " }, { "YearPastSuffix", "" }, { "YearName", "năm" }, { "YearPluralName", "năm" }, { "AbstractTimeUnitPattern", "" }, { "AbstractTimeUnitFuturePrefix", "" }, { "AbstractTimeUnitFutureSuffix", "" }, { "AbstractTimeUnitPastPrefix", "" }, { "AbstractTimeUnitPastSuffix", "" }, { "AbstractTimeUnitName", "" }, { "AbstractTimeUnitPluralName", "" } }; @Override public Object[][] getContents() { return OBJECTS; } }
Hopefully they will integrate this snippet into the next release of PrettyTime.