Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cjs-gettext

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cjs-gettext

Application localization tools.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-70%
Maintainers
1
Weekly downloads
 
Created
Source

STB SDK localization

build status npm version dependencies status devDependencies status Gitter RunKit

This localization module is an instance of Emitter module. Contains localization messages data used by other modules and provides methods to requests these messages.

Installation

npm install cjs-gettext

Usage

Add the constructor to the scope and create an instance with some data:

var Gettext = require('cjs-gettext'),
    gettext = new Gettext(data);

Then it's possible to make direct calls to make simple replacement:

console.log(gettext.gettext('some line to be localized'));

Fetch a particular translation of the textual message:

console.log(gettext.pgettext('some context', 'some text'));

Native language translation of a textual message whose grammatical form depends on a number:

console.log(gettext.ngettext('{0} cat', '{0} cats', 1));

Development mode

There is a global var DEVELOP which activates additional consistency checks and protection logic not available in release mode.

Contribution

If you have any problem or suggestion please open an issue here. Pull requests are welcomed with respect to the JavaScript Code Style.

License

cjs-gettext is released under the MIT License.

Keywords

FAQs

Package last updated on 09 Aug 2017

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