Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
intl-schematic
Advanced tools
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Raiondesu/intl-schematic/main/logo/Dark%20Logo.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.github
A tiny library (3kb, zero-dependency) that allows to localize and format strings with infinitely expandable functionality.
🦺 Full type-safety: full autocomplete on translation keys, typed translation parameters and more;
🎄 Tree-shakable: only take what you need;
🔌 Pluginable: extend any processing step without limits;
📃 JSON-validation using a JSON-schema: intellisense and popup hints right in the translation document;
🚫 No string-interpolation: translation strings will never be processed or mangled by-default, so all unicode symbols are safe to use;
Comprehensive documentation is in progress.
See a simplified example below and don't be afraid to take a look into the sources to find out more.
const getDocument = () => ({
"hello": "Hello, World!"
});
t()
)import { createTranslator } from 'intl-schematic';
const t = createTranslator(getDocument);
// OR
const t = createTranslator(getDocument, [
// Add optional plugins here
// they will be applied to translations in corresponding order
]);
console.log(t('hello')); // `Hello, World!`
Plugins allow to infinitely expand the functionality of intl-schematic
. To find out more, see the main plugins readme.
You might want to install the default plugin collection:
npm i @intl-schematic/plugin-defaults
These allow to use standard Intl features,
like DateTimeFormat
,
PluralRules
and DisplayNames
,
as well as cross-reference keys and many other features.
import { createTranslator } from 'intl-schematic';
import { defaultPlugins, defaultProcessors } from '@intl-schematic/plugin-defaults';
const getDocument = () => ({
price: {
// Processor name - number - means process with Intl.NumberFormat
number: {
// Intl.NumberFormat options
style: "currency",
currency: "USD",
currencyDisplay: "symbol",
trailingZeroDisplay: "stripIfInteger"
},
input: 0 // fallback
}
});
const getLocale = () => new Intl.Locale('en');
const t = createTranslator(getDocument, defaultPlugins(
getLocale
defaultProcessors
));
console.log(t('price', 123)); // "$123"
FAQs
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Raiondesu/intl-schematic/main/logo/Dark%20Logo.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.github
The npm package intl-schematic receives a total of 49 weekly downloads. As such, intl-schematic popularity was classified as not popular.
We found that intl-schematic 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.