@acryps/language
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

acryps language

Translations made easy, languages based on ISO 639.

'Hello World'
	.german('Hallo Welt')
	.italian('Ciao mondo')
	.greek('Γεια σου κόσμε')
	.japanese('ハローワールド')

Just make sure to set the active language before the strings are resolved

import { Language, languages } from '@acryps/language';

Language.active = languages.german;

const count = 3;
console.log(
	`${count} items in the cart`
		.german(`Warenkorb: ${count} Stück`)
) // → Warenkorb: 3 Stück

Can be used in the browser and server-side!

Another handy property found on all languages is the natural writing direction:

document.documentElement.dir = Language.active.direction;

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i @acryps/language

    Weekly Downloads

    26

    Version

    0.1.1

    License

    none

    Unpacked Size

    133 kB

    Total Files

    15

    Last publish

    Collaborators

    • levvij
    • eggsecuter
    • acryps-admin