Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@cloudflare/intl-core
Advanced tools
@cloudflare/intl-core
This package provides core utilities for i18n.
$ npm install @cloudflare/intl-core
This is a wrapper around the functions of Polyglot.
The main benefit it provides is that it stores various instances of Polyglot for each locale in order to be able to locate translations which are not found in target locale but are found in English locale.
import Translator from '@cloudfalre/intl-core';
const phrases = {
phrase_key: 'phrase_value',
second_phrase: 'second_value'
};
const germanPhrases = {
phrase_key: 'german_value'
};
const translator = new Translator({
phrases
});
translator.locale(ESupportedLocales.de_DE);
translator.extend(germanPhrases);
translator.t('phrase_key'); //returns german_value since it's found for the german locale
translator.t('second_phrase'); //returns second_value since it was not found in german locale but was found in English locale
This is a function which takes an object mapping each locale
to a function
returning a Promise which resolves to the catalog of phrases for that locale
.
The main usecase for this is to provide a way to asynchronously load phrases
based on locale
. You can include an index.ts
file inside your locale
directory with the following content:
import { makeLoadPhrases, ESupportedLocales } from '@cloudflare/intl-core';
const loadPhrases = makeLoadPhrases({
[ESupportedLocales.en_US]: () => import('./en-US/phrases.json')
//...other locales
});
export default loadPhrases;
FAQs
Unknown package
The npm package @cloudflare/intl-core receives a total of 3,451 weekly downloads. As such, @cloudflare/intl-core popularity was classified as popular.
We found that @cloudflare/intl-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.