# format-message-formats

> Options for Intl APIs used by format-message

Latest version **6.2.4** (published 2022-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install format-message-formats
pnpm add format-message-formats
yarn add format-message-formats
bun add format-message-formats
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.2.4 |
| Published | 2022-02-17 |
| First published | 2015-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 204 |
| Author | Andy VanWagoner |
| Maintainers | thetalecrafter, bjohn465, aaronshaf, brentburgoyne |
| Keywords | format-message |

## Links

- npm: https://www.npmjs.com/package/format-message-formats
- Repository: https://github.com/format-message/format-message
- Homepage: https://github.com/format-message/format-message/tree/master/packages/format-message-formats
- Issues: https://github.com/format-message/format-message/issues
- npm.io page: https://npm.io/package/format-message-formats

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 6.2.4 (latest) — 2022-02-17
- 6.0.0-alpha.2 (next) — 2018-04-18
- 6.2.0 — 2018-09-12
- 6.1.0 — 2018-08-30
- 6.0.4 — 2018-06-05
- 6.0.3 — 2018-04-27
- 6.0.0 — 2018-04-19
- 6.0.0-alpha.1 — 2018-04-17
- 6.0.0-alpha.0 — 2018-04-16
- 5.1.0 — 2016-12-28
- 5.0.0 — 2016-09-27
- 5.0.0-beta.10 — 2016-09-26
- 5.0.0-beta.9 — 2016-09-26
- 5.0.0-beta.8 — 2016-09-26
- 4.0.0 — 2015-11-15

## README

# ![format-message][logo]
> Internationalize text, numbers, and dates using ICU Message Format.

[![npm Version][npm-image]][npm]
[![Build Status][build-image]][build]


[![JS Standard Style][style-image]][style]
[![MIT License][license-image]][LICENSE]

# LOOKING FOR MAINTAINERS

The current maintainers are looking for someone to take over the maintaince of this package.  If you are interested please reach out to [vanwagonet](https://github.com/vanwagonet)

## Internationalization Made Easy

Start simple. Wrap any user-facing message with `formatMessage()`. Don't forget to import/require format-message.

```js
var formatMessage = require('format-message');
// ...
formatMessage('My Account Preferences')
```

Don't concatenate message pieces, use placeholders instead.

```js
formatMessage('Hello, { name }!', { name: user.name })
```

You can even pick plural and gender forms with placeholders.

```js
formatMessage(`{
  gender, select,
    male {His inbox}
  female {Her inbox}
   other {Their inbox}
 }`, { gender: user.gender })

 formatMessage(`{
   count, plural,
      =0 {No unread messages}
     one {# unread message}
   other {# unread messages}
 }`, { count: messages.unreadCount })
```

Need to provide extra information to translators? Add a message description.
Need 2 translations to the same English message? Add a message id.

```js
formatMessage({
  id: 'update_action_button',
  default: 'Update',
  description: 'Text displayed on the update resource button to trigger the update process'
})
formatMessage({
  id: 'update_label',
  default: 'Update',
  description: 'Label on each item that is an update to another item'
})
```

Extract all of the messages you've used in your source code.

```bash
$ npm i format-message-cli
$ format-message extract "src/**/*.js" > ./locales/en/messages.json
```

Check that the translators preserved placeholders and proper message formatting.

```bash
$ format-message lint -t ./locales/index.js "src/**/*.js"
```

Use the translations at runtime.

```js
formatMessage.setup({
  generateId: require('format-message-generate-id/underscored_crc32'),
  translations: require('./locales'),
  locale: 'pt'
})
```

Make a locale-specific build.

```bash
$ format-message transform --inline --locale pt "src/**/*.js" > bundle.pt.js
```


### Need more details?

Check out the many ways you can use format-message in your project:

* [message-format](https://github.com/format-message/format-message/tree/master/packages/message-format)
* [format-message](https://github.com/format-message/format-message/tree/master/packages/format-message)
* [format-message-cli](https://github.com/format-message/format-message/tree/master/packages/format-message-cli)
* [eslint-plugin-format-message](https://github.com/format-message/format-message/tree/master/packages/eslint-plugin-format-message)
* [babel-plugin-extract-format-message](https://github.com/format-message/format-message/tree/master/packages/babel-plugin-extract-format-message)
* [babel-plugin-transform-format-message](https://github.com/format-message/format-message/tree/master/packages/babel-plugin-transform-format-message)


License
-------

This software is free to use under the MIT license. See the [LICENSE-MIT file][LICENSE] for license text and copyright information.


[logo]: https://format-message.github.io/format-message/logo.svg
[npm]: https://www.npmjs.org/package/format-message
[npm-image]: https://img.shields.io/npm/v/format-message.svg
[deps]: https://david-dm.org/format-message/format-message
[deps-image]: https://img.shields.io/david/format-message/format-message.svg
[dev-deps]: https://david-dm.org/format-message/format-message#info=devDependencies
[dev-deps-image]: https://img.shields.io/david/dev/format-message/format-message.svg
[build]: https://travis-ci.org/format-message/format-message
[build-image]: https://img.shields.io/travis/format-message/format-message.svg
[style]: https://github.com/feross/standard
[style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
[license-image]: https://img.shields.io/npm/l/format-message.svg
[message-format]: https://github.com/format-message/message-format
[LICENSE]: https://github.com/format-message/format-message/blob/master/LICENSE-MIT

---
_Source: https://npm.io/package/format-message-formats · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
