-
Notifications
You must be signed in to change notification settings - Fork 18
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
Localizable
structure
#26
Comments
The structure is a WebIDL dictionary. cf. https://heycam.github.io/webidl/#idl-dictionaries Effectively what our document says is: if you define a natural language string field, you can use |
I understand that. But I think it is way cleaner to say something like dictionary Localizable {
DOMSgring value;
DOMString lang;
TextDirection dir = "auto";
}; i.e., to produce an interface with the value and the respective attributes. I do not see how you would you would, otherwise "assign" these attributes to a text in a clean way. It may be a matter of taste, of course. Maybe both approaches should be proposed, and it then depends on the specific API/JSON structure which is better. |
I think we're talking past one another. But I take you point. Adding |
There are two use cases for dictionary MyThing extends Localizable {
DOMString message;
unsigned long someNumber;
} Which, in JS would be: const thing = {
someNumber : 5,
message: "hello",
lang: "en",
} Having the As opposed to: dictionary MyThing {
Localizable message;
} Which results in the somewhat more verbose: const thing = {
someNumber : 5
message: { value: "hello", lang: "en" },
lang: "en",
} So, it's nice to have the generic An alternative I guess is: typedef (Localizable or DOMString) BidiText;
dictionary MyThing {
BidiText message;
} Which provides flexibility to use either. |
I am not sure what the
Localizable
structure is for. Shouldn't there be an extravalue
for the text itself? Or is itLocalizableMetadata
on a text somewhere else?The text was updated successfully, but these errors were encountered: