-
Notifications
You must be signed in to change notification settings - Fork 160
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
WIP: add localizable dictionary #358
Closed
Closed
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d743b7f
WIP: add localizable dictionary
marcoscaceres bf5bcb0
Split up Localizable and TextDirection. (#1)
tobie 381de47
fix some wording as suggested by Annevk
marcoscaceres 97f6d52
Make it clear that it's one or more paragraphs
marcoscaceres bc58e24
members should be plural
marcoscaceres e78d5f5
Adds LocalizableString enum
marcoscaceres File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12751,6 +12751,68 @@ type is used for representing function values that take no arguments and do not | |
return any value. | ||
|
||
|
||
<h3 id="TextDirection" enum>TextDirection</h3> | ||
|
||
<pre class="idl"> | ||
enum TextDirection { | ||
"auto", | ||
"ltr", | ||
"rtl" | ||
}; | ||
</pre> | ||
|
||
The {{TextDirection}} [=enumerable=] is used to represent text directionality as described in [[!BIDI]]. | ||
|
||
|
||
<h3 id="localizable" dictionary>Localizable</h3> | ||
|
||
A <dfn export>localizable member</dfn> is a [=dictionary member=] that | ||
represents a bidirectional algorithm paragraph when displayed, | ||
as defined by the bidirectional algorithm’s rules P1, P2, and P3, | ||
including, for instance, supporting the paragraph-breaking behavior | ||
of <span class="char">U+000A LINE FEED (LF)</span> characters. [[!BIDI]] | ||
|
||
A user agent is expected to honor the Unicode semantics of [=localizable members=]. | ||
|
||
The [=identifier=] of a [=localizable member=] is left to the defining specification (e.g., "title"). | ||
|
||
Dictionaries that specify a [=localizable member=] must inherit from the {{Localizable}} dictionary. | ||
|
||
Specification authors must specify in prose which [=dictionary members|member(s)=] | ||
of the inheriting dictionary serve as [=localizable members=]. | ||
|
||
It is recommended that specification authors limit the number of [=dictionary members=] | ||
that are [=localizable member=], ideally to one. | ||
|
||
<pre class="idl"> | ||
dictionary Localizable { | ||
DOMString lang = ""; | ||
TextDirection dir = "auto"; | ||
}; | ||
</pre> | ||
|
||
The {{Localizable/lang}} member specifies the primary language for the [=dictionary members=] | ||
which are [=localizable members=]. | ||
Its value is a {{DOMString}}. | ||
The empty string indicates that the primary language is unknown. | ||
Any other string must be interpreted as a language tag. | ||
Validity or well-formedness are not enforced. [[!BCP47]] | ||
|
||
The {{Localizable/dir}} member provides the higher-level override of rules P2 and P3 | ||
if it has a value other than <a for=TextDirection enum-value>"auto"</a>. [[!BIDI]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be more clearly made to apply to the localizable members. |
||
|
||
<div class=example> | ||
<pre highlight="webidl"> | ||
dictionary PaymentItem : Localizable { | ||
// "label" is a localizable member | ||
required DOMString label; | ||
required PaymentCurrencyAmount amount; | ||
boolean pending = false; | ||
}; | ||
</pre> | ||
</div> | ||
|
||
|
||
<h2 id="extensibility">Extensibility</h2> | ||
|
||
<i>This section is informative.</i> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Specification authors should limit ..." is a little clearer than this. Per Infra we should avoid using "recommended".