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 1 commit
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
37 changes: 37 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -12750,6 +12750,43 @@ The {{VoidFunction}} [=callback function=]
type is used for representing function values that take no arguments and do not
return any value.

<h3>Locatlizable dictionary</h3>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Copy link
Collaborator

@tobie tobie May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be spelled "Lolcatlizable".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in marcoscaceres#1.


A localizable member 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 U+000A LINE FEED (LF) characters.
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 probably be an exported dfn, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this should reference BIDI, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in marcoscaceres#1.


A user agent is expected to honor the Unicode semantics of localizable members.

The name 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 member(s) of the inheriting dictionary serve as localizable members. It is RECOMMENDED that specification authors limit localizable member in the prototype chain of inherited dictionaries (ideally to one).

<pre class="idl">
enum TextDirection {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be its own chapter if we're going to have this here? This might be useful on its own as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Canvas apparently has CanvasDirection, which uses "inherit" rather than "auto"... Good times.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add "inherit" to the enum and mark it as legacy?

"auto",
"ltr",
"rtl"
};

dictionary Localizable {
DOMString lang;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't lang default to the empty string?

Copy link
Collaborator

@tobie tobie May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in marcoscaceres#1.

TextDirection dir = "auto";
};</pre>

The {{lang}} member specifies the primary language for the localizable members in the prototype chain. Its value is a string. 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. [[!LANG]]

The {{dir}} member provides the higher-level override of rules P2 and P3 if has a value other than "auto". [[!BIDI]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if has?

Copy link
Collaborator

@tobie tobie May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in marcoscaceres#1.


<div class=example>
dictionary PaymentItem : Localizable {
// "label" is a localizable member
required DOMString label;
required PaymentCurrencyAmount amount;
boolean pending = false;
};
</div>

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

Expand Down