🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@gasket/intl

Package Overview
Dependencies
Maintainers
8
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gasket/intl

Internationalization managers for translation files and locale handling.

Source
npmnpm
Version
7.1.0-next.2
Version published
Weekly downloads
1.4K
230.96%
Maintainers
8
Weekly downloads
 
Created
Source

@gasket/intl

Provides internationalization managers for translation files and locale handling.

Installation

npm i @gasket/intl @gasket/plugin-intl

See @gasket/plugin-intl for more information on how to configure the plugin.

Usage

With a intl.js built by @gasket/plugin-intl, you can use the manager to get provide messages for locales.

To get all messages for a locale:

import intlManager from '../path/to/intl.js';

const messages = intlManager.getLocale('en-US').getAllMessages();

LocaleHandler

This will return a handler with the following methods:


// Access a locale handler
const localeHandler = intlManager.getLocale('en-US');

// locale files can be dynamically loaded
await localeHandler.load('locales/examples')

// Get all loaded messages for a locale
localeHandler.getAllMessages();

TODO: more examples coming

License

MIT

Keywords

gasket

FAQs

Package last updated on 12 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts