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

0.1.9 • Public • Published

@localazy/languages

This repository contains all the ISO 639 languages supported by Localazy. There are various forms of the content you may use.

Insallation

npm i @localazy/languages

TypeScript

Locales enum

One of the exported content is an enum file with all the locales in form of ENGLISH_LANGUAGE_NAME = "language_code", e.g. CZECH_CZECHIA = CZECH_CZECHIA = "cs_CZ";

import { Locales } from "@localazy/languages";

// ...

const czechia = locales.CZECH_CZECHIA;

Language resolver

Second typescript file provides following functions

import { getLocalazyLanguages } from "@localazy/languages";

console.log(getLocalazyLanguages());

// prints
// [
//  {
//      "important": true,
//      "localazyId": 0,
//      "name": "Latin American Spanish",
//      "rtl": false,
//      "locale": "es_419",
//      "englishName": "Latin American Spanish"
//  },
//  ...
// ]
import { findLocalazyLanguageByLocale } from "@localazy/languages";

console.log(findLocalazyLanguageByLocale("cs_CZ"));

// prints
// {
//       "important": false,
//       "localazyId": 61,
//       "name": "Czech (Czechia)",
//       "rtl": false,
//       "locale": "cs_CZ",
//       "englishName": "Czech (Czechia)"
// }

The language object implements the Language type which you may import as import { Language } from "@localazy/languages";

JSON Languages overview

This repository also contains JSON overview of languages that have been translated in native language in Localazy. If you miss some language or find inaccurate translation, we will appreciate your contribution.

You may import the languages list like this.

import { languagesList} from "@localazy/languages";

Package Sidebar

Install

npm i @localazy/languages

Weekly Downloads

32

Version

0.1.9

License

none

Unpacked Size

1.47 MB

Total Files

31

Last publish

Collaborators

  • david-localazy
  • xbilek18
  • xcharvat
  • vaclavhodek