summaryrefslogtreecommitdiffstats
path: root/i18npool/source
diff options
context:
space:
mode:
authorDaeHyun Sung <sungdh86+git@gmail.com>2019-05-25 09:33:33 +0900
committerEike Rathke <erack@redhat.com>2019-06-01 02:16:41 +0200
commit3222a51c03757cccffc81c1be79c553b8a198349 (patch)
tree17c00951c58e89999856d5f0e54cdd36a3e443fe /i18npool/source
parenttdf#124279: consider also functions with no arguments (diff)
downloadcore-3222a51c03757cccffc81c1be79c553b8a198349.tar.gz
core-3222a51c03757cccffc81c1be79c553b8a198349.zip
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> (cherry picked from commit 5e67aa92a8f08fe488c9344851c2f819d4eaa542) Reviewed-on: https://gerrit.libreoffice.org/73297 Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'i18npool/source')
-rw-r--r--i18npool/source/calendar/calendar_gregorian.cxx13
-rw-r--r--i18npool/source/registerservices/registerservices.cxx4
2 files changed, 17 insertions, 0 deletions
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 },