1.0.2 • Published 9 years ago

express-lang v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

express-lang

System for lang

Install

$ npm install express-lang

Use

Config

var lang = require('express-lang');
app.use( new Lang( getLang, listLang, options));

Store

let getLang = (ListLangsForUser, callback) => {
	let codeLang = 'es';
	let jsonmsgid = {
		'translate' : [ 'tradicir', 'traducion', ... ],
		'number is %d' : [ 'El numero es %d' ]
	};
	callback( error, jsonmsgid, codeLang )
};

let listLang = (callback) => {
	let ArrayLangs = [ 'es', 'en' ];
	 callback( error, ArrayLangs );
};

Templates

p= t('translate')
p= t('number is %d', 10)

Render

<p>tradicir</p>
<p>El numero es 10</p>

Options

  • localte: The name of the function to translate
  • lang : The decfult languge
  • query : The query to change the language
  • errorSelect : The error when no have thats language
  • errorList : The error when no have the list
1.0.2

9 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.0

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago