Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ezhlobo/russianjs
Russian language support for JavaScript
https://github.com/ezhlobo/russianjs
Last synced: 9 days ago
JSON representation
Russian language support for JavaScript
- Host: GitHub
- URL: https://github.com/ezhlobo/russianjs
- Owner: ezhlobo
- Created: 2013-05-09T20:30:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-23T20:24:09.000Z (over 11 years ago)
- Last Synced: 2024-10-15T14:33:36.119Z (21 days ago)
- Language: JavaScript
- Size: 156 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RussianJS
### Table of content:
* [Getting started](#getting-started)
* [Features](#features)
* [Pluralize](#russianpluralize-number--variants-)
* [Contributions](#contributions)## Getting started
Writing is in progress.
## Features
Each feature is a class and it can be used separately.
### Russian.pluralize( number [, variants ])
It has alias: `Russian.p`.
```js
Russian.pluralize( 3, [ "вещь", "вещи", "вещей" ]) // => "вещи"
```Arguments are flexible. For example:
```js
Russian.p( 1, [ "вещь", "вещи", "вещей" ]);
Russian.p( "1", "вещь", "вещи", "вещей" );
Russian.p( "1.0", "вещь", "вещи", "вещей" );
// all three variants return "вещь"Russian.p([ 5, 1, 3 ], [ "вещь", "вещи", "вещей" ]); // => [ "вещей", "вещь", "вещи" ]
```If you want to use Pluralize class separetely, you can:
```js
var RussianPluralize = new Russian.Pluralize();
RussianPluralize.pluralize( 3, [ "вещь", "вещи", "вещей" ]) // => "вещи"
```If you use pluralize in all parts of code with one variants array, recommend declare variants at start:
```js
var thingPluralize = new Russian.Pluralize([ "вещь", "вещи", "вещей" ]);
thingPluralize.pluralize( 3 ) // => "вещи"
thingPluralize.pluralize( 1, [ "thing" ]) // => "thing"
```## Contributions
Contribuitions always are welcome. RussianJS is written according to [jQuery Core Style Guide](http://docs.jquery.com/JQuery_Core_Style_Guidelines).
Feel free to fork and pull request changes.