diff options
author | DaeHyun Sung <sungdh86+git@gmail.com> | 2019-05-25 09:33:33 +0900 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-06-01 01:21:06 +0200 |
commit | 5e67aa92a8f08fe488c9344851c2f819d4eaa542 (patch) | |
tree | 7eafed0d66a06f57b57dead4417c21342414b489 /i18npool | |
parent | ad2acdfa36db00678f44f5cd69d687183f02a0bd (diff) |
Support to Korean Dangi Calendar for tdf#125446
Support to Korean Traditional Calendar, Dan-gi(단기/檀紀) Calendar
The era name, Dangi(단기,檀紀) originating from the foundation of Gojoseon[고조선/古朝鮮] is also widely used in Korea as an indication of long civilization of Korea.
Full name: `Dangun-giwon (단군기원, 檀君紀元 "First Age of Lord Dangun")`
Abbreviation Name: `Dangi(단기,檀紀)`
The Dangi Calendar measures years from the ancient founding of Korea in 2333 B.C.
Reference. ICU Library
ICU library support Dangi Calendar.
ICU4C 50 http://bugs.icu-project.org/trac/ticket/9255
ICU4J 51 http://bugs.icu-project.org/trac/ticket/9616
Change-Id: I490b8b288c68f498eb29d4fcc73251cbef3ac6d4
Reviewed-on: https://gerrit.libreoffice.org/72943
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/inc/calendar_gregorian.hxx | 10 | ||||
-rw-r--r-- | i18npool/source/calendar/calendar_gregorian.cxx | 13 | ||||
-rw-r--r-- | i18npool/source/registerservices/registerservices.cxx | 4 | ||||
-rw-r--r-- | i18npool/util/i18npool.component | 3 |
4 files changed, 30 insertions, 0 deletions
diff --git a/i18npool/inc/calendar_gregorian.hxx b/i18npool/inc/calendar_gregorian.hxx index 6d343f33f28d..894f2246e30b 100644 --- a/i18npool/inc/calendar_gregorian.hxx +++ b/i18npool/inc/calendar_gregorian.hxx @@ -177,6 +177,16 @@ public: }; +// class Calendar_dangi + +class Calendar_dangi : public Calendar_gregorian +{ +public: + // Constructors + Calendar_dangi(); +}; + + // class Calendar_buddhist class Calendar_buddhist : public Calendar_gregorian diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 45a9de3bf3ef..18676361027a 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -226,6 +226,19 @@ Calendar_ROC::Calendar_ROC() : Calendar_gregorian(ROC_eraArray) cCalendar = "com.sun.star.i18n.Calendar_ROC"; } +/** +* The start year of the Korean traditional calendar (Dan-gi) is the inaugural +* year of Dan-gun (BC 2333). +*/ +static const Era dangi_eraArray[] = { + {-2332, 1, 1, 0}, + {0, 0, 0, 0} +}; +Calendar_dangi::Calendar_dangi() : Calendar_gregorian(dangi_eraArray) +{ + cCalendar = "com.sun.star.i18n.Calendar_dangi"; +} + static const Era buddhist_eraArray[] = { {-542, 1, 1, 0}, {0, 0, 0, 0} diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index f6c187c83a56..dd891558696d 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -114,6 +114,7 @@ IMPL_CREATEINSTANCE( Calendar_gregorian ) IMPL_CREATEINSTANCE( Calendar_hanja ) IMPL_CREATEINSTANCE( Calendar_gengou ) IMPL_CREATEINSTANCE( Calendar_ROC ) +IMPL_CREATEINSTANCE( Calendar_dangi ) IMPL_CREATEINSTANCE( Calendar_hijri ) IMPL_CREATEINSTANCE( Calendar_jewish ) IMPL_CREATEINSTANCE( Calendar_buddhist ) @@ -295,6 +296,9 @@ static const struct InstancesArray { { "com.sun.star.i18n.Calendar_ROC", "com.sun.star.i18n.Calendar_ROC", &Calendar_ROC_CreateInstance }, + { "com.sun.star.i18n.Calendar_dangi", + "com.sun.star.i18n.Calendar_dangi", + &Calendar_dangi_CreateInstance }, { "com.sun.star.i18n.Calendar_hanja_yoil", "com.sun.star.i18n.Calendar_hanja_yoil", &Calendar_hanja_CreateInstance }, diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component index d4e7ea7b0a35..0b419d2f80f5 100644 --- a/i18npool/util/i18npool.component +++ b/i18npool/util/i18npool.component @@ -49,6 +49,9 @@ <implementation name="com.sun.star.i18n.Calendar_ROC"> <service name="com.sun.star.i18n.Calendar_ROC"/> </implementation> + <implementation name="com.sun.star.i18n.Calendar_dangi"> + <service name="com.sun.star.i18n.Calendar_dangi"/> + </implementation> <implementation name="com.sun.star.i18n.Calendar_buddhist"> <service name="com.sun.star.i18n.Calendar_buddhist"/> </implementation> |