
Security News
November CVEs Fell 25% YoY, Driven by Slowdowns at Major CNAs
November CVE publications fell 25% YoY even as 2025 totals rose, showing how a few major CNAs can swing “global” counts and skew perceived risk.
@openagenda/intl
Advanced tools
yarn add @openagenda/intl
import { getLocaleValue, mergeLocales } from '@openagenda/intl';
// or
import getLocaleValue from '@openagenda/intl/getLocaleValue';
import mergeLocales from '@openagenda/intl/mergeLocales';
getLocaleValuefunction getLocaleValue(
labels,
lang,
defaultLang = DEFAULT_LANG,
fallbackMap = DEFAULT_FALLBACK_MAP
)
See Default constants.
If labels is not an object then it is returned as is.
The function attempts to find the message in the following order:
langExample:
const multiLabel = {
fr: 'Titre',
en: 'Title',
};
getLocaleValue(multiLabel, 'fr');
mergeLocalesLike an Object.assign with a depth of 2, to combine multiple locale objects.
Example:
const filtersLocales = {
fr: {
title: 'Titre',
desc: 'Description',
},
en: {
title: 'Title',
desc: 'Description',
},
};
const userLocales = {
fr: {
other: 'Autre',
},
en: {
other: 'Other',
},
};
const locales = mergeLocales(filtersLocales, userLocales);
// result:
expect(locales).toEqual({
fr: {
title: 'Titre',
desc: 'Description',
other: 'Autre',
},
en: {
title: 'Title',
desc: 'Description',
other: 'Other',
},
});
getFallbackedMessagesfunction getFallbackedMessages(
messagesMap,
fallbackMap = DEFAULT_FALLBACK_MAP,
defaultLang = DEFAULT_LANG
)
See Default constants.
Complete the messages with the fallback languages then the default language, useful when there is no locale compilation step.
Example:
const messagesMap = {
en: {
signup: 'Signup',
signin: 'Signin',
},
fr: {
signup: "S'inscrire",
},
br: {},
};
const fallbackedMessages = getFallbackedMessages(messagesMap, userLocales);
// result:
expect(fallbackedMessages).toEqual({
en: {
signup: 'Signup',
signin: 'Signin',
},
fr: {
signup: "S'inscrire",
signin: 'Signin',
},
br: {
signup: "S'inscrire",
signin: 'Signin',
},
});
getSupportedLocalefunction getSupportedLocale(
lang,
fallbackMap = DEFAULT_FALLBACK_MAP,
defaultLang = DEFAULT_LANG
)
See Default constants.
Returns the first language supported by Intl following the chain of fallbacks.
Example:
const defaultLocale = getSupportedLocale('oc');
// result:
expect(defaultLocale).toBe('fr');
getFallbackChainfunction getFallbackChain(
lang,
fallbackMap = DEFAULT_FALLBACK_MAP,
defaultLang = DEFAULT_LANG
)
See Default constants.
Returns an array of languages in the order they should be used in case of missing data.
Example:
const fallbacks = getFallbackChain('br');
// result:
expect(fallbacks).toEqual(['br', 'fr', 'en']);
const DEFAULT_LANG = 'en';
const DEFAULT_LANGS = [
'en',
'fr',
'de',
'it',
'es',
'br',
'ca',
'eu',
'oc',
'io',
];
const DEFAULT_FALLBACK_MAP = {
br: 'fr',
ca: 'es',
eu: 'fr',
oc: 'fr',
};
These constants are used for getLocaleValue and getFallbackedMessages.
oa-intlTo extract messages to translate from your sources you have to add a script in your package.json:
{
"scripts": {
"extract-messages": "yarn oa-intl"
}
}
Default command, extract and compile:
oa-intl [files...]
Extract and compile locales.
Positionals:
files Glob paths to extract translations from, the source files. [default: ["src/**/*.js"]]
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --output The target path where the script will output an aggregated `.json` file per lang of all the translations from the `files` supplied. [default: "src/locales/%lang%.json"]
--compiled The target path where the script will output the compiled version of the translation files, completed with the fallback langs. [default: "src/locales-compiled/%lang%.json"]
-c, --compileOnly Compile only, skip extraction. [boolean]
--defaultLang Default language, the one that is filled in for the default messages in the files. [default: "en"]
--langs The target languages of the translations. [default: "en,fr,de,it,es,br,ca,eu,oc,io"]
--definedDefault Languages that are populated with messages set to "" for ease of translation. [default: "fr"]
--idInterpolationPattern If certain message descriptors don't have id, this `pattern` will be used to automatically generate IDs for them,
where `contenthash` is the hash of `defaultMessage` and `description`. [default: "[sha512:contenthash:base64:6]"]
--fallbackMap A fallback object (json) to complete each key language with the value language. For `{ "br": "fr" }`, the French will complement the Breton. [default: "{"br":"fr","ca":"es","eu":"fr","oc":"fr"}"]
--skipIndex Does not create index js file. [boolean]
--ast Whether to compile message into AST instead of just string. [boolean] [default: true]
Extract:
oa-intl extract [files...]
Extract messages.
Positionals:
files Glob paths to extract translations from, the source files. [default: ["src/**/*.js"]]
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --output The target path where the script will output an aggregated `.json` file per lang of all the translations from the `files` supplied. [default: "src/locales/%lang%.json"]
--defaultLang Default language, the one that is filled in for the default messages in the files. [default: "en"]
--langs The target languages of the translations. [default: "en,fr,de,it,es,br,ca,eu,oc,io"]
--definedDefault Languages that are populated with messages set to "" for ease of translation. [default: "fr"]
--idInterpolationPattern If certain message descriptors don't have id, this `pattern` will be used to automatically generate IDs for them,
where `contenthash` is the hash of `defaultMessage` and `description`. [default: "[sha512:contenthash:base64:6]"]
--skipIndex Does not create index js file. [boolean]
Compile:
oa-intl compile [locales]
Compile locales.
Positionals:
locales Glob path to compile locales from. [default: "src/locales/%lang%.json"]
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --output The target path where the script will output the compiled version of the translation files, completed with the fallback langs. [default: "src/locales-compiled/%lang%.json"]
--defaultLang Default language, the one that is filled in for the default messages in the files. [default: "en"]
--langs The target languages of the translations. [default: "en,fr,de,it,es,br,ca,eu,oc,io"]
--fallbackMap A fallback object (json) to complete each key language with the value language. For `{ "br": "fr" }`, the French will complement the Breton. [default: "{"br":"fr","ca":"es","eu":"fr","oc":"fr"}"]
--skipIndex Does not create index js file. [boolean]
--ast Whether to compile message into AST instead of just string. [boolean] [default: true]
FAQs
```bash yarn add @openagenda/intl ```
The npm package @openagenda/intl receives a total of 16 weekly downloads. As such, @openagenda/intl popularity was classified as not popular.
We found that @openagenda/intl demonstrated a healthy version release cadence and project activity because the last version was released less than 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
November CVE publications fell 25% YoY even as 2025 totals rose, showing how a few major CNAs can swing “global” counts and skew perceived risk.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.