Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@lion/localize
Advanced tools
The localization system helps to manage localization data split into locales and automate its loading
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 and a more in depth description can be found at the Use Cases Page.
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 2,766 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.