Re: [heycam/webidl] WIP: add localizable dictionary (#358)

marcoscaceres commented on this pull request.



> +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=].
+
+Specification authors should limit the number of [=localizable members=] to one per dictionary,
+including in [=inherited dictionaries=] (if any).

@tobie, basically, spec authors *should* avoid doing the following: 

```JS
dictionary Foo : Bar {
    DOMString label; // localizable member
    DOMString title; // localizable member
}

dictionary Bar : localizable {
   DOMString thingToShow; // localizable member
}
```

Because generally you want dir/lang to only influence one member - because, say, "title" might be in French (e.g., name of a Restaurant) - but the thingToShow might be in Spanish.  

However, we do have instances in the platform where dictionaries already have multiple localizable members (e.g., notifications) - but authors should generally try to avoid that kind of design. Instead, you might have (ignore the crap naming):

```JS
dictionary ThingLocalizedTitle : Localizable {
   DOMString title;
}
dictionary ThingLocalizedLabel : Localizable {
   DOMString label;
}

dictionary Thing {
   ThingLocalizedLabel label;
   ThingLocalizedLabel ThingTitle;
}
```

Or possibly something like the following - which would give allow localization of members on a case by case basis:

```JS
dictionary Thing {
   (DOMString or ThingLocalizedLabel) label;
   (DOMString or ThingLocalizedTitle) title;
}
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/358#discussion_r114692884

Received on Thursday, 4 May 2017 02:56:43 UTC