unicode-org / message-format-wg

Developing a standard for localizable message strings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add formatting instructions related to external variables vs. `name`

aphillips opened this issue · comments

Is your feature request related to a problem? Please describe.
The syntax restricts the names of variables that can appear in a message, but most implementations will permit arguments whose names are "just strings" and thus not restricted to the namespace in a message. For example:

Map args = ImmutableMap.of(
  "   bad key   ",       "my key has spaces",
  "-\u0370\uD800\uFDD0", "my key has bad chars",
  "looksOkay ",          "... but isn't"
);

This is really just a tracking issue to spur discussion of normative/informative criteria.

Describe the solution you'd like
Add instructions to formatting.md for authors. Potentially allow implementations to do minor fix-ups (notably, trimming whitespace). Allow implementations to warn users of badly formed keys.

Note that I use the word "allow", not "require". Illegal keys should never result in runtime errors--they just don't match anything. Some implementations might not wish to implement warnings, due to resource constraints or just due to the fact that normal formatting doesn't provide a mechanism to return warnings through.

Describe why your solution should shape the standard
Users need to know about this quirk.

Additional context or examples
N/A