From 9d063575d0fca71af9d3618267d18d3ae450f3a3 Mon Sep 17 00:00:00 2001 From: pradeep-tgl <119275121+pradeep-tgl@users.noreply.github.com> Date: Fri, 22 Sep 2023 17:52:43 +0530 Subject: [PATCH] fix: added Georgia and Kazakhstan holidays def (#47) --- config/test.exs | 2 + lib/holidefs.ex | 2 + priv/calendars/definitions/ge.yaml | 158 +++++++++++++++++++++++++++++ priv/calendars/definitions/kz.yaml | 128 +++++++++++++++++++++++ priv/gettext/cy.pot | 54 ++++++++++ priv/gettext/en/LC_MESSAGES/ge.po | 62 +++++++++++ priv/gettext/en/LC_MESSAGES/kz.po | 41 ++++++++ priv/gettext/fed.pot | 36 +++++++ priv/gettext/gb.pot | 3 + priv/gettext/ge.pot | 57 +++++++++++ priv/gettext/kz.pot | 36 +++++++ test/holidefs_test.exs | 2 + 12 files changed, 581 insertions(+) create mode 100644 priv/calendars/definitions/ge.yaml create mode 100644 priv/calendars/definitions/kz.yaml create mode 100644 priv/gettext/cy.pot create mode 100644 priv/gettext/en/LC_MESSAGES/ge.po create mode 100644 priv/gettext/en/LC_MESSAGES/kz.po create mode 100644 priv/gettext/fed.pot create mode 100644 priv/gettext/ge.pot create mode 100644 priv/gettext/kz.pot diff --git a/config/test.exs b/config/test.exs index 6ab016f..f025812 100644 --- a/config/test.exs +++ b/config/test.exs @@ -21,9 +21,11 @@ config :holidefs, :fi, :fr, :gb, + :ge, :hu, :ie, :it, + :kz, :lt, :mx, :my, diff --git a/lib/holidefs.ex b/lib/holidefs.ex index 8328ce9..22cd3b3 100644 --- a/lib/holidefs.ex +++ b/lib/holidefs.ex @@ -29,10 +29,12 @@ defmodule Holidefs do fi: "Finland", fr: "France", gb: "United Kingdom", + ge: "Georgia", hr: "Croatia", hu: "Hungary", ie: "Ireland", it: "Italy", + kz: "Kazakhstan", lt: "Lithuania", my: "Malaysia", mx: "Mexico", diff --git a/priv/calendars/definitions/ge.yaml b/priv/calendars/definitions/ge.yaml new file mode 100644 index 0000000..cb23e09 --- /dev/null +++ b/priv/calendars/definitions/ge.yaml @@ -0,0 +1,158 @@ +# Georgian holiday definitions for the Ruby Holiday gem. In Georgian (საქართველო). +# +# Updated: 2017-06-12 +# Sources: +# - https://en.wikipedia.org/wiki/Public_holidays_in_Georgia +# - https://de.wikipedia.org/wiki/Feiertage_in_Georgien +# - https://translate.yandex.com/?lang=ka-en +--- +months: + 0: + - name: დიდი პარასკევი # Good Friday + regions: [ge] + function: orthodox_easter(year) + function_modifier: -2 + - name: დიდი შაბათი # Holy Saturday + regions: [ge] + function: orthodox_easter(year) + function_modifier: -1 + - name: ბრწყინვალე აღდგომის დღე # Easter Sunday + regions: [ge] + function: orthodox_easter(year) + - name: მიცვალებულთა # Easter Monday + regions: [ge] + function: orthodox_easter(year) + function_modifier: 1 + 1: + - name: ახალი წელი # New Year's Day + regions: [ge] + mday: 1 + - name: ბედობა # Day after New Year's Day + regions: [ge] + mday: 2 + - name: ქრისტეშობა # Christmas Day + regions: [ge] + mday: 7 + - name: ნათლისღება # Baptism Day of our Lord Jesus Christ + regions: [ge] + mday: 19 + 3: + - name: დედის დღე # Mother's Day + regions: [ge] + mday: 3 + - name: ქალთა საერთაშორისო დღე # International Women's Day + regions: [ge] + mday: 8 + 4: + - name: ეროვნული ერთიანობის დღე # Day of National Unity + regions: [ge] + mday: 9 + 5: + - name: ფაშიზმზე გამარჯვების დღე # Victory Day + regions: [ge] + mday: 9 + - name: წმინდა მოციქულის ანდრია პირველწოდებულის საქართველოში შემოსვლის დღე # Saint Andrew the First-Called Day + regions: [ge] + mday: 12 + - name: დამოუკიდებლობის დღე # Independence Day + regions: [ge] + mday: 26 + 8: + - name: მარიამობა # Saint Mary's Day + regions: [ge] + mday: 28 + 10: + - name: სვეტიცხოვლობა # Day of Svetitskhoveli Cathedral (in Mtskheta) + regions: [ge] + mday: 14 + 11: + - name: გიორგობა # Saint George's Day + regions: [ge] + mday: 23 + +tests: + - given: + date: '2017-1-1' + regions: ["ge"] + expect: + name: "ახალი წელი" + - given: + date: '2017-1-2' + regions: ["ge"] + expect: + name: "ბედობა" + - given: + date: '2017-1-7' + regions: ["ge"] + expect: + name: "ქრისტეშობა" + - given: + date: '2017-1-19' + regions: ["ge"] + expect: + name: "ნათლისღება" + - given: + date: '2017-3-3' + regions: ["ge"] + expect: + name: "დედის დღე" + - given: + date: '2017-3-8' + regions: ["ge"] + expect: + name: "ქალთა საერთაშორისო დღე" + - given: + date: '2017-4-9' + regions: ["ge"] + expect: + name: "ეროვნული ერთიანობის დღე" + - given: + date: '2017-5-9' + regions: ["ge"] + expect: + name: "ფაშიზმზე გამარჯვების დღე" + - given: + date: '2017-5-12' + regions: ["ge"] + expect: + name: "წმინდა მოციქულის ანდრია პირველწოდებულის საქართველოში შემოსვლის დღე" + - given: + date: '2017-5-26' + regions: ["ge"] + expect: + name: "დამოუკიდებლობის დღე" + - given: + date: '2017-8-28' + regions: ["ge"] + expect: + name: "მარიამობა" + - given: + date: '2017-10-14' + regions: ["ge"] + expect: + name: "სვეტიცხოვლობა" + - given: + date: '2017-11-23' + regions: ["ge"] + expect: + name: "გიორგობა" + - given: + date: ['2017-4-14', '2018-4-6', '2019-4-26'] + regions: ["ge"] + expect: + name: "დიდი პარასკევი" + - given: + date: ['2017-4-15', '2018-4-7', '2019-4-27'] + regions: ["ge"] + expect: + name: "დიდი შაბათი" + - given: + date: ['2017-4-16', '2018-4-8', '2019-4-28'] + regions: ["ge"] + expect: + name: "ბრწყინვალე აღდგომის დღე" + - given: + date: ['2017-4-17', '2018-4-9', '2019-4-29'] + regions: ["ge"] + expect: + name: "მიცვალებულთა" diff --git a/priv/calendars/definitions/kz.yaml b/priv/calendars/definitions/kz.yaml new file mode 100644 index 0000000..8a87ad4 --- /dev/null +++ b/priv/calendars/definitions/kz.yaml @@ -0,0 +1,128 @@ +# Kazakhstan holiday definitions for the Ruby Holiday gem. +# +# Created: 2020-09-18 +# Sources: +# - https://www.officeholidays.com/countries/kazakhstan/2020 +# - https://en.wikipedia.org/wiki/Public_holidays_in_Kazakhstan +--- +months: + 1: + - name: Jańa jyl # New Year's Day + regions: [kz] + mday: 1 + - name: Jańa jyl # 1st New Year holiday + regions: [kz] + mday: 2 + 3: + - name: Halyqaralyq áıelder kúni # International Women's Day + regions: [kz] + mday: 8 + - name: Naýryz Meıramy # Nauryz + regions: [kz] + mday: 21 + - name: Naýryz Meıramy # Nauryz + regions: [kz] + mday: 22 + - name: Naýryz Meıramy # Nauryz + regions: [kz] + mday: 23 + 5: + - name: Qazaqstan halqynyń birligi merekesi # Kazakhstan People's Unity Day + regions: [kz] + mday: 1 + - name: Otan Qorǵaýshy kuni # Defender of the Fatherland day + regions: [kz] + mday: 7 + - name: Jeńis kúni # Victory Day + regions: [kz] + mday: 9 + 7: + - name: Astana kúni # Capital Day + regions: [kz] + mday: 6 + 8: + - name: Qazaqstan Respýblıkasynyń Konstıtýcıyasy kúni # Constitution day + regions: [kz] + mday: 30 + 12: + - name: Túńǵysh Prezıdent kúni # First President Day + regions: [kz] + mday: 1 + - name: Táýelsizdik kúni # Independence day + regions: [kz] + mday: 16 + - name: Táýelsizdik kúni # Independence day + regions: [kz] + mday: 17 + +tests: + - given: + date: ['2020-1-1'] + regions: ["kz"] + expect: + name: "Jańa jyl" + - given: + date: ['2020-1-2'] + regions: ["kz"] + expect: + name: "Jańa jyl" + - given: + date: '2020-3-8' + regions: ["kz"] + expect: + name: "Halyqaralyq áıelder kúni" + - given: + date: '2020-3-21' + regions: ["kz"] + expect: + name: "Naýryz Meıramy" + - given: + date: '2020-3-22' + regions: ["kz"] + expect: + name: "Naýryz Meıramy" + - given: + date: '2020-3-23' + regions: ["kz"] + expect: + name: "Naýryz Meıramy" + - given: + date: '2020-5-1' + regions: ["kz"] + expect: + name: "Qazaqstan halqynyń birligi merekesi" + - given: + date: '2020-5-7' + regions: ["kz"] + expect: + name: "Otan Qorǵaýshy kuni" + - given: + date: '2020-5-9' + regions: ["kz"] + expect: + name: "Jeńis kúni" + - given: + date: '2020-7-6' + regions: ["kz"] + expect: + name: "Astana kúni" + - given: + date: '2020-8-30' + regions: ["kz"] + expect: + name: "Qazaqstan Respýblıkasynyń Konstıtýcıyasy kúni" + - given: + date: '2020-12-1' + regions: ["kz"] + expect: + name: "Túńǵysh Prezıdent kúni" + - given: + date: '2020-12-16' + regions: ["kz"] + expect: + name: "Táýelsizdik kúni" + - given: + date: '2020-12-17' + regions: ["kz"] + expect: + name: "Táýelsizdik kúni" diff --git a/priv/gettext/cy.pot b/priv/gettext/cy.pot new file mode 100644 index 0000000..749a0d6 --- /dev/null +++ b/priv/gettext/cy.pot @@ -0,0 +1,54 @@ +# Generated by `mix holidefs.gettext.extract` +# for the locale CY - Cyprus +msgid "" +msgstr "" + + +msgid "Green Monday" +msgstr "" + +msgid "Good Friday" +msgstr "" + +msgid "Easter Sunday" +msgstr "" + +msgid "Easter Monday" +msgstr "" + +msgid "Festival of the Flood" +msgstr "" + +msgid "New Year's Day" +msgstr "" + +msgid "Epiphany Day" +msgstr "" + +msgid "Greek National Day" +msgstr "" + +msgid "National Anniversary Day" +msgstr "" + +msgid "Labour Day" +msgstr "" + +msgid "Assumption of the Virgin Mary" +msgstr "" + +msgid "Cyprus Independence Day" +msgstr "" + +msgid "Greek National Anniversary Day" +msgstr "" + +msgid "Christmas Eve" +msgstr "" + +msgid "Christmas Day" +msgstr "" + +msgid "Boxing Day" +msgstr "" + diff --git a/priv/gettext/en/LC_MESSAGES/ge.po b/priv/gettext/en/LC_MESSAGES/ge.po new file mode 100644 index 0000000..da9358e --- /dev/null +++ b/priv/gettext/en/LC_MESSAGES/ge.po @@ -0,0 +1,62 @@ +## `msgid`s in this file come from POT (.pot) files. +## +## Do not add, change, or remove `msgid`s manually here as +## they're tied to the ones in the corresponding POT file +## (with the same domain). +## +## Use `mix gettext.extract --merge` or `mix gettext.merge` +## to merge POT files into PO files. +msgid "" +msgstr "" +"Language: en\n" + +msgid "დიდი პარასკევი" +msgstr "Good Friday" + +msgid "დიდი შაბათი" +msgstr "Holy Saturday" + +msgid "ბრწყინვალე აღდგომის დღე" +msgstr "Easter Sunday" + +msgid "მიცვალებულთა" +msgstr "Easter Monday" + +msgid "ახალი წელი" +msgstr "New Year's Day" + +msgid "ბედობა" +msgstr "Day after New Year's Day" + +msgid "ქრისტეშობა" +msgstr "Christmas Day" + +msgid "ნათლისღება" +msgstr "Baptism Day of our Lord Jesus Christ" + +msgid "დედის დღე" +msgstr "Mother's Day" + +msgid "ქალთა საერთაშორისო დღე" +msgstr "International Women's Day" + +msgid "ეროვნული ერთიანობის დღე" +msgstr "Day of National Unity" + +msgid "ფაშიზმზე გამარჯვების დღე" +msgstr "Victory Day" + +msgid "წმინდა მოციქულის ანდრია პირველწოდებულის საქართველოში შემოსვლის დღე" +msgstr "Saint Andrew the First-Called Day" + +msgid "დამოუკიდებლობის დღე" +msgstr "Independence Day" + +msgid "მარიამობა" +msgstr "Saint Mary's Day" + +msgid "სვეტიცხოვლობა" +msgstr "Day of Svetitskhoveli Cathedral (in Mtskheta)" + +msgid "გიორგობა" +msgstr "Saint George's Day" diff --git a/priv/gettext/en/LC_MESSAGES/kz.po b/priv/gettext/en/LC_MESSAGES/kz.po new file mode 100644 index 0000000..8677ab5 --- /dev/null +++ b/priv/gettext/en/LC_MESSAGES/kz.po @@ -0,0 +1,41 @@ +## `msgid`s in this file come from POT (.pot) files. +## +## Do not add, change, or remove `msgid`s manually here as +## they're tied to the ones in the corresponding POT file +## (with the same domain). +## +## Use `mix gettext.extract --merge` or `mix gettext.merge` +## to merge POT files into PO files. +msgid "" +msgstr "" +"Language: en\n" + +msgid "Jańa jyl" +msgstr "New Year's Day" + +msgid "Halyqaralyq áıelder kúni" +msgstr "International Women's Day" + +msgid "Naýryz Meıramy" +msgstr "Nauryz" + +msgid "Qazaqstan halqynyń birligi merekesi" +msgstr "Kazakhstan People's Unity Day" + +msgid "Otan Qorǵaýshy kuni" +msgstr "Defender of the Fatherland day" + +msgid "Jeńis kúni" +msgstr "Victory Day" + +msgid "Astana kúni" +msgstr "Capital Day" + +msgid "Qazaqstan Respýblıkasynyń Konstıtýcıyasy kúni" +msgstr "Constitution day" + +msgid "Túńǵysh Prezıdent kúni" +msgstr "First President Day" + +msgid "Táýelsizdik kúni" +msgstr "Independence day" diff --git a/priv/gettext/fed.pot b/priv/gettext/fed.pot new file mode 100644 index 0000000..a0ec398 --- /dev/null +++ b/priv/gettext/fed.pot @@ -0,0 +1,36 @@ +# Generated by `mix holidefs.gettext.extract` +# for the locale FED - Federal Reserve +msgid "" +msgstr "" + + +msgid "New Year's Day" +msgstr "" + +msgid "Birthday of Martin Luther King, Jr" +msgstr "" + +msgid "Washington's Birthday" +msgstr "" + +msgid "Memorial Day" +msgstr "" + +msgid "Independence Day" +msgstr "" + +msgid "Labor Day" +msgstr "" + +msgid "Columbus Day" +msgstr "" + +msgid "Veterans Day" +msgstr "" + +msgid "Thanksgiving Day" +msgstr "" + +msgid "Christmas Day" +msgstr "" + diff --git a/priv/gettext/gb.pot b/priv/gettext/gb.pot index cf33e51..33fe23b 100644 --- a/priv/gettext/gb.pot +++ b/priv/gettext/gb.pot @@ -34,6 +34,9 @@ msgstr "" msgid "Bank Holiday" msgstr "" +msgid "Bank Holiday for the Coronation of King Charles III" +msgstr "" + msgid "Tynwald Day" msgstr "" diff --git a/priv/gettext/ge.pot b/priv/gettext/ge.pot new file mode 100644 index 0000000..deeba2d --- /dev/null +++ b/priv/gettext/ge.pot @@ -0,0 +1,57 @@ +# Generated by `mix holidefs.gettext.extract` +# for the locale GE - Georgia +msgid "" +msgstr "" + + +msgid "დიდი პარასკევი" +msgstr "" + +msgid "დიდი შაბათი" +msgstr "" + +msgid "ბრწყინვალე აღდგომის დღე" +msgstr "" + +msgid "მიცვალებულთა" +msgstr "" + +msgid "ახალი წელი" +msgstr "" + +msgid "ბედობა" +msgstr "" + +msgid "ქრისტეშობა" +msgstr "" + +msgid "ნათლისღება" +msgstr "" + +msgid "დედის დღე" +msgstr "" + +msgid "ქალთა საერთაშორისო დღე" +msgstr "" + +msgid "ეროვნული ერთიანობის დღე" +msgstr "" + +msgid "ფაშიზმზე გამარჯვების დღე" +msgstr "" + +msgid "წმინდა მოციქულის ანდრია პირველწოდებულის საქართველოში შემოსვლის დღე" +msgstr "" + +msgid "დამოუკიდებლობის დღე" +msgstr "" + +msgid "მარიამობა" +msgstr "" + +msgid "სვეტიცხოვლობა" +msgstr "" + +msgid "გიორგობა" +msgstr "" + diff --git a/priv/gettext/kz.pot b/priv/gettext/kz.pot new file mode 100644 index 0000000..3dfdcc1 --- /dev/null +++ b/priv/gettext/kz.pot @@ -0,0 +1,36 @@ +# Generated by `mix holidefs.gettext.extract` +# for the locale KZ - Kazakhstan +msgid "" +msgstr "" + + +msgid "Jańa jyl" +msgstr "" + +msgid "Halyqaralyq áıelder kúni" +msgstr "" + +msgid "Naýryz Meıramy" +msgstr "" + +msgid "Qazaqstan halqynyń birligi merekesi" +msgstr "" + +msgid "Otan Qorǵaýshy kuni" +msgstr "" + +msgid "Jeńis kúni" +msgstr "" + +msgid "Astana kúni" +msgstr "" + +msgid "Qazaqstan Respýblıkasynyń Konstıtýcıyasy kúni" +msgstr "" + +msgid "Túńǵysh Prezıdent kúni" +msgstr "" + +msgid "Táýelsizdik kúni" +msgstr "" + diff --git a/test/holidefs_test.exs b/test/holidefs_test.exs index fc49ee9..7ed058c 100644 --- a/test/holidefs_test.exs +++ b/test/holidefs_test.exs @@ -27,9 +27,11 @@ defmodule HolidefsTest do fi: "Finland", fr: "France", gb: "United Kingdom", + ge: "Georgia", hu: "Hungary", ie: "Ireland", it: "Italy", + kz: "Kazakhstan", lt: "Lithuania", mx: "Mexico", my: "Malaysia",