Rosetty
Complete Intl/I18n solution for browser and node
Usage
const { rosetty, locales } = require('rosetty');
const { enGB: enLocale } = locales;
const r = rosetty(
{
en: {
dict: {
test: 'This is a test',
},
locale: enLocale,
},
},
'en'
);
console.log(r.t('test'));
API
rosetty(config, defaultLang?)
Options
Field Name | Type | Description |
---|
config | Record<string, Language> | Specify dictionnary and locale to use for each lang |
defaultLang | string? | Specify default language to use (should be the same as config) |
Return
locales
Return: Record<string, Locale>
Return Date-fns locale files. https://date-fns.org/v2.28.0/docs/Locale
Maintain
This package use TSdx. Please check documentation to update this package.