Socket
Book a DemoInstallSign in
Socket

@hi18n/core

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hi18n/core

Message internationalization meets immutability and type-safety - core runtime

latest
Source
npmnpm
Version
0.2.4
Version published
Maintainers
1
Created
Source

Core library for hi18n

See hi18n's README for general information.

msg

Returns the first argument. Used for type-safe translations.

export default new Catalog<Vocabulary>("en", {
  "example/greeting": msg("Hello, {name}!"),
});

Catalog

Creates a set of translated messages for a specific locale.

export default new Catalog<Vocabulary>("en", {
  "example/greeting": msg("Hello, {name}!"),
});

Book

Creates a set of translated messages for all supported locales.

const book = new Book<Vocabulary>({
  en: catalogEn,
  ja: catalogJa,
});

getTranslator

Retrieves a translation helper from a book and a locale.

const { t } = getTranslator(book, "ja");
t("example/greeting", { name: "太郎" });

Keywords

intl

FAQs

Package last updated on 17 Sep 2025

Did you know?

Socket

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.

Install

Related posts