npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sails-hook-gengojs

v1.0.0-alpha.6

Published

A Sails hook for gengo.js, the best i18n library for Node.js

Downloads

7

Readme

sails-hook-gengojs

A Sails hook for gengo.js, the best i18n library for Node.js

Join the chat at https://gitter.im/gengojs/sails-hook-gengojs

Build Status npm npm

Introduction

This hook is the official gengo.js for Sails. gengo.js is an i18n library designed to be the best for Node and will officially support Sails. This hook will override the default i18n library that is built into Sails.

Usage

  1. Install the hook with npm i --save sails-hook-gengojs
  2. Copy and paste the options below into the i18n.js file under config/.
  3. Finally, override the default i18n hook in .sailsrc:
{
  "generators": {
    "modules": {}
  },
  "hooks": {
    "i18n": false
  }
}

Once that is done, check out the example for usage. Expect a sails example to be created soon in that same folder so be watching!

i18n.js

/**
 * Internationalization / Localization Settings
 * (sails.config.i18n)
 *
 * If your app will touch people from all over the world, i18n (or internationalization)
 * may be an important part of your international strategy.
 *
 *
 * For more informationom i18n in Sails, check out:
 * http://sailsjs.org/#!/documentation/concepts/Internationalization
 */
module.exports.i18n = {
  /****************************************************************************
   *                                                                          *
   * Override the namespaces used for debugging.                              *
   * See https://github.com/gengojs/core for documentation.                   *
   ****************************************************************************/
  // debug : {
  //  enabled: true,
  //  namespaces:[ 'core', 'parser', 'router', 'api', 'header', 'localize', 'backend' ]
  //},

  /****************************************************************************
   *                                                                          *
   * Override any default plugins for gengojs.                                *
   * See https://github.com/gengojs/core for documentation.                   *
   ****************************************************************************/
  // plugins : {},

  /****************************************************************************
   *                                                                          *
   * API Options                                                              *
   * See https://github.com/gengojs/plugin-api for documentation.             *
   ***************************************************************************/
  // api: {
  //     /** 
  //      * 'global' refers to the api use for i18n your phrases. 
  //      * ( e.g. __("Hello") )
  //      */
  //   "global":"__",
  //   /** 
  //    * 'localize' refers to the api use for i18n your date, time, and number. 
  //    * ( e.g. __l("ja").date().now() )
  //    */
  //   "localize":"__l"
  // },

  /****************************************************************************
   *                                                                          *
   * Backend Options                                                          *
   * See https://github.com/gengojs/plugin-backend for documentation.         *
   ***************************************************************************/
  // backend: {
  //  /**
  //   * 'directory' refers to the path to your dictionary respect to the
  //   * root of your sails app.
  //   */
  //   "directory": "/config/locales",
  //  /**
  //   * 'extension' refers to the file extension of your dictionary.
  //   */
  //   "extension": "json",
  //  /**
  //   * 'prefix' refers to the prefix in your file's name.
  //   */
  //   "prefix": "",
  //  /**
  //   * 'cache' refers to caching and enables gengo to store the dictionary
  //   * without changes until the server has been restarted.
  //   */
  //   "cache": true
  // },

  /****************************************************************************
   *                                                                          *
   * Header Options                                                           *
   * See https://github.com/gengojs/plugin-header for documentation.          *
   ***************************************************************************/
  // header: {
  //   /**
  //    * 'detect' refers to the detection type. Note that it is best to use one type of detection.
  //    *  Note: Any PRs will be accepted that may help gengojs-accept detect multiple types.
  //    */
  //     "detect": {
  //       /**
  //        * 'query' enables query parsing for any key that refers to the locale.
  //        * ( e.g. http://example.com/hello?locale=ja )
  //        */
  //         "query": false,
  //         /**
  //          * 'subdomain' enables subdomain parsing for the locale.
  //          * ( e.g. http://ja.example.com )
  //          */
  //         "subdomain": false,
  //         /**
  //          * 'url' enables url parsing for the locale.
  //          * ( e.g. http://www.example.com/ja )
  //          */
  //         "url": false,
  //         /**
  //          * 'cookie' enables cookie parsing for the locale.
  //          */
  //         "cookie": false,
  //         /**
  //          * 'header' enables header parsing for the locale.
  //          * ( e.g. Accept-Language )
  //          */
  //         "header": true
  //   },
  //   /**
  //    * 'keys' refers to the key used in cookie and query parsing.
  //    */
  //     "keys": {
  //         "cookie": "locale",
  //         "query": "locale"
  //   },
  //   /**
  //    * 'supported' refers to the locales supported in your app.
  //    */
  //     "supported": ["en-US"],
  //     /**
  //      * 'default' refers to the default locale of your app.
  //      */
  //     "default": "en-US"
  // },

  /****************************************************************************
   *                                                                          *
   * Parser Options                                                           *
   * See https://github.com/gengojs/plugin-parser for documentation.          *
   ***************************************************************************/
  // parser : {
  //   /**
  //    * 'type' refers to the type of parser used.
  //    * ( e.g. 'default' = template/interpolation and sprintf, 'format' = message format, '*' = all/auto )
  //    */    
  //   "type": "default",
  //   /**
  //    * 'markdown' refers to options for markdown-it.
  //    * See https://github.com/markdown-it/markdown-it for documentation.
  //    */
  //   "markdown": {
  //   /**
  //    * 'enabled' refers to enabling markdown-it.
  //    */
  //     "enabled": false,
  //     "html": false,
  //     "xhtmlOut": false,
  //     "breaks": false,
  //     "langPrefix": "language-",
  //     "linkify": false,
  //     "typographer": false,
  //     "quotes": "“”‘’"
  //   },
  //   /**
  //    * 'template' refers to interpolation.
  //    * ( e.g. __('{{greet}}', 'hello') -> 'hello'
  //    */
  //   "template": {
  //   /**
  //    * 'enabled' refers to enabling interpolation.
  //    */
  //     "enabled": true,
  //   /**
  //    * 'open' refers to opening expression.
  //    */
  //     "open": "{{",
  //   /**
  //    * 'open' refers to opening expression.
  //    */
  //     "close": "}}"
  //   },
  //   /**
  //    * 'sprintf' refers to sprintf
  //    */
  //   "sprintf": {
  //   /**
  //    * 'enabled' refers to enabling sprintf.
  //    */
  //     "enabled": true
  //   },
  //   /**
  //    * 'keywords' refers to the keywords used in your dictionary.
  //    */
  //   "keywords": {
  //   /**
  //    * 'default' refers to the default phrase in your dictionary (in your native language).
  //    */
  //     "default": "default",
  //   /**
  //    * 'translated' refers to the translated phrase in your dictionary (in another language).
  //    */
  //     "translated": "translated",
  //   /**
  //    * 'global' refers to the globally used dictionary when router is enabled (router independent).
  //    */
  //     "global": "global"
  //   }
  // },

  /****************************************************************************
   *                                                                          *
   * Router Options                                                           *
   * See https://github.com/gengojs/plugin-router for documentation.          *
   ***************************************************************************/
  // router: {
  //  /**
  //   * 'enabled' refers to enabling the special data structure in your dictionary.
  //   * ( e.g. URL path = '/greet/', Dictionary = { 'index': {'greet': { /* ... */ } } } )
  //   */
  //   "enabled": false
  // }
};