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

Extend language code format #880

Merged
merged 10 commits into from
Sep 13, 2020
Merged

Extend language code format #880

merged 10 commits into from
Sep 13, 2020

Conversation

herrvigg
Copy link
Collaborator

@herrvigg herrvigg commented Sep 5, 2020

Fixes #668.
Language code format: language[-script][-region]

  • language ISO 639-1 and 639-2: 2 or 3 alpha
  • script ISO 15924: 4 Alpha
  • region ISO 3166-2: 2 ALPHA or 3 digits

@herrvigg
Copy link
Collaborator Author

After comments in #668 limit extension to ISO 639-1 and 639-2: 2 or 3 alpha for now.
Let's first release these changes because it touches many core parts and the discussion goes on for the other parts.

@herrvigg herrvigg merged commit 43d532d into master Sep 13, 2020
herrvigg added a commit that referenced this pull request Sep 13, 2020
Fixes #836.  Fixes partially #668.
Major refactoring: language code format now handled with a unique regex.
The new format allows 2 or 3-letter (ISO 639-2 and 639-3), lower case.
Upper case values are only allowed for legacy codes but not for new entries.
A migration of DB will be required before enforcing to lower case.
URL checks remain case-insensitive (unchanged).
@herrvigg herrvigg deleted the feature/lang-code branch September 14, 2020 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hreflang should support ISO 639-1, ISO 3166-1 Alpha 2, ISO 15924 formats
1 participant