Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@lion/localize
Advanced tools
The localization system helps to manage localization data split into locales and automate its loading
export default {
title: 'Localize/Intro',
};
Is meant to translate text into multiple languages. In it's simplest form it is a function that returns the translated text for a namespace + key.
Further examples can be seen at Features Overview Demo and a more in depth description can be found at Localize System Overview.
Feature | Description |
---|---|
Translate Text | Load and translate text in multiple languages |
Format Numbers | Format numbers in multiple languages |
Format Dates | Format dates in multiple languages |
npm i --save @lion/localize
import { localize } from '@lion/localize';
The locale which will be loaded by default is accessed via the localize.locale
.
The single source of truth for page's locale is <html lang="my-LOCALE">
.
At the same time the interaction should happen via localize.locale
getter/setter to be able to notify and react to the change.
import { localize } from '@lion/localize.js';
localize.addEventListener('localeChanged', () => {
// do smth when data is loaded for a new locale
});
// changes locale, syncs to `<html lang="es-ES">` and fires the event above
localize.locale = 'es-ES';
FAQs
The localization system helps to manage localization data split into locales and automate its loading
The npm package @lion/localize receives a total of 1,539 weekly downloads. As such, @lion/localize popularity was classified as popular.
We found that @lion/localize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.