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

Clarify "Valid BCP47 language tag" #217

Closed
zcorpan opened this issue Oct 5, 2015 · 8 comments
Closed

Clarify "Valid BCP47 language tag" #217

zcorpan opened this issue Oct 5, 2015 · 8 comments
Assignees

Comments

@zcorpan
Copy link
Member

zcorpan commented Oct 5, 2015

In http://dev.w3.org/html5/webvtt/#webvtt-cue-text you still say the cue language span "must be a valid BCP 47 language tag", where 'valid' has a particular meaning in BCP 47 and it is not clear if you intend that specific meaning. You should: (a) omit the word valid; (b) clarify that you mean BCP 47 valid; or (c) use the word 'well-formed' instead. (Valid in BCP 47 means that the implementation checks to see that all of the subtags are registered, at least as of an implementation specific date)

I think (b) is intended. HTML has the same requirement for its lang attribute. But it's not a requirement on implementations in HTML and WebVTT, but on authors.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28255#c17

@dwsinger
Copy link

dwsinger commented Oct 5, 2015

On Oct 5, 2015, at 7:56 , Simon Pieters notifications@github.com wrote:

In http://dev.w3.org/html5/webvtt/#webvtt-cue-text you still say the cue language span "must be a valid BCP 47 language tag", where 'valid' has a particular meaning in BCP 47 and it is not clear if you intend that specific meaning. You should: (a) omit the word valid; (b) clarify that you mean BCP 47 valid; or (c) use the word 'well-formed' instead. (Valid in BCP 47 means that the implementation checks to see that all of the subtags are registered, at least as of an implementation specific date)

I think (b) is intended. HTML has the same requirement for its lang attribute. But it's not a requirement on implementations in HTML and WebVTT, but on authors.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28255#c17

agree, we want authors to write ‘valid’ tags, and maybe we state that there is no requirement on user-agents to check validity?


Reply to this email directly or view it on GitHub.

David Singer
Manager, Software Standards, Apple Inc.

@aphillips
Copy link

I think (b) is intended.

Actually, I don't think so. 'valid' means that implementations do check the registry. Ian and I did discuss the intentions of HTML5's statement in 3.2.5.3 of that document and there's a bit of cheese later on in that section that clarifies that the 'must' that you refer to is not actually a validation requirement. This still strikes me as odd and open to misinterpretation and that's why I generally try to get other specs to be clearer.

For most specs, there is no advantage to be gained by requiring any validation and so that's generally what I recommend to spec writers: don't require any particular format, but do guide people to do the right thing.

agree, we want authors to write ‘valid’ tags, and maybe we state that there is no
requirement on user-agents to check validity?

If you don't require but do allow validation, then some implementations might choose to reject invalid or not-well-formed tags. That might represent a interoperability problem that you probably don't want.

Generally my recommendation for specs is to use one of these strategies:

  1. "Field X is a string, whose contents should be a valid BCP 47 language tag or the empty string." // no checking
  2. "Field X is a string, whose contents must be a well-formed BCP 47 language tag or the empty string. // check format of the tags but not the validity of the subtags

@zcorpan
Copy link
Member Author

zcorpan commented Oct 6, 2015

We don't want to allow validation in UAs. But we still want to require validation in validators.

@nigelmegitt
Copy link
Contributor

I just filed bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=29179 in relation to validation behaviour being separate to UA behaviour, in response to @zcorpan's comment above. The term 'validator' is used in the Conformance section but not defined, and no separate requirements are defined for validators vs UAs in the spec.

@aphillips
Copy link

@zcorpan Note that language tag validation is sensitive to the copy of the IETF language subtag registry (LSTR) used. Registrations and changes occur regularly in the LSTR. There are stability guarantees of various kinds (tags never become invalid once they are valid), but newly valid possibilities are created regularly.

Again, my suggestion would be to require well-formed checking in validators and suggest/permit validity checking as potential warnings to be emited. Also note that there are extensions to BCP 47 (two of them currently) and these may not be validated by a validator (the extensions are not very relevant to WebVTT in any case) even if the base language tag is validated.

I'm sorry this is complicated :-).

@zcorpan
Copy link
Member Author

zcorpan commented Oct 7, 2015

That new tags are added regularly is not a problem. Validator.nu already uses the registry for validating HTML.

Again, my suggestion would be to require well-formed checking in validators and suggest/permit validity checking as potential warnings to be emited.

But why? Why not require authors to only use registered language tags, and have validators to emit an error if an unregistered language tag is used?

@silviapfeiffer
Copy link
Member

@aphillips could you confirm that the resolution in #255 and #256 are satisfactory for your issue registered in https://www.w3.org/Bugs/Public/show_bug.cgi?id=28263 and discussed here?

@aphillips
Copy link

In I18N's housekeeping of 2020-03-26 we noticed that we had not replied to this issue. Just now I made a couple of minor comments on #256. I also noticed a separate issue in #255 which I'll track separately.

The language tag comment in that review is minor, but since the note in question is related to conformance, potentially not editorial. Sorry to be so tardy in our response.

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

No branches or pull requests

5 participants