locale-enum

    1.1.1 • Public • Published

    TypeScript Locale Enum

    A TypeScript enum containing all locales, such as en-US or zh-Hant-HK. Uses mixed-case strings for locales (en-US, not en-us). Contains 495 locales.

    Install:

    npm i --save locale-enum

    Use:

    const Locale = require('locale-enum');
    console.log(Locale.en_US); // "en-US"

    Import using import:

    import { Locale } from 'locale-enum';
    console.log(Locale.fr_FR); // "fr-FR"

    How about JavaScript?

    You can use this in JavaScript too, this is especially handy if your IDE supports code completion.

    const { Locale } = require('locale-enum');
    console.log(Locale.pt_BR); // "pt-BR"

    Note: the enum keys use underscores, while string values use dashes.

    Pull requests and comments are welcome at the GitHub repo.

    Install

    npm i locale-enum

    DownloadsWeekly Downloads

    5,911

    Version

    1.1.1

    License

    Unlicense

    Unpacked Size

    43.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • anton-ivanov