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!
To fork gengo visit http://www.github.com/iwatakeshi/gengojs
To fork the site visit http://www.github.com/iwatakeshi/gengojs-site
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!
###Coming soon
###Supported locales
The list is huge! See the map file for a list of locales.
###Supported file extensions:
{
...
}
module.exports = {
}
###Tested environmnents
- Elementary OS (Ubuntu based distro and mainly used for developing gengo)
- Windows 10 (works great but make sure to use nodejs's path.normalize('/path/to/locales') for simplicity)
###Sails.js setup
See sails/(ejs or jade)/config/http.js.
For some reason, I am not able to use '__' like before but it will work if you change the global variable for gengo to something simple of your choice. The examples have their global variables set to '__g'
Update
I didn't realize it till now but gengo must be set in a certain order for '__' to work. I've created a gist so that you can just copy and paste it into yourSailsApp/config/. Therefore there is no need to mess with sail's built in i18n or its locales. This will work on all platforms (linux, mac, windows)
gist: https://gist.github.com/iwatakeshi/e6f73cd0f19ce1816c70
###Recent Changes
For previous notes on changes, see CHANGELOG.md
0.3.40
- Added travis ci, dependency badge, and travis badge and other badges.
- Fixed langs.js map file. Added tests for
language()
, getLocale()
, setLocale()
0.3.41
- Added more custom markdown syntax such as superscript.
- Removed a few markdown syntaxes that may become a conflict with mustache syntax.
- Replaced comparison method in loader module. It should compare json objects. If the objects are different then update the cache.
0.3.42
- Apologies. Removed comparison method and replaced with underscore's after I realized underscore had their own.
- Also auto-cache* feature now works for both .json and .js files. Meaning you can update your dictionary live in production and development. Gengo updates the cache only if the files have been updated.
0.3.43
- Updated English docs for gengojs-site.
- Added keyword to package.json
0.3.44
- Improved config module for gengo
- Replaced underscore with lodash.
- Removed utils module and replaced with regex.js.
- Replaced sails app. I will add more templates later.
0.3.45
- Added sails app with jade.
- gengo now has two sails apps that runs perfectly. One with EJS and the other with Jade. (Tried creating hbs app but sails seem to fail? I must have done something wrong. But it should work with most templating engines.)
- Updated readme
0.3.46
0.3.47
0.3.48
- Fixed and updated readme (missing changes from last publish)
- Added an override option for directory's path. You can now pass an object with a
path
key which gengo will not append a root to the given path. This is useful in cases where for some reason the root points to a /bin folder (something that happened to me in Windows).
//example
gengo.config({
directory: {
path: __dirname + '/locales'
}
});
0.3.49
- Fixed missing root for directory. Apologies if 3.48 affected you.
- All paths are normalized. This will allow node to change the paths from
/
to \\
on windows. Essentially making gengo cross platform.
###Notes
- Cache - gengo does cache but will replace the cached object if changes have occurred.
###Message from the author
I want to thank those who tried or are actually are using gengo. Gengo was a learning curve but I know that this is just the beginning. As mentioned before, gengo still has room for improvement. I think better can be done but it's completely impossible without any feeback or contribution. If you would like to contribute, give feedback, or want to know how gengo works the please feel free to give me a holler at @iwatakeshi. Again thanks! - iwatakeshi
###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: