@theowenyoung/languages
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

@theowenyoung/languages

npm-version OpenTranslate

Shared language identifiers and locales for OpenTranslate projects.

Usage

Install

Yarn

yarn add @theowenyoung/languages

NPM

npm i @theowenyoung/languages

Import

CommonJS

const { languages } = require("@theowenyoung/languages");
const en = require("@theowenyoung/languages/locales/en");
const zhCN = require("@theowenyoung/languages/locales/zh-CN");
const zhTW = require("@theowenyoung/languages/locales/zh-TW");

TypeScript (with resolveJsonModule enabled)

import { languages } from "@theowenyoung/languages";
import en from "@theowenyoung/languages/locales/en.json";
import zhCN from "@theowenyoung/languages/locales/zh-CN.json";
import zhTW from "@theowenyoung/languages/locales/zh-TW.json";

API

const langCode = languages[0];
console.log(langCode); //af
console.log(zhCN[langCode]); //南非荷兰语
console.log(en["en"]); //English

Package Sidebar

Install

npm i @theowenyoung/languages

Weekly Downloads

2

Version

1.5.1

License

MIT

Unpacked Size

17.1 kB

Total Files

16

Last publish

Collaborators

  • theowenyoung