cjs-gettext
Advanced tools
Comparing version 1.0.2 to 1.0.4
/** | ||
* @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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6753
93
4
1