Runtime helpers to be used in translations precompiled by babel-plugin-precompile-intl
npm install precompile-intl-runtimeThis library is a framework-agnostic internationalization library that leverages the It is designed with a granular functional API that can easily be treeshaken by module bundlers. If your app doesn't format
dates or numbers, or use plurals with offsets, it won't include the code for those features.
And even if you use every single feature, the payload of the entire library is less than 2kb after minification and compression.
Although this library can be used on its own to localize numbers, dates and times, it is very likely that you
want to have internationalized texts in your app.
This library does not handle message formatting, instead it pairs with [babel-plugin-precompile-intl](https
a babel plugin that compiles messages in the [ICU message format](https
is the defacto standard for internalization and has implementations in almost every programming language, to super fast functions that use
the functions in this package for the runtime part.
Just run npm install --save-dev precompile-intl-runtime and make sure your bundler (like rollup, webpack or parcel" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">Intl can import
functions from it.
WIP
- init
- locale
- dictionary
- locales
- addMessages
- format, t, _
- formatDate
- formatNumber
- formatTime
- json
- getDateFormatter
- getNumberFormatter
- getTimeFormatter