[Bug 25362] New: Proposals for language tag checking functionality

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25362

            Bug ID: 25362
           Summary: Proposals for language tag checking functionality
           Product: Nu Markup Checker
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: General
          Assignee: mike+validator@w3.org
          Reporter: fsasaki@w3.org
        QA Contact: www-validator-cvs@w3.org

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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 16 April 2014 07:24:50 UTC