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

Do not capitalise names in DA/NB/NL #185

Merged
merged 2 commits into from
Dec 31, 2019

Conversation

c960657
Copy link
Contributor

@c960657 c960657 commented Nov 10, 2019

In some languages, such as English, holiday names are considered proper nouns and must be capitalised. Other languages, such as Danish, treat them as common nouns (except Kristi himmelfartsdag (Ascension Day) which includes the name of Christ), so they should not be capitalised when used mid-sentence. In Dutch, it is a bit more complicated.

Yasumi currently provides capitalised names for all languages, except Swedish.

I suggest that all translations in Yasumi use the non-capitalised form, when applicable for the specific language. This supports most use cases.

If you need a capitalised name based on a non-capitalised version, you can just take the first letter and convert it into uppercase.

On the contrary, if you only have the capitalised version and need a version suitable for mid-sentence use, you cannot assume that you can just lowercase the first letter. Depending on the language and the specific holiday name in question, the first letter should or should not be lowercased (see e.g. the above mentioned complex rules for Dutch).

This PR covers Danish, Swedish, Norwegian and Dutch (based on my limited understanding of the rules for Dutch). Other languages may need a similar change, but this requires further investigation.

This change may be considered a BC break (despite the precedent for Swedish). If you think this is a serious concern, we could add a global configuration option — e.g. Yasumi::capitalizeNames(bool $capitalize) — which controls whether getName() should uppercase the first later of all names. The default should be true (for preserving BC). This should only be a temporary measure which is considered deprecated and will be removed in the next major version.

@c960657 c960657 changed the title Do not capitalise names in DA/NB/SV/NL Do not capitalise names in DA/NB/NL Nov 10, 2019
@stelgenhof
Copy link
Member

Thanks for the PR! Staying with the official / defacto spelling rules has my preference as well. As far as BC, not sure if this really is a BC change.

@stelgenhof stelgenhof merged commit 18f5c33 into azuyalabs:develop Dec 31, 2019
@stelgenhof stelgenhof added this to the v2.3.0 milestone Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants