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 all 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
54 changes: 54 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -12751,6 +12751,60 @@ 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 whose type is {{LocalizableString}}.
Such members represent one or more bidirectional algorithm paragraphs 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=].

<pre class="idl">
dictionary Localizable {
DOMString lang = "";
DOMString value = "";
TextDirection dir = "auto";
};
typedef (DOMString or LocalizedValue) LocalizableString;
</pre>

The {{Localizable/lang}} member specifies the primary language for the {{Localizable/value}} member.
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/value}} is a {{DOMString}} to be localized.

For the {{Localizable/value}}, 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]]

<div class=example>
<pre highlight="webidl">
dictionary PaymentItem {
required LocalizableString label;
required PaymentCurrencyAmount amount;
boolean pending = false;
};
</pre>
</div>


<h2 id="extensibility">Extensibility</h2>

<i>This section is informative.</i>
Expand Down