Skip to content

💬 Convert I18n translation files to TypeScript definitions

License

Notifications You must be signed in to change notification settings

agendrix/i18n-typedef

Repository files navigation

i18n-typedef

This small library allows to generate TypeScript definition file from multiple yaml translation files.

Tests NPM Package

Install

yarn add -D i18n-typedef

Usage

CLI

Generate a single I18n.d.ts file:

yarn run i18n-typedef generate <directories...> -o <outputDirectory>

Watch mode:

yarn run i18n-typedef watch <directories...> -o <outputDirectory>

Within an application

const i18nDirectories = [];
const outputDirectory = __dirname;

new I18nYamlDefinitions(i18nDirectories, outputDirectory).generateDefinitions()

PRs and issues are welcome.