{"id":13397919,"url":"https://github.com/format-message/format-message","last_synced_at":"2025-05-14T12:11:56.905Z","repository":{"id":26922749,"uuid":"30384919","full_name":"format-message/format-message","owner":"format-message","description":"Internationalization Made Easy","archived":false,"fork":false,"pushed_at":"2024-11-17T15:31:53.000Z","size":2041,"stargazers_count":205,"open_issues_count":24,"forks_count":37,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-04T17:01:56.848Z","etag":null,"topics":["internationalization","javascript"],"latest_commit_sha":null,"homepage":"http://format-message.github.io/icu-message-format-for-translators/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/format-message.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-02-05T23:48:56.000Z","updated_at":"2024-09-25T09:08:44.000Z","dependencies_parsed_at":"2024-04-06T00:24:12.867Z","dependency_job_id":"b453444b-c20a-40cb-9794-3ff6861485a1","html_url":"https://github.com/format-message/format-message","commit_stats":{"total_commits":446,"total_committers":25,"mean_commits":17.84,"dds":0.6905829596412556,"last_synced_commit":"0f2db9a1002df23eafd636ad46ff79c764585841"},"previous_names":["thetalecrafter/message-format-inline"],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/format-message%2Fformat-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/format-message%2Fformat-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/format-message%2Fformat-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/format-message%2Fformat-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/format-message","download_url":"https://codeload.github.com/format-message/format-message/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253561432,"owners_count":21927787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["internationalization","javascript"],"created_at":"2024-07-30T18:01:53.189Z","updated_at":"2025-05-14T12:11:56.876Z","avatar_url":"https://github.com/format-message.png","language":"JavaScript","readme":"# ![format-message][logo]\n\u003e Internationalize text, numbers, and dates using ICU Message Format.\n\n[![npm Version][npm-image]][npm]\n[![Build Status][build-image]][build]\n\n\n[![JS Standard Style][style-image]][style]\n[![MIT License][license-image]][LICENSE]\n\n# LOOKING FOR MAINTAINERS\n\nThe 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)\n\n## Internationalization Made Easy\n\nStart simple. Wrap any user-facing message with `formatMessage()`. Don't forget to import/require format-message.\n\n```js\nvar formatMessage = require('format-message');\n// ...\nformatMessage('My Account Preferences')\n```\n\nDon't concatenate message pieces, use placeholders instead.\n\n```js\nformatMessage('Hello, { name }!', { name: user.name })\n```\n\nYou can even pick plural and gender forms with placeholders.\n\n```js\nformatMessage(`{\n  gender, select,\n    male {His inbox}\n  female {Her inbox}\n   other {Their inbox}\n }`, { gender: user.gender })\n\n formatMessage(`{\n   count, plural,\n      =0 {No unread messages}\n     one {# unread message}\n   other {# unread messages}\n }`, { count: messages.unreadCount })\n```\n\nNeed to provide extra information to translators? Add a message description.\nNeed 2 translations to the same English message? Add a message id.\n\n```js\nformatMessage({\n  id: 'update_action_button',\n  default: 'Update',\n  description: 'Text displayed on the update resource button to trigger the update process'\n})\nformatMessage({\n  id: 'update_label',\n  default: 'Update',\n  description: 'Label on each item that is an update to another item'\n})\n```\n\nExtract all of the messages you've used in your source code.\n\n```bash\n$ npm i format-message-cli\n$ format-message extract \"src/**/*.js\" \u003e ./locales/en/messages.json\n```\n\nCheck that the translators preserved placeholders and proper message formatting.\n\n```bash\n$ format-message lint -t ./locales/index.js \"src/**/*.js\"\n```\n\nUse the translations at runtime.\n\n```js\nformatMessage.setup({\n  generateId: require('format-message-generate-id/underscored_crc32'),\n  translations: require('./locales'),\n  locale: 'pt'\n})\n```\n\nMake a locale-specific build.\n\n```bash\n$ format-message transform --inline --locale pt \"src/**/*.js\" \u003e bundle.pt.js\n```\n\n\n### Need more details?\n\nCheck out the many ways you can use format-message in your project:\n\n* [message-format](https://github.com/format-message/format-message/tree/master/packages/message-format)\n* [format-message](https://github.com/format-message/format-message/tree/master/packages/format-message)\n* [format-message-cli](https://github.com/format-message/format-message/tree/master/packages/format-message-cli)\n* [eslint-plugin-format-message](https://github.com/format-message/format-message/tree/master/packages/eslint-plugin-format-message)\n* [babel-plugin-extract-format-message](https://github.com/format-message/format-message/tree/master/packages/babel-plugin-extract-format-message)\n* [babel-plugin-transform-format-message](https://github.com/format-message/format-message/tree/master/packages/babel-plugin-transform-format-message)\n\n\nLicense\n-------\n\nThis software is free to use under the MIT license. See the [LICENSE-MIT file][LICENSE] for license text and copyright information.\n\n\n[logo]: https://format-message.github.io/format-message/logo.svg\n[npm]: https://www.npmjs.org/package/format-message\n[npm-image]: https://img.shields.io/npm/v/format-message.svg\n[deps]: https://david-dm.org/format-message/format-message\n[deps-image]: https://img.shields.io/david/format-message/format-message.svg\n[dev-deps]: https://david-dm.org/format-message/format-message#info=devDependencies\n[dev-deps-image]: https://img.shields.io/david/dev/format-message/format-message.svg\n[build]: https://travis-ci.org/format-message/format-message\n[build-image]: https://img.shields.io/travis/format-message/format-message.svg\n[style]: https://github.com/feross/standard\n[style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n[license-image]: https://img.shields.io/npm/l/format-message.svg\n[message-format]: https://github.com/format-message/message-format\n[LICENSE]: https://github.com/format-message/format-message/blob/master/LICENSE-MIT\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformat-message%2Fformat-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformat-message%2Fformat-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformat-message%2Fformat-message/lists"}