This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25362 - Proposals for language tag checking functionality
Summary: Proposals for language tag checking functionality
Status: NEW
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-16 07:24 UTC by Felix Sasaki
Modified: 2014-04-16 07:24 UTC (History)
0 users

See Also:


Attachments

Description Felix Sasaki 2014-04-16 07:24:48 UTC
Here are a few proposals for the language tag checking functionality, based on experience developers made deploying and modifying the validator.nu library at
https://code.google.com/p/okapi-xliff-toolkit/source/browse/okapi/libraries/lib-xliff/src/main/java/net/sf/okapi/lib/xliff2/lang/Language.java

1) Private use tags
Validating this document 
<!DOCTYPE html>
<html lang="de-x-a"> ...</html>
creates this error message:
"Bad value de-x-a for attribute lang on element html: Private use subtag a is too short."
But such a value should be OK: private use subtags can be of length 1.

Looking at this code
https://whattf.svn.cvsdude.com/syntax/trunk/relaxng/datatype/java/src/org/whattf/datatype/Language.java
(not sure if is the correct place to look at actually)
This could be fixed by replacing
"subtag.length() < 2" with "subtag.length() < 1"
in the below:
if (subtag.length() < 2) {
                throw newDatatypeException("Private use subtag ", subtag, " is too short.");                
            }

2) Some language tag issues are reported as errors, e.g. for
<html lang="de-latn-de">
You get
" Bad value de-latn-de for attribute lang on element html: Language tag should omit the default script for the language."
It may make sense to report such errors as warnings, not as errors, since the  
issues are based on SHOULD NOT statements in BCP47.

Code fixes for 2) have been made in 
https://code.google.com/p/okapi-xliff-toolkit/source/browse/okapi/libraries/lib-xliff/src/main/java/net/sf/okapi/lib/xliff2/lang/Language.java
by adding "Warning: " to issues that report SHOULD NOT violations. So the fastest fix for this may be to re-classify all errors that start with "Warning: " as warnings in the W3C validator.