Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.08 KB

File metadata and controls

30 lines (20 loc) · 1.08 KB

@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.