Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add locale for ja-JP #16

Open
lauft opened this issue Oct 18, 2019 · 4 comments
Open

Add locale for ja-JP #16

lauft opened this issue Oct 18, 2019 · 4 comments
Labels
help wanted Extra attention is needed locale

Comments

@lauft
Copy link
Member

lauft commented Oct 18, 2019

The following locale needs to be verified/completed:

class ja_JP(Locale):
    """
    01-01: [NF] 元日
    02-11: [NF] 建国記念の日
    04-29: [NF] 昭和の日
    05-03: [NF] 憲法記念日
    05-04: [NF] みどりの日
    05-05: [NF] こどもの日
    11-03: [NF] 文化の日
    11-23: [NF] 勤労感謝の日
    12-23: [NF] 天皇誕生日
    : [NV] 成人の日
    : [NV] 春分の日
    : [NV] 海の日
    : [NV] 敬老の日
    : [NV] 秋分の日
    : [NV] 体育の日
    """

    locale = "jp-JP"

Checklist:

  • Are all holidays (i.e. days "which are defined by law on which business or work are suspended or reduced") listed? Can you provide the legal sources which define the holidays?
  • Is the spelling correct? Can you maybe provide a translation?
  • Are the fixed dates <month>-<day> correct?
  • If a holiday has a variable date: Is the algorithm to calculate it correct/can you provide it if missing? If it depends on the easter date: Is it the western or orthodox easter date?
  • If a holiday is proclaimed by the government: Can you provide the source?
  • Are holidays moved to a different date, e.g. if they fall on a saturday/sunday/...?
  • Are holidays observed on a different date (is there a substitute holiday), e.g. if they fall on a saturday/sunday/...?
  • Are the flags correct? (N = national holiday, defined by law, R = holiday with religious background, F = holiday with fixed date, V = holiday with variable date)
  • Have there been any holidays renamed/deleted/created since 2011? If yes, which ones and since when?
@lauft lauft added the help wanted Extra attention is needed label Oct 18, 2019
@lauft lauft added the locale label Jun 19, 2020
@omasanori
Copy link

omasanori commented Feb 21, 2022

I would like to help 😃 I will collect the source and so on later, but I have some questions and comments:

locale = "jp-JP"

Isn't this ja-JP? Also, can we provide en-JP too?

Are the fixed dates - correct?

Some holidays had moved temporally, 天皇誕生日 (Emperor's Birthday) is the reigning Emperor's birthday so it has moved from time to time, and so on. Are they representable?

If a holiday has a variable date: Is the algorithm to calculate it correct/can you provide it if missing?

Most of them are "the second Monday in January" or such. 春分の日 and 秋分の日 are tricky, as it is not the easter but depend on the equinox in March and September.

Are holidays moved to a different date, e.g. if they fall on a saturday/sunday/...?
Are holidays observed on a different date (is there a substitute holiday), e.g. if they fall on a saturday/sunday/...?

Schools, companies, and so on would have non-working days on the nearest non-holiday if they fall on a Sunday. However, the date of holidays on the calendar will not move. Does it count as a substitute holiday?

Are the flags correct? (N = national holiday, defined by law, R = holiday with religious background, F = holiday with fixed date, V = holiday with variable date)

Can a holiday be both N and R? Otherwise, N is defined as non-R holidays?

@lauft lauft changed the title Add locale for jp-JP Add locale for ja-JP Feb 21, 2022
@lauft
Copy link
Member Author

lauft commented Feb 21, 2022

Isn't this ja-JP?

Yes, you are correct, I fixed the error in the description. 👍🏻

Also, can we provide en-JP too?

Yes, of course – if you can provide the translation.

Some holidays had moved temporally, 天皇誕生日 (Emperor's Birthday) is the reigning Emperor's birthday so it has moved from time to time, and so on. Are they representable?

Holidata provides data from 2011, so we only need to consider the emperors' birthdays since then.

If this should change, Holidata needs to reflect this of course. There are several ways to do this: either implement a function for each emperor which provides the holiday for the given time range (open ended for the current one) or implement a single function which provides the holiday at the respective date for the given year. I would opt for the one-emperor-one-function approach, as it provides a clearer encapsulation of the specific holiday.

Most of them are "the second Monday in January" or such. 春分の日 and 秋分の日 are tricky, as it is not the easter but depend on the equinox in March and September.

If there is an algorithm to calculate the date of the equinox (just like the easter algorithm) then we can use this one. Otherwise, the equinoxes/dates have to be defined somewhere beforehand, so we have to implement (and regularly update) this table then.

Schools, companies, and so on would have non-working days on the nearest non-holiday if they fall on a Sunday. However, the date of holidays on the calendar will not move. Does it count as a substitute holiday?

For most countries Holidata implements them as <name> (substitute) or similar. I would try to name the substitue holiday the same as it would show up in the respective calendar.

Can a holiday be both N and R? Otherwise, N is defined as non-R holidays?

Note: N is for national, R is for religious (not 'regional').

The opposite of both flags is simply to leave them out. A non-national holiday however must have regions specified (a national holiday, on the other hand, must have no regions specified).

The purpose 'religious' flag is not quite defined. Currently it is used to mark holidays with a religious background.

@omasanori
Copy link

Thank you for answering! I think I got enough information to collect data, but I may ask again if not.

Yes, you are correct, I fixed the error in the description. 👍🏻

Thanks!

Yes, of course – if you can provide the translation.

OK, I would.

Holidata provides data from 2011, so we only need to consider the emperors' birthdays since then.

I see.

If there is an algorithm to calculate the date of the equinox (just like the easter algorithm) then we can use this one. Otherwise, the equinoxes/dates have to be defined somewhere beforehand, so we have to implement (and regularly update) this table then.

A table would be better, as they are officially declared in February of the previous year based on astronomical observation. You can calculate estimated equinoxes in Japan, however.

For most countries Holidata implements them as <name> (substitute) or similar. I would try to name the substitute holiday the same as it would show up in the respective calendar.

OK.

Note: N is for national, R is for religious (not 'regional').

Yes, I meant that equinoxes are national holidays defined by law but on the other hand, religious festivals occur on these holidays. Thus, I wonder if religious events are not counted as national events.

@omasanori
Copy link

omasanori commented Mar 1, 2022

Some updates:

The table of holidays in CSV by the Cabinet Office of Japan is available at: https://www8.cao.go.jp/chosei/shukujitsu/syukujitsu.csv (Note that the encoding is not UTF-8 but Shift_JIS.)

The canonical source of holidays is 国民の祝日に関する法律. As far as I know, translations of this act are not provided officially.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed locale
Projects
None yet
Development

No branches or pull requests

2 participants