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

feat: new check (OPF-092) for language tags well-formedness #1363

Merged
merged 1 commit into from Dec 1, 2022

Conversation

rdeltour
Copy link
Member

@rdeltour rdeltour commented Dec 1, 2022

In Package Document, the language tags appearing in the elements or attributes below MUST be well-formed according to BCP47:

  • xml:lang attribute
  • hreflang attribute
  • dc:language element

For these values:

  • the schema now only do basic datatype check (string, non-empty value when relevant)
  • the well-formedness is checked with Java’s Locale.Builder#setLanguageTag() API
  • a new check (OPF-092) is reported when an ill-formed value is found

See https://docs.oracle.com/javase/8/docs/api/java/util/Locale.Builder.html#setLanguageTag-java.lang.String-

Fix #1221
Close #702

In Package Document, the language tags appearing in the elements or attributes below
MUST be well-formed according to BCP47:
 - `xml:lang` attribute
 - `hreflang` attribute
 - `dc:language` element

For these values:
- the schema now only do basic datatype check (string, non-empty value when relevant)
- the well-formedness is checked with Java’s Locale.Builder#setLanguageTag() API
- a new check (OPF-092) is reported when an ill-formed value is found

See https://docs.oracle.com/javase/8/docs/api/java/util/Locale.Builder.html#setLanguageTag-java.lang.String-

Fix #1221
Close #702
@rdeltour rdeltour added this to the v5.0.0-beta milestone Dec 1, 2022
@rdeltour rdeltour self-assigned this Dec 1, 2022
Base automatically changed from feat/package-link-hreflang to release/v5.0.0 December 1, 2022 21:16
@rdeltour rdeltour merged commit 9b2c203 into release/v5.0.0 Dec 1, 2022
@rdeltour rdeltour deleted the feat/lang-tag-wellformedness branch December 1, 2022 21:38
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.

None yet

2 participants