1.0.2 • Published 8 years ago

express-lang v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 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

8 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.0

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago