i18n-pipe
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

i18n pipe

This is a translation library for pipe separated translation strings such as "|en|Hi, my name is Matteo|it|Ciao, il mio nome è Matteo"

How to install

npm i i18n-pipe

How to import

import i18n from 'i18n-pipe';

How to use

get current language

i18n.language(); // returns 'en'

set current language

i18n.language('it'); // returns 'it'

translate a string

i18n.t("|en|Hi, my name is Matteo|it|Ciao, il mio nome è Matteo");
// returns "Ciao, il mio nome è Matteo"

Dependencies (0)

    Dev Dependencies (15)

    Package Sidebar

    Install

    npm i i18n-pipe

    Weekly Downloads

    61

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.48 kB

    Total Files

    19

    Last publish

    Collaborators

    • kalimantos