-
-
Notifications
You must be signed in to change notification settings - Fork 36
Add first draft of default attribute definitions #1098
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
base: main
Are you sure you want to change the base?
Conversation
aphillips
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start. Lots of nit-picky comments.
Maybe a good question is: should these be directly incorporated? Or should all of these XLIFFy things be namespaced? Some of what XLIFF does doesn't apply to UMF messages and some of it would be much better on a message resource level (instead of cluttering up the message itself).
spec/attributes/README.md
Outdated
|
|
||
| #### @translate | ||
|
|
||
| _Value:_ `yes` or `no`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indicate that yes is default?
Is there a reason attributes don't follow a similar structure to functions and their options here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we've agreement that yes is the default. In fact, for expressions, I would think that the general default might in fact be no to indicate that a translator is not expected to make any changes to the expression.
Considering this a bit more, maybe something like translate=input or translate=|input,minimumFractionDigits| would be better? That would indicate which parts are expected to be translatable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value is no when the attribute is not present, but yes when the attribute is present and has no value, right?
I don't like the values yes/no, but they are inherited from XLIFF (and its friends, such as ITS) and we should probably remain consistent with them (for portability at least)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's a slightly different undrstanding of "default" than I'd had -- as in, the value that's applied if the attribute is not present at all.
I don't hate the yes/no as they're relatively legible and are perhaps easier to extend with other enum values than e.g. true/false would be. But as they're already in use by XLIFF, we should use the same values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that requiring explicit values is cleaner.
How hard is it to type =no (3 characters)?
translate=|input,minimumFractionDigits| would be better? > That would indicate which parts are expected to be translatable.
I think that such info does not belong here, it belongs in the function registry.
A while ago I even provided a list of l10n attributes to use for each function option (something like hide, read-only, enum, free-form). I can even think of more options.
Co-authored-by: Addison Phillips <addison@unicode.org>
During yesterday's call, @mihnita also expressed concern regarding cluttering up a message with multiple attributes. His thought was that it would often be preferable to attach a To me, this speaks of a need to have that capability also be well defined, so that it can be ergonomically done across resource formats. In other words, I think we need a JavaDoc-y syntax for message-level attributes. |
spec/attributes/README.md
Outdated
|
|
||
| Indicates whether the _message_ is translatable or not. | ||
|
|
||
| Some _messages_ may be required to have the same value in all locales. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then they are not messages that should be stored in resource bundles. They can very well be hard-coded.
A better use case is probably to encode info about locale sensitive behavior. For example the fact that the default order for a Contacts app should be first-name, except that Japanese, and a few others should be last name.
But that would not be MF2.
TLDR: I am not sure I see a good use case.
| @@ -0,0 +1,233 @@ | |||
| ## Expression, Markup, and Message Attributes | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I am not happy with the idea of storing all of this in the message proper.
This belongs in the storage, outside the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I generally agree, some of these really are necessary in-message breadcrumbs (for use cases you've highlighted previously!). For the most part, these are added by localization engineers and their tools, rather than by developers, to assist tools such as TRADOS and the like in protecting or editing placeholders. Such information is difficult to store outside the message because the act of translation changes the length, content, and placement.
|
I have a couple of questions and would like to share my understanding of the matter. In addition to the message resource standard, I’m considering how it could integrate with an in-context editing or translation tool. Expression AttributesThese attributes may vary by locale, so it makes sense for them to be included within the message:
For Markup AttributesWhat exactly does the The same with
Message AttributesI understand the flexibility of having messages with I haven't had time to think about the other message-related attributes yet, so that's all for now. |
|
Since I promised during the last meeting that I would look over this PR: I looked it over, and I have no strong opinions and don't feel like I know enough about the use cases to give an official review. |
aphillips
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
submitting some old comments held in draft.
| @@ -0,0 +1,233 @@ | |||
| ## Expression, Markup, and Message Attributes | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I generally agree, some of these really are necessary in-message breadcrumbs (for use cases you've highlighted previously!). For the most part, these are added by localization engineers and their tools, rather than by developers, to assist tools such as TRADOS and the like in protecting or editing placeholders. Such information is difficult to store outside the message because the act of translation changes the length, content, and placement.
|
I've refactored the PR so that it's hopefully easier to read, and (as discussed at the last call) included this note at the top: Important This part of the specification is under incubation by the MessageFormat WG, and may end up being finalized elsewhere. It is non-normative. I've also dropped the message-level |
|
|
||
| _Value:_ `yes` or `no`. | ||
|
|
||
| Indicates whether or not the _markup_ and its contents can be re-ordered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment. The descriptions need to be more detailed, and there needs to be an example for each attribute.
For example, this description is ambiguous. "re-ordered" with respect to what? Literal text? Placeholders? Other markup? If it is with respect to literal text surrounding the markup, that is very problematic, for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intended to correspond to the XLIFF 2 canReorder attribute. I'll add some text clarifying that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done; also added correspondances with HTML & ITS 2 concepts where appropriate.
Adds an initial set of expression, markup, and message attribute definitions.
The proposed attributes are drawn from:
As noted in the text, this is not intended as a final list, but as a starting point. The text is not being currently proposed to be normative, but we could change that later.