Bug 21495 - List of translatable elements and attributes
Summary: List of translatable elements and attributes
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Erika Doyle Navara
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: CR
Depends on: 23283
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-01 19:27 UTC by Yves
Modified: 2013-09-23 23:32 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yves 2013-04-01 19:27:11 UTC
Looking at the editor's draft here:
http://www.w3.org/html/wg/drafts/html/master/dom.html#the-translate-attribute

a) Base on the current definition, there is no way to know for sure when the content attribute on meta elements is transltable or not.
"...if the name attribute specifies a metadata name whose value is known to be translatable" does not really help. I would suggested to provide a list of names corresponding to a translatable content attribute, and possibly add that other values may exist. This would provide at least a set of testable values and some level of predictable behavior.

b) I don't think the lang attribute can be considered translatable. Its value should be updated in some cases, but it's not a translatable value. For example, on can have an application that takes an HTML input and creates an output that is not the translated HTML document (e.g. to create bilingual data to train MT engines, etc.), the value of lang doesn't belong to such data set.

c) The style element is defined as translatable, but its content is not HTML markup and I would not consider it part of the translatable element. Parts of its content may need translation, just like parts of a JavaScript content may need translation, but in both cases the content to process is not HTML.
Comment 1 Yves 2013-04-30 20:51:32 UTC
An update on this topic.

Regarding point b). I think now one can consider <style> translatable, (as well as <script> and all onXYZ attributes) but with a caveat that those constructs require a secondary parsing to separate the translatable parts from the non-translatable ones.

So something like this:

All elements are translatable (including <style>* and <script>*)
Only the following attributes are translatable:
abbr, alt, content, download, label, placeholder, title, aria-label.
aria-valuetext when the role attribute is progressbar, scrollbar, slider or spinbutton.
content in a <meta> element when the attribute name is keywords, or description.
value in a <input> element when the attribute type is button
style* and srcdoc* attributes.
onabort*, onblur*, oncanplay*, oncanplaythrough*, onchange*, onclick*, oncontextmenu*, ondblclick*, ondrag*, ondragend*, ondragenter*, ondragleave*, ondragover*, ondragstart*, ondrop*, ondurationchange*, onemptied*, onended*, onerror*, onfocus*, oninput*, oninvalid*, onkeydown*, onkeypress*, onkeyup*, onload*, onloadeddata*, onloadedmetadata*, onloadstart*, onmousedown*, onmousemove*, onmouseout*, onmouseover*, onmouseup*, onmousewheel*, onpause*, onplay*, onplaying*, onprogress*, onratechange*, onreadystatechange*, onreset*, onscroll*, onseeked*, onseeking*, onselect*, onshow*, onstalled*, onsubmit*, onsuspend*, ontimeupdate*, onvolumechange*, and onwaiting*.

Note: The elements or attributes with a star (*) next to their name have a content or a value that is not of type text. While the translatability property still applies to them, they must be processed by a secondary parser to detect which parts of their content or value are actually text to translate.
Comment 2 Yves 2013-08-01 12:04:27 UTC
The best way to resolve this issue at this point would be to use the exact same definition as HTML 5.1 WD uses.
See: http://www.w3.org/html/wg/drafts/html/master/dom.html#the-translate-attribute
Comment 3 Robin Berjon 2013-09-03 12:36:18 UTC
(In reply to comment #2)
> The best way to resolve this issue at this point would be to use the exact
> same definition as HTML 5.1 WD uses.
> See:
> http://www.w3.org/html/wg/drafts/html/master/dom.html#the-translate-attribute

I folded the changes from 5.1 into CR — does that address your concerns?
Comment 4 Yves 2013-09-03 13:03:10 UTC
Yes, I think it does.
Thanks.
-ys
Comment 5 Robin Berjon 2013-09-03 13:10:27 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: Folded what was in 5.1 into CR.
Rationale: It was a much better description.
Comment 6 steve faulkner 2013-09-19 09:59:55 UTC
re-opened due to new related bug
Comment 7 Travis Leithead [MSFT] 2013-09-23 23:32:30 UTC
Cherry-picked this fix to Master into the CR branch, resolving this bug.

https://github.com/w3c/html/commit/ce373635b7264e5341151a0abddde83e94e777ed