New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gengojs

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gengojs

The best and simple i18n library for Express 4 and Sails.js

  • 0.3.50
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
decreased by-9.09%
Maintainers
1
Weekly downloads
 
Created
Source

Gengo.js

Build Status Dependency Status License Status Downloads Version

NPM

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

  • Updated Japanese docs.

###Supported locales

The list is huge! See the map file for a list of locales.

###Supported file extensions:

  • json
{
  ...
}

  • js (modulized json)
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

  • Fixed readme

0.3.47

  • Updated dependencies

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

#run all
npm test

#run functions
npm run functions

#run cookies
npm run cookies

#run json
npm run json

#run libs
npm run libs

#run routes
npm run routes

#run api
npm run api

###Basic locale creator

#run factory
npm run factory

##Acknowledgements gengo was made possible by:

Keywords

FAQs

Package last updated on 16 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc