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

WIP: add localizable dictionary #358

Closed
wants to merge 6 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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=]
Copy link
Member

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".

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]]
Copy link
Member

Choose a reason for hiding this comment

The 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>
Expand Down