-
Notifications
You must be signed in to change notification settings - Fork 13
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
Merge locale and country #97
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of re-naming a holiday, the old one ceases to exist and a new one takes its place. Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Has to be an array Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
With this, all different translations of a holiday are combined in its definition. This unifies all locales into their respective country. Added 'LocaleWrapper' for transition phase. Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Before, order seemed too dependent on call order Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Holidays are now defined uniformly via a DSL. Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Language id can be given in upper or lower case in the main script. Internally, the language id is handled in lower case. Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a major overhaul of the internal structure. The external interface via the
bin/holidata
script stays the same.The biggest change is the transfer of the holiday definitions from the locales to the respective country. Before, there had to be a locale class for each locale, defining the holidays partially as class docstring, partially as dedicated functions. For Belgium (
BE
) the (abridged) locale in French (fr
) looked like this:For Belgium, there were two more locale classes, for languages
de
andnl
. As the holiday data is identical except for the respective language, this means duplication.Instead of defining the holidays in each locale, they are now defined centrally for all (available) languages in the corresponding country. The definitions for the example Belgium now looks like this:
Instead of docstring and functions, holidays are now defined via a DSL, which allows to specify all required information.
Also, it is now also possible to specify holidays for regions in separate classes, intended to simplify the handling of regional holidays. This has been applied to the holidays of Spain (ES) which is now a subpackage (see src/holidata/holidays/ES/init.py).