@qutejs/i18n

2.0.0-beta.10 • Public • Published

Qute Items Group (@qutejs/i18n)

A Qute internationalization plugin based on polyglot.

Qute is a reactive component model designed for plain old javascript lovers.

Getting Started

Use the Qute project generator to create a new Qute application or component project:

npm init @qutejs

Go here for the Qute i18n documentation.

Installing

npm install @qutejs/i18n

Usage

import Qute from '@qutejs/runtime';
import '@qutejs/i18n';

var i18n = new Qute.Intl({
	resources: {
		en: {
			hello: 'Hello World!'
		},
		fr: {
			hello: 'Bonjour monde!'
		},
		ro: 'remote/messages-ro.json'
	}
});
i18n.load('en').then(function() {
	// phrases loaded -> ready to translate
	// you can mount your application now
})

Then you can use the translate method t() from a Qute component template:

<div>{{t('hello')}}</div>

Building

Qute packages are built from the Qute multi-package repository root. See github.

Authors

Bogdan Stefanescu - Intial Work - Quandora

License

MIT

Package Sidebar

Install

npm i @qutejs/i18n

Homepage

qutejs.org

Weekly Downloads

0

Version

2.0.0-beta.10

License

MIT

Unpacked Size

222 kB

Total Files

9

Last publish

Collaborators

  • bstefanescu