1.0.0-rc.7 • Published 4 months ago

@intl-schematic/plugin-defaults v1.0.0-rc.7

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@intl-schematic/plugin-defaults

This is a collection of plugins that should be of use to most applications in need of being localized.

npm i -s @intl-schematic/plugin-defaults

Included plugins

This package also exports everything from the included plugins.

Usage

import { createTranslator } from 'intl-schematic';
import { defaultPlugins } from '@intl-schematic/plugin-defaults';

const getLocale = () => new Intl.Locale(navigator.language);

// Notice the plugins array parameter
const t = createTranslator(getDocument, defaultPlugins(getLocale));

Then use according to the instructions of included plugins.