Socket
Socket
Sign inDemoInstall

i18n-ts

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-ts

Type safe internationalization utility for TypeScript


Version published
Maintainers
1
Created
Source

i18n-ts

I18n-ts is a type safe internationalization utility for TypeScript. The i18n messages are defined as plain TypeScript objects:


const en = {
   hello: "Hi!"
   greeting: (name: string) => `Hi ${name}`
};

const de = {
   hello: "Hallo!",
   greeting: (name: string) => `Hallo ${name}`
};
const i18n = {
   en: en,
   de: de,
   default: en
};

const messages = new I18nResolver(i18n, "de").translation;

// TypeScript will infere the precise type of messages
console.log(messages.hello);

Keywords

FAQs

Package last updated on 27 Mar 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc