Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lion/localize

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lion/localize

The localization system helps to manage localization data split into locales and automate its loading

  • 0.8.8
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Localize

🛠 Status: Pilot Phase

Lion Web Components are still in an early alpha stage; they should not be considered production ready yet.

The goal of our pilot phase is to gather feedback from a private group of users. Therefore, during this phase, we kindly ask you to:

  • not publicly promote or link us yet: (no tweets, blog posts or other forms of communication about Lion Web Components)
  • not publicly promote or link products derived from/based on Lion Web Components

As soon as Pilot Phase ends we will let you know (feel free to subscribe to this issue https://github.com/ing-bank/lion/issues/1)

The localization system helps to manage localization data split into locales and automate its loading.

Live Demo/Documentation

See our storybook for a live demo and documentation

How to use

Installation

npm i --save @lion/localize
import { localize } from '@lion/localize';

Example

Translation data:

// path/to/hello-world/translations/en-GB.js
export default { greeting: 'Hello {name}!', };`

Loading translations:

// path/to/hello-world/HelloWorld.js
localize.loadNamespace({
  'hello-world': locale => {
    return import(`./translations/${locale}.js`);
  },
});

Translating messages:

localize.msg('hello-world:greeting', { name: 'John' });
// Hello John!

Keywords

FAQs

Package last updated on 26 Feb 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc