
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
browser-extension-i18n
Advanced tools
I18N module for developing browser extensions and userscripts
npm i browser-extension-i18n
# or
pnpm add browser-extension-i18n
# or
yarn add browser-extension-i18n
import { initAvailableLocales, initI18n } from "browser-extension-i18n"
// Define your message maps
const messageMaps = {
en: {
hello: "Hello",
welcome: "Welcome, {1}!",
},
zh: {
hello: "你好",
welcome: "欢迎,{1}!",
},
"zh-tw": {
hello: "您好",
},
}
// Initialize available locales
initAvailableLocales(["en", "zh", "zh-tw"])
// Create translation function
const t = initI18n(messageMaps)
// Use translations
console.log(t("hello")) // Auto-detects browser language
console.log(t("welcome", "John")) // With parameters
initAvailableLocales(locales: string[])Initialize the list of supported locales.
initI18n(messageMaps: MessageMaps, language?: string): I18nFunctionCreate a translation function. Auto-detects browser language if not specified.
getAvailableLocales(): readonly string[]Get the list of currently available locales.
getBestMatchingLocale(preferredLanguage: string): string | undefinedFind the best matching locale for a given language preference.
isLocale(locale: string | undefined): booleanCheck if a string is a valid available locale.
extractLocaleFromNavigator(): string | undefinedExtract the best matching locale from browser language preferences.
Copyright (c) 2023 Pipecraft. Licensed under the MIT License.
FAQs
I18N module for developing browser extensions and userscripts
We found that browser-extension-i18n demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.