The experience and subtlety of your program's text can be important. Messageformat is a mechanism for handling both pluralization and gender in your applications. It can also lead to much better translations, as it's designed to support all the languages included in the Unicode CLDR.
This monorepo consists of the following packages that make up our JS implementation of ICU MessageFormat:
- @messageformat/core - The core library that transpiles MessageFormat strings into JavaScript functions
- @messageformat/cli - A command-line client for the library
- @messageformat/convert - Converts other localization formats into MessageFormat
- @messageformat/date-skeleton - Tools for working with ICU DateFormat skeletons
- @messageformat/loader - Webpack loader for JSON, YAML, & .properties message files
- @messageformat/number-skeleton - Tools for working with ICU NumberFormat skeletons
- @messageformat/parser - Parses MessageFormat source strings into an AST
- @messageformat/react - React hooks and other bindings for messages
- @messageformat/runtime - Runtime dependencies of compiled message modules
- rollup-plugin-messageformat - Rollup plugin for JSON, YAML, & .properties message files
Getting Started
npm install --save-dev @messageformat/core
npm install --save @messageformat/runtime
This includes the MessageFormat compiler and a runtime accessor class that provides a slightly nicer API for working with larger numbers of messages. Our Format Guide will help with the ICU MessageFormat Syntax, and the Usage Guide provides some options for integrating messageformat to be a part of your workflow around UI texts and translations.
Messageformat is an OpenJS Foundation project, and we follow its Code of Conduct.