Gengo.js

Visit Gengojs.com for installation, configuration, and documentation.
Also, feel free to fork gengo and the site to add more languages and locale support!
If you would like to see more examples other than the ones on gengojs.com then check out the tests there's 127 possible ways to gengo!
###Tests
npm test
npm run functions
npm run cookies
npm run json
npm run libs
npm run routes
npm run api
###Basic locale creator
npm run factory
##Acknowledgements
gengo was made possible by:
#Change Log
For previous notes on changes, see CHANGELOG.md
####Omega
The file has been renamed to omega.gengo.js
omega 0.2.21
omega 0.2.22
omega 0.2.23
- Fixed typo for default directory
- Small clean up with JSHint
omega 0.2.24
- Replaced dot notation parsing engine, credits to rhalff
- Replaced markdown engine which fixes a minor bug.
- Removed a few try catch statements that caused issues to the core.
- Updated readme
omega 0.2.25
- Router module can now accept urls that contain versions in the following format:
\d{1,2}(\.)\d{1,2}((\.)\d{1,2})?$
Note that adding 'v' before the numbers does not matter just as long its in the form. - If you want to use multiline line in JSON. Just create the text in the following form and it will work:
module.exports = {
"index": {
"something": [
"line1",
" line2",
" line3",
].join('\n'),
"so forth and so on": "something"
}
};
omega 0.2.26
- Updated readme
- Fixed a bug in locale engine where cookie could set something that shouldn't be set.
- Fixed a bug in phrase parser where try catch wouldn't let parser return the original phrase if route results didn't exists
####gengo 0.3.26 Release
- gengo is now at v0.3! If you want to continue to use v0.2 just change the require path to
gengojs/legacy/v0.2/gengo.js
- Changed test's gengo path.
0.3.27
- Fixed bug when a browser with requesting a foreign locale would not change the site.
0.3.28
- Removed removed the global moment and numeral since it's now part of gengo.
- Updated readme
- Updated gengojs.com for v0.3.
0.3.29
- Fixed bug in phrase parser when router is enabled. The parser will get the translated version when its suppose to return the original phrase.
0.3.30
- Removed accept-language npm module from the dependants
- Fixed isssue if result in phrase parser is undefined to just return the phrase.
- All tests still pass
- Discovered that gengo works in Sails.js smoothly in a test app (still testing). It will look like this in config/http.js:
require('gengojs').config({
default: 'en-US',
directory: require('app-root-path') + "/config/locales/",
debug:{
level: ['warn', 'debug']
}
});
module.exports.http = {
middleware: {
__: require('gengojs').init,
order: [
'startRequestTimer',
'cookieParser',
'session',
'myRequestLogger',
'bodyParser',
'handleBodyParserError',
"__",
'compress',
'methodOverride',
'poweredBy',
'$custom',
'router',
'www',
'favicon',
'404',
'500'
],
},
};
0.3.31
- Added support for traditional JSON. Change the extension in config with:
extension: 'json'
- Added support for arrays in JSON format if you want to use multiline. Specifically, you don't need to add
.join('\n')
to the array. - Updated gengo.js site to reflect changes and also added more examples.
- Added more tests. Total of 164 tests and passing.
- The way how path works has changed!! The default is the same but if you specify a certain location other than the default, gengo will automatically append the root folder. Therefore, you no longer need to do something like "../../somewhere". It would automatically point from the root. Example: 'root + your/folder/'
0.3.32
- Updated readme
- Changed locale function to
getLocale()
and setLocale()
.
- They are now exposed to
req
and also work the same way in mashpie's i18n library. - Added more tests. 164 tests and passing