open-i18n / rust-unic

UNIC: Unicode and Internationalization Crates for Rust
https://crates.io/crates/unic
Other
234 stars 24 forks source link

Implement MessageFormat #263

Open kpozin opened 5 years ago

kpozin commented 5 years ago

See http://userguide.icu-project.org/formatparse/messages#TOC-MessageFormat.

Basic requirements:

behnam commented 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.

zbraniecki commented 5 years ago

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".