git404hub

formatjs/formatjs

14,710TypeScriptAudience · developerComplexity · 3/5ActiveSetup · moderate

tl;dr

Monorepo of JavaScript i18n libraries including react-intl, ICU MessageFormat tooling, and Intl polyfills for dates, numbers, plurals, and translations.

vibe map

mindmap
  root((formatjs))
    Inputs
      ICU MessageFormat strings
      Source code
      Locale data
    Outputs
      Translated strings
      Formatted dates
      Plural phrases
      Extracted message files
    Use Cases
      Internationalize React apps
      Format currency and dates
      Extract translatable strings
      Polyfill Intl APIs
    Tech Stack
      TypeScript
      JavaScript
      React
      ICU
      Babel
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what people make with this

VIBE 1

Internationalize a React app with react-intl and ICU MessageFormat

VIBE 2

Format dates, numbers, and currencies in many locales

VIBE 3

Extract translatable messages from source code into JSON for translators

VIBE 4

Polyfill missing Intl APIs in older browsers and Node versions

stack

TypeScriptJavaScriptReactICUBabel

setup vibes

Difficulty · moderate time til it works · 30min

Most apps also need a Babel plugin or TypeScript transformer wired into the build to extract and process messages.

in plain english

FormatJS is a family of JavaScript libraries that help web apps display dates, numbers, currencies, plurals, and translated text correctly in many different languages. This repository is a monorepo, which means it holds the source code for all the FormatJS packages in one place rather than splitting them across separate repos. The best known package in the set is react-intl, which is widely used by React applications to handle internationalisation. The README itself is mostly a long table that catalogues every package the project publishes to npm, with links to each one's version badge, changelog, and licence. The list groups roughly into three kinds of tools. There are runtime polyfills under the @formatjs prefix, which fill in pieces of the official ECMAScript Intl standard that some browsers or older JavaScript engines lack. These include intl-datetimeformat for dates and times, intl-numberformat for numbers, intl-pluralrules for plural forms, intl-relativetimeformat for phrases like "3 days ago", intl-listformat for joining lists, intl-displaynames for language and region names, intl-locale, intl-segmenter, intl-getcanonicallocales, and intl-localematcher. The second group is the core message-formatting machinery. The @formatjs/icu-messageformat-parser package reads ICU MessageFormat, an industry standard syntax that lets translators write strings with placeholders, gender choices, and plural variants. The intl-messageformat package then runs those parsed messages. On top of that sits @formatjs/intl as a framework-agnostic API, and react-intl as the React-specific layer. The third group covers tooling for development. The @formatjs/cli and @formatjs/cli-lib let you extract translatable strings out of source code into files for translators. There are also a Babel plugin, a TypeScript transformer, and an ESLint plugin so that build pipelines and editors can lint and pre-process FormatJS calls automatically. The README points readers at a Slack workspace for support and at a CONTRIBUTING file for development instructions, and notes that the project has CI tests and runs browser-matrix testing through Sauce Labs.

prompts (copy fr)

prompt 1
Give me a 5-minute setup guide for react-intl in a Next.js app
prompt 2
Show me an ICU MessageFormat example with plurals and gender in formatjs
prompt 3
Walk me through extracting translatable strings with @formatjs/cli and feeding them back as translations
prompt 4
How do I add the @formatjs/intl-pluralrules polyfill for older browsers
prompt 5
Show me how to set up the formatjs Babel plugin in a Webpack build
peek the repo → explain another one

← formatjs on gitmyhub — every repo by this author, as a profile.

double-check against the repo, no cap.