Implemented ICU4J#5953
Conversation
Added ParserExceptionBuilder class for easy construction using named parameters.
|
I don't see where ICU4J is put to use. Looks like the named parameters work just as well without it. And the |
|
@kwvanderlinde The message factory is a convenience tool. I'm not about to start writing new/rewriting translations without the change being adopted. Then you might see it used. |
See it now. Definitely off my game 😅 |
|
I think the changes look pretty good. Just a couple nitpicks. |
|
@cwisniew Do you have any further thoughts on this one? I think it's good to go. |
Requested changes have been implemented
|
I'll take silence as implicit permission 😅 We can always revisit if needed. |
Identify the Bug or Feature request
progresses #5952
Description of the Change
Implemented ICU4J which allows the use of named parameters in message pattern strings.
This will improve the life of translators where parameters with useful names can provide context for the phrase.
Example:
Invalid condition in {0}({1}) roll option.vs.
Invalid condition in {branchType}({condition}) roll option.Added ParserExceptionBuilder class for easier construction of error messages using named parameters.
Additionally: Fixed issue with
&replacement.&is now only removed if it is immediately followed by a alphanumeric character, and does not form part of a HTML entity. Strings like the following should render correctly:Possible Drawbacks
Having to create a map of name-value pairs can be tiresome. Thus the exception builder.
Documentation Notes
Implemented ICU4J
Release Notes
Improved context for future translation strings.
This change is