Open kpozin opened 5 years ago
Thanks, @kpozin, for filing this.
My plans for UNIC has been to provide at least the same level of functionality as ICU for the Rust ecosystem, but not necessarily follow the same API and system design. (More details re MessageFormat below.) But, that said, I'm not against also supporting MessageFormat
, specially as a way to enable compatibility with / migration of existing systems.
Specifically, IMHO MessageFormat is one of the main pieces of ICU that is not well-suited/scalable to various cultures, b/c of its design decision to keep all branchings needed for a template inside one string.
B/c of that, my plan for UNIC's L10n/Translation API is to: 1) integrate with Fluent, and 2) support inline source templates with pre-expanded translation templates, probably reusing a large portion of XLIFF's design for the translation templates.
One additional point is that we do have a vague plan to work with Unicode on using Fluent as the base for some form of "MessageFormat 2.0".
See http://userguide.icu-project.org/formatparse/messages#TOC-MessageFormat.
Basic requirements:
MessageFormat
object from a format string and a locale, with format string validation.HashMap
or slice) to format a message.