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

cjs-gettext

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cjs-gettext - npm Package Compare versions

Comparing version 1.0.2 to 1.0.4

2

index.js
/**
* @license The MIT License (MIT)
* @copyright Stanislav Kalashnik <darkpark.main@gmail.com>
* @author Stanislav Kalashnik <darkpark.main@gmail.com>
*/

@@ -5,0 +5,0 @@

{
"name": "cjs-gettext",
"version": "1.0.2",
"version": "1.0.4",
"description": "Application localization tools.",

@@ -14,9 +14,9 @@ "author": {

"scripts": {
"lint": "eslint .",
"lint": "eslint --ignore-pattern '/docs/' .",
"test": "npm run lint",
"jsdoc": "jsdoc --destination doc *.js readme.md"
"jsdoc": "jsdoc --destination docs *.js readme.md"
},
"devDependencies": {
"eslint": "4.*.*",
"cjs-eslint-config": "1.*.*"
"cjs-eslint": "^1.1.1",
"jsdoc": "^3.5.5"
},

@@ -23,0 +23,0 @@ "keywords": [

@@ -9,3 +9,3 @@ STB SDK localization

[![Gitter](https://img.shields.io/badge/gitter-join%20chat-blue.svg?style=flat-square)](https://gitter.im/DarkPark/cjssdk)
[![RunKit](https://img.shields.io/badge/RunKit-try-yellow.svg?style=flat-square)](https://runkit.com/npm/cjs-gettext)
[![RunKit](https://img.shields.io/badge/RunKit-try-yellow.svg?style=flat-square)](https://npm.runkit.com/cjs-gettext)

@@ -26,2 +26,30 @@

Example `data` format:
```json
{
"meta": {
"charset": "utf-8",
"project": "downloads",
"language": "ru",
"plural": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)"
},
"data": {
"": {
"some text": "некоторый текст",
"Close": "Закрыть",
"Error": "Ошибка",
"File name:": "Имя файла:",
},
"some context": {
"some text": "Лирика",
"Close": "Выйти",
"Error": "Недопустимое действие",
}
}
}
```
Add the constructor to the scope and create an instance with some data:

@@ -37,3 +65,3 @@

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

@@ -61,4 +89,4 @@

If you have any problem or suggestion please open an issue [here](https://github.com/cjssdk/gettext/issues).
Pull requests are welcomed with respect to the [JavaScript Code Style](https://github.com/DarkPark/jscs).
If you have any problems or suggestions please open an [issue](https://github.com/cjssdk/gettext/issues)
according to the contribution [rules](.github/contributing.md).

@@ -65,0 +93,0 @@

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