gengojs-default-api
The default API plugin for gengo.js.
This module will be used for gengo.js.
Note: The API examples defined are respect to the default parser.
An example usage with options is:
var gengo = require('gengojs');
var api = require('gengojs-default-api');
var app = require('express')();
app.use(gengo({
api:{
}
},));
The default API is already included in gengo.js so you should not have to require it.
Documentation
See documentation
Options
{
"global":"__",
"localize":"__l"
}
Internal API
None
Dependencies
this.header.getLocale(locale:String)
from Header
classthis.header.setLocale(locale:String)
from Header
classthis.header.detectLocale(locale:String)
from Header
class (optional)supported:Array
from Header
optionsthis.backend.catalog(locale:String)
from Backend
class
Debug
Unix:
DEBUG=default-api
Windows:
SET DEBUG=default-api
Reserved words
There are a few reserved words in the API. These words are used for
overriding purposes. See the example:
__({phrase:'Hello!'});
__('Hello!', {parser:'default'});
__('You have {n, plural, =0 {no photos.}=1 {one photo.}other {# photos.}}', {parser:'format'});
Contribute
Feel free to contribute or even fork the project. This plugin has been
written in ES6 and can be seen under lib/index.js
.