first commit

This commit is contained in:
2026-09-08 20:28:54 +08:00
commit 2ada8d3d5a
37380 changed files with 4886169 additions and 0 deletions
+147
View File
@@ -0,0 +1,147 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [2.3.0](https://github.com/messageformat/messageformat/compare/messageformat@2.2.1...messageformat@2.3.0) (2019-07-17)
### Bug Fixes
* Update dependencies ([b4907b5](https://github.com/messageformat/messageformat/commit/b4907b5))
* Update dependencies ([c395452](https://github.com/messageformat/messageformat/commit/c395452))
### Features
* **messageformat:** Add customFormatters to constructor options ([03b3b4f](https://github.com/messageformat/messageformat/commit/03b3b4f))
* **messageformat:** Add internal options object ([4741c9a](https://github.com/messageformat/messageformat/commit/4741c9a))
* **messageformat:** Add options as second constructor argument ([ec08716](https://github.com/messageformat/messageformat/commit/ec08716))
* **messageformat:** Update index.d.ts ([6df0797](https://github.com/messageformat/messageformat/commit/6df0797))
## [2.2.1](https://github.com/messageformat/messageformat/compare/messageformat@2.2.0...messageformat@2.2.1) (2019-05-18)
### Bug Fixes
* Fix browser field in messageformat/package.json ([341bc6f](https://github.com/messageformat/messageformat/commit/341bc6f))
# [2.2.0](https://github.com/messageformat/messageformat/compare/messageformat@2.1.0...messageformat@2.2.0) (2019-05-02)
### Bug Fixes
* **messageformat:** Build Web export from src with babel-loader, configured with browser targets ([3548009](https://github.com/messageformat/messageformat/commit/3548009))
* **messageformat:** Refactor/fix UMD/CommonJS exports ([41f6145](https://github.com/messageformat/messageformat/commit/41f6145))
### Features
* **formatters:** Split into its own package from messageformat ([ed36829](https://github.com/messageformat/messageformat/commit/ed36829))
* **messageformat:** Drop dependency on reserved-words, inlining data ([bfc2d89](https://github.com/messageformat/messageformat/commit/bfc2d89))
* **messageformat:** Move sources to src/, use Babel as transpiler targeting Node 6.5 ([d06553c](https://github.com/messageformat/messageformat/commit/d06553c))
* **messageformat:** Refactor compiler.js as ES6, splitting out utils.js ([91dc2ac](https://github.com/messageformat/messageformat/commit/91dc2ac))
* **messageformat:** Refactor messageformat.js as ES6 ([d29470f](https://github.com/messageformat/messageformat/commit/d29470f))
* **messageformat:** Refactor plurals.js as ES6 ([2a93ebf](https://github.com/messageformat/messageformat/commit/2a93ebf))
* **messageformat:** Refactor runtime.js as ES6 ([05125e0](https://github.com/messageformat/messageformat/commit/05125e0))
* **messageformat:** Replace Browserify + UglifyJS with Webpack as build tool ([620ca59](https://github.com/messageformat/messageformat/commit/620ca59))
# 2.1.0 (2019-03-03)
### Features
* Harmonise code style with Prettier & add linting with ESLint ([#220](https://github.com/messageformat/messageformat/issues/220)) ([18bc474](https://github.com/messageformat/messageformat/commit/18bc474))
* **compiler:** Allow MessageFormat content in function parameters ([e631239](https://github.com/messageformat/messageformat/commit/e631239))
* **messageformat:** Update messageformat-parser to 4.0 ([df76408](https://github.com/messageformat/messageformat/commit/df76408))
* Refactor as a monorepo, using Lerna ([#212](https://github.com/messageformat/messageformat/issues/212)) ([f573ffc](https://github.com/messageformat/messageformat/commit/f573ffc))
# 2.0.5 (2018-12-16)
### Bug Fixes
* Support BCP47 tag resolution for `new MessageFormat().compile(src, "fr-FR")` ([#197](https://github.com/messageformat/messageformat/issues/197))
* TS definitions:
* Define `toString` with optional `global` argument ([#208](https://github.com/messageformat/messageformat/issues/208) by [@rbardini](https://github.com/rbardini))
* Use type union parameter for MessageFormat constructor ([#210](https://github.com/messageformat/messageformat/issues/210) by [@lephyrus](https://github.com/lephyrus))
* Fix guide.md typo ([#211](https://github.com/messageformat/messageformat/issues/211) by [@Kemito](https://github.com/Kemito))
# 2.0.4 (2018-07-21)
### Bug Fixes
* Fix index.d.ts (reported [#199](https://github.com/messageformat/messageformat/issues/199) and fixed [#200](https://github.com/messageformat/messageformat/issues/200) by [@mbarz](https://github.com/mbarz))
# 2.0.3 (2018-07-19)
### Bug Fixes
* Include index.d.ts in the npm release
* Update dependencies
# 2.0.2 (2018-04-23)
### Bug Fixes
* Remove ES6-isms from messages.js (were blocking minification)
# 2.0.1 (2018-04-18)
### Bug Fixes
* Add TypeScript definition file ([#194](https://github.com/messageformat/messageformat/issues/194))
* Force input to string in `MessageFormat.escape`
# 2.0.0 (2018-04-04)
### Breaking Changes
* Publish the `messageformat` CLI binary as its own package [messageformat-cli](https://www.npmjs.com/package/messageformat-cli)
* Support reading locale data from `.properties` files
* Read config from `package.json` and `messageformat.rc.json`
* Add new options `--delimiters`, `--eslint-disable`, `--extensions`, `--outfile`, and `--simplify`
* Update [messageformat-parser](https://www.npmjs.com/package/messageformat-parser) from 1.1.0 to 3.0.0
* To conform with the ICU MessageFormat standard, escaping with a `\` is no longer supported. Instead, use ['quotes'](http://userguide.icu-project.org/formatparse/messages#TOC-Quoting-Escaping) to escape `{}` and `#` when needed. To help deal with this change, we provide a [codemod](https://github.com/messageformat/parser/blob/v3.0.0/codemod-fix-backslash-escapes.js) to handle the change for you.
* The optional parameter passed to a formatter function is now a string, rather than an array of strings. So with e.g. `{var, func, your param}`, the parameter passed to `func` would be `'your param'`.
* Closer conformance with the spec for identifiers, which means that characters in [`[:Pattern_Syntax:]`](https://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3APattern_Syntax%3A%5D&g=&i=) are no longer allowed in identifiers. Note in particular that this includes `-`, which was previously allowed.
* Expect `Intl` to exist and drop `#setIntlSupport()`
* Compiled output:
* Default to ES6 module output from `#toString()` with no parameters
* Drop support for `#toString('exports')`; use `#toString('module.exports')` for CommonJS output
### Features
* Rename the repository as [messageformat/messageformat](https://github.com/messageformat/messageformat), dropping the final `.js`
* Completely revamp the [website](https://messageformat.github.io/messageformat/)
* Add a runtime accessor class [Messages](https://messageformat.github.io/messageformat/Messages), available as `import Messages from 'messageformat/messages'`
* Refactor formatters
* Add `duration` formatter
* number: Add `currency:CODE` option
* Use npm scripts rather than Makefile to test and build the package
For details of v1 and earlier releases, please consult the project's [GitHub release info](https://github.com/messageformat/messageformat/releases?after=v2.0.0-beta.1).
+20
View File
@@ -0,0 +1,20 @@
Copyright 2012-2018 Alex Sexton, Eemeli Aro, and Contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+63
View File
@@ -0,0 +1,63 @@
<div class="main-title">
<img align="right" width="100" height="100" src="https://messageformat.github.io/messageformat/logo/messageformat.svg">
<a class="badge" href="http://travis-ci.org/messageformat/messageformat"><img src="https://secure.travis-ci.org/messageformat/messageformat.svg" alt="Build Status"></a>
<h1>messageformat</h1>
</div>
The experience and subtlety of your program's text can be important. Messageformat is a mechanism for handling both **pluralization** and **gender** in your applications. It can also lead to much better translations, as it's designed to support [all the languages](http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html) included in the [Unicode CLDR](http://cldr.unicode.org/).
The ICU has an [official guide](http://userguide.icu-project.org/formatparse/messages) for the format. Messageformat supports and extends all parts of the [standard](http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessageFormat.html), with the exception of the deprecated ChoiceFormat.
There is a good slide-deck on [Plural and Gender in Translated Messages](https://docs.google.com/presentation/d/1ZyN8-0VXmod5hbHveq-M1AeQ61Ga3BmVuahZjbmbBxo/pub?start=false&loop=false&delayms=3000#slide=id.g1bc43a82_2_14) by Markus Scherer and Mark Davis. But, again, remember that many of these problems apply even if you're only outputting english.
## What problems does it solve?
Using messageformat, you can separate your code from your text formatting, while enabling much more humane expressions. In other words, you won't need to see this anymore in your output:
> There are 1 results.<br>
> There are 2 result(s).<br>
> Number of results: 3.
On a more fundamental level, messageformat and its associated tools can help you build an effective workflow for UI texts and translations, keeping message sources in human-friendly formats, compiling them into JavaScript during your build phase, and making them easy to use from your application code.
## What does it look like?
With this message:
```js
const msgSrc = `{GENDER, select,
male {He}
female {She}
other {They}
} found {RES, plural,
=0 {no results}
one {1 result}
other {# results}
}.`;
```
You'll get these results:
```js
const MessageFormat = require('messageformat');
const mf = new MessageFormat('en');
const msg = mf.compile(msgSrc);
msg({ GENDER: 'male', RES: 1 }); // 'He found 1 result.'
msg({ GENDER: 'female', RES: 1 }); // 'She found 1 result.'
msg({ GENDER: 'male', RES: 0 }); // 'He found no results.'
msg({ RES: 2 }); // 'They found 2 results.'
```
## Getting Started
To install just the core package, use:
```
npm install messageformat
```
This includes the MessageFormat compiler and a runtime accessor class that provides a slightly nicer API for working with larger numbers of messages. Our [Format Guide] will help with the ICU MessageFormat Syntax, and the [Build-time Compilation Guide] provides some options for integrating messageformat to be a part of your workflow around UI texts and translations.
[format guide]: https://messageformat.github.io/messageformat/page-guide
[build-time compilation guide]: https://messageformat.github.io/messageformat/page-build
+33
View File
@@ -0,0 +1,33 @@
declare namespace MessageFormat {
type Msg = { (params: {}): string; toString(global?: string): string };
type Formatter = (val: any, lc: string, arg?: string) => string;
type SrcMessage = string | SrcObject;
interface SrcObject {
[key: string]: SrcMessage;
}
interface Options {
biDiSupport?: boolean;
customFormatters?: { [name: string]: Formatter };
pluralKeyChecks?: boolean;
strictNumberSign?: boolean;
}
}
declare class MessageFormat {
constructor(
locales?: { [locale: string]: Function } | string[] | string,
options?: MessageFormat.Options
);
addFormatters: (format: { [name: string]: MessageFormat.Formatter }) => this;
disablePluralKeyChecks: () => this;
setBiDiSupport: (enable: boolean) => this;
setStrictNumberSign: (enable: boolean) => this;
compile: (
messages: MessageFormat.SrcMessage,
locale?: string
) => MessageFormat.Msg;
}
export = MessageFormat;
+1
View File
@@ -0,0 +1 @@
module.exports = require('./lib/messageformat').default;
+148
View File
@@ -0,0 +1,148 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _messageformatParser = require("messageformat-parser");
var _utils = require("./utils");
/** @private */
class Compiler {
/** Creates a new message compiler. Called internally from {@link MessageFormat#compile}.
*
* @private
* @param {MessageFormat} mf - A MessageFormat instance
* @property {object} locales - The locale identifiers that are used by the compiled functions
* @property {object} runtime - Names of the core runtime functions that are used by the compiled functions
* @property {object} formatters - The formatter functions that are used by the compiled functions
*/
constructor(mf) {
this.mf = mf;
this.lc = null;
this.locales = {};
this.runtime = {};
this.formatters = {};
}
/** Recursively compile a string or a tree of strings to JavaScript function sources
*
* If `src` is an object with a key that is also present in `plurals`, the key
* in question will be used as the locale identifier for its value. To disable
* the compile-time checks for plural & selectordinal keys while maintaining
* multi-locale support, use falsy values in `plurals`.
*
* @private
* @param {string|object} src - the source for which the JS code should be generated
* @param {string} lc - the default locale
* @param {object} plurals - a map of pluralization keys for all available locales
*/
compile(src, lc, plurals) {
if (typeof src != 'object') {
this.lc = lc;
const pc = plurals[lc] || {
cardinal: [],
ordinal: []
};
pc.strict = !!this.mf.options.strictNumberSign;
const r = (0, _messageformatParser.parse)(src, pc).map(token => this.token(token));
return `function(d) { return ${r.join(' + ') || '""'}; }`;
} else {
const result = {};
for (var key in src) {
// eslint-disable-next-line no-prototype-builtins
var lcKey = plurals.hasOwnProperty(key) ? key : lc;
result[key] = this.compile(src[key], lcKey, plurals);
}
return result;
}
}
/** @private */
cases(token, plural) {
let needOther = token.type === 'select' || !this.mf.hasCustomPluralFuncs;
const r = token.cases.map(({
key,
tokens
}) => {
if (key === 'other') needOther = false;
const s = tokens.map(tok => this.token(tok, plural));
return (0, _utils.propname)(key) + ': ' + (s.join(' + ') || '""');
});
if (needOther) throw new Error("No 'other' form found in " + JSON.stringify(token));
return `{ ${r.join(', ')} }`;
}
/** @private */
token(token, plural) {
if (typeof token == 'string') return JSON.stringify(token);
let fn;
let args = [(0, _utils.propname)(token.arg, 'd')];
switch (token.type) {
case 'argument':
return this.mf.options.biDiSupport ? (0, _utils.biDiMarkText)(args[0], this.lc) : args[0];
case 'select':
fn = 'select';
if (plural && this.mf.options.strictNumberSign) plural = null;
args.push(this.cases(token, plural));
this.runtime.select = true;
break;
case 'selectordinal':
fn = 'plural';
args.push(0, (0, _utils.funcname)(this.lc), this.cases(token, token), 1);
this.locales[this.lc] = true;
this.runtime.plural = true;
break;
case 'plural':
fn = 'plural';
args.push(token.offset || 0, (0, _utils.funcname)(this.lc), this.cases(token, token));
this.locales[this.lc] = true;
this.runtime.plural = true;
break;
case 'function':
if (!(token.key in this.mf.fmt) && token.key in this.mf.constructor.formatters) {
const fmt = this.mf.constructor.formatters[token.key];
this.mf.fmt[token.key] = fmt(this.mf);
}
if (!this.mf.fmt[token.key]) throw new Error(`Formatting function ${JSON.stringify(token.key)} not found!`);
args.push(JSON.stringify(this.lc));
if (token.param) {
if (plural && this.mf.options.strictNumberSign) plural = null;
const s = token.param.tokens.map(tok => this.token(tok, plural));
args.push('(' + (s.join(' + ') || '""') + ').trim()');
}
fn = (0, _utils.propname)(token.key, 'fmt');
this.formatters[token.key] = true;
break;
case 'octothorpe':
if (!plural) return '"#"';
fn = 'number';
args = [(0, _utils.propname)(plural.arg, 'd'), JSON.stringify(plural.arg)];
if (plural.offset) args.push(plural.offset);
this.runtime.number = true;
break;
}
if (!fn) throw new Error('Parser error for token ' + JSON.stringify(token));
return `${fn}(${args.join(', ')})`;
}
}
exports.default = Compiler;
+451
View File
@@ -0,0 +1,451 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _messageformatFormatters = _interopRequireDefault(require("messageformat-formatters"));
var _compiler = _interopRequireDefault(require("./compiler"));
var _utils = require("./utils");
var _plurals = require("./plurals");
var _runtime = _interopRequireDefault(require("./runtime"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class MessageFormat {
/**
* The default locale
*
* Used by the constructor when no `locale` has been set to initialise the value
* of its instance counterpart, `MessageFormat#defaultLocale`.
*
* @memberof MessageFormat
* @default 'en'
*/
/** Escape special characaters
*
* Surround the characters `{` and `}` in the input string with 'quotes'.
* This will allow those characters to not be considered as MessageFormat
* control characters.
*
* @memberof MessageFormat
* @param {string} str - The input string
* @param {boolean} [octothorpe=false] - Include `#` in the escaped characters
* @returns {string} The escaped string
*/
static escape(str, octothorpe) {
const esc = octothorpe ? /[#{}]/g : /[{}]/g;
return String(str).replace(esc, "'$&'");
}
/**
* Create a new MessageFormat compiler
*
* If set, the `locale` parameter limits the compiler to use a subset of the 204
* languages' pluralisation rules made available by the Unicode CLDR.
*
* Leaving `locale` undefined or using an array of strings will create a
* MessageFormat instance with multi-language support. To select which to use,
* use the second parameter of `{@link MessageFormat#compile compile()}`, or use
* message keys corresponding to your locales. The default locale will be the
* first entry of the array, or `{@link MessageFormat.defaultLocale defaultLocale}`
* if not set.
*
* A string `locale` will create a single-locale MessageFormat instance.
*
* Using an object `locale` with all properties of type `function` allows for
* the use of custom or externally defined pluralisation rules; in this case
*
* @class MessageFormat
* @classdesc MessageFormat-to-JavaScript compiler
* @param {string|string[]|Object} [locale] - The locale(s) to use
* @param {Object} [options] - Compiler options
* @param {boolean} [options.biDiSupport=false] - Add Unicode control
* characters to all input parts to preserve the integrity of the output
* when mixing LTR and RTL text
* @param {Object} [options.customFormatters] - Map of custom formatting
* functions to include. See the {@tutorial guide} for more details.
* @param {boolean} [options.pluralKeyChecks=true] - Validate plural and
* selectordinal case keys according to the current locale
* @param {boolean} [options.strictNumberSign=false] - Allow `#` only directly
* within a plural or selectordinal case, rather than in any inner select
* case as well.
*
* ```
* import MessageFormat from 'messageformat'
* ```
*/
constructor(locale, options) {
this.options = Object.assign({
biDiSupport: false,
customFormatters: null,
pluralKeyChecks: true,
strictNumberSign: false
}, options);
this.pluralFuncs = {};
if (typeof locale === 'string') {
this.pluralFuncs[locale] = (0, _plurals.getPlural)(locale, this.options);
this.defaultLocale = locale;
} else if (Array.isArray(locale)) {
locale.forEach(lc => {
this.pluralFuncs[lc] = (0, _plurals.getPlural)(lc, this.options);
});
this.defaultLocale = locale[0];
} else {
if (locale) {
const lcKeys = Object.keys(locale);
for (let i = 0; i < lcKeys.length; ++i) {
const lc = lcKeys[i];
if (typeof locale[lc] !== 'function') {
const errMsg = 'Expected function value for locale ' + String(lc);
throw new Error(errMsg);
}
this.pluralFuncs[lc] = locale[lc];
if (!this.defaultLocale) this.defaultLocale = lc;
}
}
if (this.defaultLocale) {
this.hasCustomPluralFuncs = true;
} else {
this.defaultLocale = MessageFormat.defaultLocale;
this.hasCustomPluralFuncs = false;
}
}
this.fmt = Object.assign({}, this.options.customFormatters);
this.runtime = new _runtime.default(this);
}
/**
* Add custom formatter functions to this MessageFormat instance. See the
* {@tutorial guide} for more details.
*
* The general syntax for calling a formatting function in MessageFormat is
* `{var, fn[, arg]}`, where `var` is the variable that will be set by the
* user code, `fn` determines the formatting function, and `arg` is an
* optional string argument.
*
* In JavaScript, each formatting function is called with three parameters;
* the variable value `v`, the current locale `lc`, and `arg` as a string, or
* undefined if not set. `arg` will be trimmed of surrounding whitespace.
* Formatting functions should not have side effects.
*
* @memberof MessageFormat
* @instance
* @param {Object.<string,function>} fmt - A map of formatting functions
* @returns {MessageFormat} The MessageFormat instance, to allow for chaining
*
* @example
* const mf = new MessageFormat('en-GB')
* mf.addFormatters({
* upcase: function(v) { return v.toUpperCase() },
* locale: function(v, lc) { return lc },
* prop: function(v, lc, p) { return v[p] }
* })
* const messages = mf.compile({
* describe: 'This is {VAR, upcase}.',
* locale: 'The current locale is {_, locale}.',
* answer: 'Answer: {obj, prop, a}'
* }
*
* messages.describe({ VAR: 'big' }) // 'This is BIG.'
* messages.locale({}) // 'The current locale is en-GB.'
* messages.answer({ obj: {q: 3, a: 42} }) // 'Answer: 42'
*/
addFormatters(fmt) {
const fmtKeys = Object.keys(fmt);
for (let i = 0; i < fmtKeys.length; ++i) {
const name = fmtKeys[i];
this.fmt[name] = fmt[name];
}
return this;
}
/**
* Disable the validation of plural & selectordinal keys
*
* Previous versions of messageformat allowed the use of plural &
* selectordinal statements with any keys; now we throw an error when a
* statement uses a non-numerical key that will never be matched as a
* pluralization category for the current locale.
*
* Use this method to disable the validation and allow usage as previously.
* To re-enable, you'll need to create a new MessageFormat instance.
*
* @memberof MessageFormat
* @instance
* @returns {MessageFormat} The MessageFormat instance, to allow for chaining
*
* @example
* const mf = new MessageFormat('en')
* const msg = '{X, plural, zero{no answers} one{an answer} other{# answers}}'
*
* mf.compile(msg)
* // Error: Invalid key `zero` for argument `X`. Valid plural keys for this
* // locale are `one`, `other`, and explicit keys like `=0`.
*
* mf.disablePluralKeyChecks()
* mf.compile(msg)({ X: 0 }) // '0 answers'
*/
disablePluralKeyChecks() {
this.options.pluralKeyChecks = false;
for (const lc in this.pluralFuncs) {
const pf = this.pluralFuncs[lc];
if (pf) {
pf.cardinal = [];
pf.ordinal = [];
}
}
return this;
}
/**
* Enable or disable the addition of Unicode control characters to all input
* to preserve the integrity of the output when mixing LTR and RTL text.
*
* @see http://cldr.unicode.org/development/development-process/design-proposals/bidi-handling-of-structured-text
*
* @memberof MessageFormat
* @instance
* @param {boolean} [enable=true]
* @returns {MessageFormat} The MessageFormat instance, to allow for chaining
*
* @example
* // upper case stands for RTL characters, output is shown as rendered
* const mf = new MessageFormat('en')
*
* mf.compile('{0} >> {1} >> {2}')(['first', 'SECOND', 'THIRD'])
* // 'first >> THIRD << SECOND'
*
* mf.setBiDiSupport(true)
* mf.compile('{0} >> {1} >> {2}')(['first', 'SECOND', 'THIRD'])
* // 'first >> SECOND >> THIRD'
*/
setBiDiSupport(enable) {
this.options.biDiSupport = !!enable || typeof enable == 'undefined';
return this;
}
/**
* According to the ICU MessageFormat spec, a `#` character directly inside a
* `plural` or `selectordinal` statement should be replaced by the number
* matching the surrounding statement. By default, messageformat will replace
* `#` signs with the value of the nearest surrounding `plural` or
* `selectordinal` statement.
*
* Set this to true to follow the stricter ICU MessageFormat spec, and to
* throw a runtime error if `#` is used with non-numeric input.
*
* @memberof MessageFormat
* @instance
* @param {boolean} [enable=true]
* @returns {MessageFormat} The MessageFormat instance, to allow for chaining
*
* @example
* const mf = new MessageFormat('en')
* const src = {
* cookie: '#: {X, plural, =0{no cookies} one{a cookie} other{# cookies}}',
* pastry: `{X, plural,
* one {{P, select, cookie{a cookie} other{a pie}}}
* other {{P, select, cookie{# cookies} other{# pies}}}
* }`
* }
* let messages = mf.compile(src)
*
* messages.cookie({ X: 3 }) // '#: 3 cookies'
* messages.pastry({ X: 3, P: 'pie' }) // '3 pies'
*
* mf.setStrictNumberSign(true)
* messages = mf.compile(src)
* messages.pastry({ X: 3, P: 'pie' }) // '# pies'
*/
setStrictNumberSign(enable) {
this.options.strictNumberSign = !!enable || typeof enable == 'undefined';
this.runtime.setStrictNumber(this.options.strictNumberSign);
return this;
}
/**
* Compile messages into storable functions
*
* If `messages` is a single string including ICU MessageFormat declarations,
* the result of `compile()` is a function taking a single Object parameter
* `d` representing each of the input's defined variables.
*
* If `messages` is a hierarchical structure of such strings, the output of
* `compile()` will match that structure, with each string replaced by its
* corresponding JavaScript function.
*
* If the input `messages` -- and therefore the output -- of `compile()` is an
* object, the output object will have a `toString(global)` method that may be
* used to store or cache the compiled functions to disk, for later inclusion
* in any JS environment, without a local MessageFormat instance required. If
* its `global` parameter is null or undefined, the result is an ES6 module
* with a default export. If `global` is a string containing `.`, the result
* will be a script setting its value. Otherwise, the output defaults to an UMD
* pattern that sets the value of `global` if used outside of AMD and CommonJS
* loaders.
*
* If `locale` is not set, it will default to
* `{@link MessageFormat.defaultLocale defaultLocale}`; using a key at any
* depth of `messages` that is a declared locale will set its child elements to
* use that locale.
*
* If `locale` is set, it is used for all messages, ignoring any otherwise
* matching locale keys. If the constructor declared any locales, `locale`
* needs to be one of them.
*
* If `compile()` is called with a `messages` object on a MessageFormat
* instance that does not specify any locales, it will match keys to *all* 204
* available locales. This is really useful if you want your messages to be
* completely determined by your data, but may provide surprising results if
* your input includes any 2-3 letter strings that are not locale identifiers.
*
* @memberof MessageFormat
* @instance
* @param {string|Object} messages - The input message(s) to be compiled, in ICU MessageFormat
* @param {string} [locale] - A locale to use for the messages
* @returns {function|Object} The first match found for the given locale(s)
*
* @example
* const mf = new MessageFormat('en')
* const msg = mf.compile('A {TYPE} example.')
*
* msg({ TYPE: 'simple' }) // 'A simple example.'
*
* @example
* const mf = new MessageFormat(['en', 'fi'])
* const messages = mf.compile({
* en: { a: 'A {TYPE} example.',
* b: 'This is the {COUNT, selectordinal, one{#st} two{#nd} few{#rd} other{#th}} example.' },
* fi: { a: '{TYPE} esimerkki.',
* b: 'Tämä on {COUNT, selectordinal, other{#.}} esimerkki.' }
* })
*
* messages.en.b({ COUNT: 2 }) // 'This is the 2nd example.'
* messages.fi.b({ COUNT: 2 }) // 'Tämä on 2. esimerkki.'
*
* @example
* const fs = require('fs')
* const mf = new MessageFormat('en')
* const msgSet = {
* a: 'A {TYPE} example.',
* b: 'This has {COUNT, plural, one{one member} other{# members}}.',
* c: 'We have {P, number, percent} code coverage.'
* }
* const msgStr = mf.compile(msgSet).toString('module.exports')
* fs.writeFileSync('messages.js', msgStr)
*
* ...
*
* const messages = require('./messages')
*
* messages.a({ TYPE: 'more complex' }) // 'A more complex example.'
* messages.b({ COUNT: 3 }) // 'This has 3 members.'
*/
compile(messages, locale) {
function _stringify(obj, level) {
if (!level) level = 0;
if (typeof obj != 'object') return obj;
let indent = '';
for (let i = 0; i < level; ++i) indent += ' ';
const o = [];
for (const k in obj) {
const v = _stringify(obj[k], level + 1);
o.push(`\n${indent} ${(0, _utils.propname)(k)}: ${v}`);
}
return `{${o.join(',')}\n${indent}}`;
}
let pf = {};
if (Object.keys(this.pluralFuncs).length === 0) {
if (locale) {
const pfn0 = (0, _plurals.getPlural)(locale, this.options);
if (!pfn0) {
const lcs = JSON.stringify(locale);
throw new Error(`Locale ${lcs} not found!`);
}
pf[locale] = pfn0;
} else {
locale = this.defaultLocale;
pf = (0, _plurals.getAllPlurals)(this.options);
}
} else if (locale) {
const pfn1 = this.pluralFuncs[locale];
if (!pfn1) {
const lcs = JSON.stringify(locale);
const pfs = JSON.stringify(this.pluralFuncs);
throw new Error(`Locale ${lcs} not found in ${pfs}!`);
}
pf[locale] = pfn1;
} else {
locale = this.defaultLocale;
pf = this.pluralFuncs;
}
const compiler = new _compiler.default(this);
const obj = compiler.compile(messages, locale, pf);
if (typeof messages != 'object') {
const fn = new Function('number, plural, select, fmt', (0, _utils.funcname)(locale), 'return ' + obj);
const rt = this.runtime;
return fn(rt.number, rt.plural, rt.select, this.fmt, pf[locale]);
}
const rtStr = this.runtime.toString(pf, compiler) + '\n';
const objStr = _stringify(obj);
const result = new Function(rtStr + 'return ' + objStr)(); // eslint-disable-next-line no-prototype-builtins
if (result.hasOwnProperty('toString')) throw new Error('The top-level message key `toString` is reserved');
result.toString = function (global) {
if (!global || global === 'export default') {
return rtStr + 'export default ' + objStr;
} else if (global.indexOf('.') > -1) {
return rtStr + global + ' = ' + objStr;
} else {
return rtStr + ['(function (root, G) {', ' if (typeof define === "function" && define.amd) { define(G); }', ' else if (typeof exports === "object") { module.exports = G; }', ' else { ' + (0, _utils.propname)(global, 'root') + ' = G; }', '})(this, ' + objStr + ');'].join('\n');
}
};
return result;
}
}
exports.default = MessageFormat;
MessageFormat.defaultLocale = 'en';
MessageFormat.formatters = _messageformatFormatters.default;
+64
View File
@@ -0,0 +1,64 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPlural = getPlural;
exports.getAllPlurals = getAllPlurals;
var _pluralCategories = _interopRequireDefault(require("make-plural/umd/pluralCategories"));
var _plurals = _interopRequireDefault(require("make-plural/umd/plurals"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @class
* @private
* @hideconstructor
* @classdesc Utility getter/wrapper for pluralization functions from
* {@link http://github.com/eemeli/make-plural.js make-plural}
*/
function wrapPluralFunc(lc, pf, pluralKeyChecks) {
var fn = function () {
return pf.apply(this, arguments);
};
fn.toString = () => pf.toString();
if (pluralKeyChecks) {
const pc = _pluralCategories.default[lc] || {};
fn.cardinal = pc.cardinal;
fn.ordinal = pc.ordinal;
} else {
fn.cardinal = [];
fn.ordinal = [];
}
return fn;
}
function getPlural(locale, {
pluralKeyChecks
}) {
for (let lc = String(locale); lc; lc = lc.replace(/[-_]?[^-_]*$/, '')) {
const pf = _plurals.default[lc];
if (pf) return wrapPluralFunc(lc, pf, pluralKeyChecks);
}
throw new Error('Localisation function not found for locale ' + JSON.stringify(locale));
}
function getAllPlurals({
pluralKeyChecks
}) {
const locales = {};
const keys = Object.keys(_plurals.default);
for (let i = 0; i < keys.length; ++i) {
const lc = keys[i];
locales[lc] = wrapPluralFunc(lc, _plurals.default[lc], pluralKeyChecks);
}
return locales;
}
+145
View File
@@ -0,0 +1,145 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _utils = require("./utils");
/** A set of utility functions that are called by the compiled Javascript
* functions, these are included locally in the output of {@link
* MessageFormat#compile compile()}.
*
* @class
* @private
* @param {MessageFormat} mf - A MessageFormat instance
*/
class Runtime {
/** Utility function for `#` in plural rules
*
* Will throw an Error if `value` has a non-numeric value and `offset` is
* non-zero or {@link MessageFormat#setStrictNumberSign} is set.
*
* @function Runtime#number
* @param {number} value - The value to operate on
* @param {string} name - The name of the argument, used for error reporting
* @param {number} [offset=0] - An optional offset, set by the surrounding context
* @returns {number|string} The result of applying the offset to the input value
*/
/** @private */
constructor(mf) {
this.plural = function (value, offset, lcfunc, data, isOrdinal) {
if ({}.hasOwnProperty.call(data, value)) return data[value];
if (offset) value -= offset;
var key = lcfunc(value, isOrdinal);
return key in data ? data[key] : data.other;
};
this.select = function (value, data) {
return {}.hasOwnProperty.call(data, value) ? data[value] : data.other;
};
this.mf = mf;
this.setStrictNumber(mf.options.strictNumberSign);
}
/** Utility function for `{N, plural|selectordinal, ...}`
*
* @param {number} value - The key to use to find a pluralization rule
* @param {number} offset - An offset to apply to `value`
* @param {function} lcfunc - A locale function from `pluralFuncs`
* @param {Object.<string,string>} data - The object from which results are looked up
* @param {?boolean} isOrdinal - If true, use ordinal rather than cardinal rules
* @returns {string} The result of the pluralization
*/
/** Set how strictly the {@link number} method parses its input.
*
* According to the ICU MessageFormat spec, `#` can only be used to replace a
* number input of a `plural` statement. By default, messageformat does not
* throw a runtime error if you use non-numeric argument with a `plural` rule,
* unless rule also includes a non-zero `offset`.
*
* This is called by {@link MessageFormat#setStrictNumberSign} to follow the
* stricter ICU MessageFormat spec.
*
* @private
* @param {boolean} [enable=false]
*/
setStrictNumber(enable) {
this.number = enable ? Runtime.strictNumber : Runtime.defaultNumber;
}
/** @private */
toString(pluralFuncs, compiler) {
function _stringify(o, level) {
if (typeof o != 'object') {
const funcStr = o.toString().replace(/^(function )\w*/, '$1');
const funcIndent = /([ \t]*)\S.*$/.exec(funcStr);
return funcIndent ? funcStr.replace(new RegExp('^' + funcIndent[1], 'mg'), '') : funcStr;
}
const s = [];
for (let i in o) {
const v = _stringify(o[i], level + 1);
s.push(level === 0 ? `var ${i} = ${v};\n` : `${(0, _utils.propname)(i)}: ${v}`);
}
if (level === 0) return s.join('');
if (s.length === 0) return '{}';
let indent = ' ';
while (--level) indent += ' ';
const oc = s.join(',\n').replace(/^/gm, indent);
return `{\n${oc}\n}`;
}
const obj = {};
const lcKeys = Object.keys(compiler.locales);
for (let i = 0; i < lcKeys.length; ++i) {
const lc = lcKeys[i];
obj[(0, _utils.funcname)(lc)] = pluralFuncs[lc];
}
const rtKeys = Object.keys(compiler.runtime);
for (let i = 0; i < rtKeys.length; ++i) {
const fn = rtKeys[i];
obj[fn] = this[fn];
}
const fmtKeys = Object.keys(compiler.formatters);
if (fmtKeys.length > 0) {
obj.fmt = {};
for (let i = 0; i < fmtKeys.length; ++i) {
const fk = fmtKeys[i];
obj.fmt[fk] = this.mf.fmt[fk];
}
}
return _stringify(obj, 0);
}
}
exports.default = Runtime;
Runtime.defaultNumber = function (value, name, offset) {
if (!offset) return value;
if (isNaN(value)) throw new Error("Can't apply offset:" + offset + ' to argument `' + name + '` with non-numerical value ' + JSON.stringify(value) + '.');
return value - offset;
};
Runtime.strictNumber = function (value, name, offset) {
if (isNaN(value)) throw new Error('Argument `' + name + '` has non-numerical value ' + JSON.stringify(value) + '.');
return value - (offset || 0);
};
+107
View File
@@ -0,0 +1,107 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.propname = propname;
exports.funcname = funcname;
exports.biDiMarkText = biDiMarkText;
const reservedES3 = {
break: true,
continue: true,
delete: true,
else: true,
for: true,
function: true,
if: true,
in: true,
new: true,
return: true,
this: true,
typeof: true,
var: true,
void: true,
while: true,
with: true,
case: true,
catch: true,
default: true,
do: true,
finally: true,
instanceof: true,
switch: true,
throw: true,
try: true
};
const reservedES5 = {
// in addition to reservedES3
debugger: true,
class: true,
enum: true,
extends: true,
super: true,
const: true,
export: true,
import: true,
null: true,
true: true,
false: true,
implements: true,
let: true,
private: true,
public: true,
yield: true,
interface: true,
package: true,
protected: true,
static: true
};
/**
* Utility function for quoting an Object's key value if required
*
* Quotes the key if it contains invalid characters or is an
* ECMAScript 3rd Edition reserved word (for IE8).
*
* @private
*/
function propname(key, obj) {
if (/^[A-Z_$][0-9A-Z_$]*$/i.test(key) && !reservedES3[key]) {
return obj ? `${obj}.${key}` : key;
} else {
const jkey = JSON.stringify(key);
return obj ? obj + `[${jkey}]` : jkey;
}
}
/**
* Utility function for escaping a function name if required
*
* @private
*/
function funcname(key) {
const fn = key.trim().replace(/\W+/g, '_');
return reservedES3[fn] || reservedES5[fn] || /^\d/.test(fn) ? '_' + fn : fn;
}
const rtlLanguages = ['ar', 'ckb', 'fa', 'he', 'ks($|[^bfh])', 'lrc', 'mzn', 'pa-Arab', 'ps', 'ug', 'ur', 'uz-Arab', 'yi'];
const rtlRegExp = new RegExp('^' + rtlLanguages.join('|^'));
/**
* Utility formatter function for enforcing Bidi Structured Text by using UCC
*
* List inlined from data extracted from CLDR v27 & v28
* To verify/recreate, use the following:
*
* git clone https://github.com/unicode-cldr/cldr-misc-full.git
* cd cldr-misc-full/main/
* grep characterOrder -r . | tr '"/' '\t' | cut -f2,6 | grep -C4 right-to-left
*
* @private
*/
function biDiMarkText(text, locale) {
const isLocaleRTL = rtlRegExp.test(locale);
const mark = JSON.stringify(isLocaleRTL ? '\u200F' : '\u200E');
return `${mark} + ${text} + ${mark}`;
}
+2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+300
View File
@@ -0,0 +1,300 @@
/**
* @classdesc Accessor for compiled MessageFormat functions
*
* ```
* import Messages from 'messageformat/messages'
* ```
*
* @class
* @param {object} locales A map of locale codes to their function objects
* @param {string|null} [defaultLocale] If not defined, default and initial locale is the first entry of `locales`
*
* @example
* var fs = require('fs');
* var MessageFormat = require('messageformat');
* var mf = new MessageFormat(['en', 'fi']);
* var msgSet = {
* en: {
* a: 'A {TYPE} example.',
* b: 'This has {COUNT, plural, one{one user} other{# users}}.',
* c: {
* d: 'We have {P, number, percent} code coverage.'
* }
* },
* fi: {
* b: 'Tällä on {COUNT, plural, one{yksi käyttäjä} other{# käyttäjää}}.',
* e: 'Minä puhun vain suomea.'
* }
* };
* var cfStr = mf.compile(msgSet).toString('module.exports');
* fs.writeFileSync('messages.js', cfStr);
*
* ...
*
* var Messages = require('messageformat/messages');
* var msgData = require('./messages');
* var messages = new Messages(msgData, 'en');
*
* messages.hasMessage('a') // true
* messages.hasObject('c') // true
* messages.get('b', { COUNT: 3 }) // 'This has 3 users.'
* messages.get(['c', 'd'], { P: 0.314 }) // 'We have 31% code coverage.'
*
* messages.get('e') // 'e'
* messages.setFallback('en', ['foo', 'fi'])
* messages.get('e') // 'Minä puhun vain suomea.'
*
* messages.locale = 'fi'
* messages.hasMessage('a') // false
* messages.hasMessage('a', 'en') // true
* messages.hasMessage('a', null, true) // true
* messages.hasObject('c') // false
* messages.get('b', { COUNT: 3 }) // 'Tällä on 3 käyttäjää.'
* messages.get('c').d({ P: 0.628 }) // 'We have 63% code coverage.'
*/
function Messages(locales, defaultLocale) {
this._data = {};
this._fallback = {};
Object.keys(locales).forEach(function(lc) {
if (lc !== 'toString') {
this._data[lc] = locales[lc];
if (typeof defaultLocale === 'undefined') defaultLocale = lc;
}
}, this);
/**
* List of available locales
* @readonly
* @memberof Messages
* @member {string[]} availableLocales
*/
Object.defineProperty(this, 'availableLocales', {
get: function() {
return Object.keys(this._data);
}
});
/**
* Current locale
*
* One of Messages#availableLocales or `null`. Partial matches of language tags
* are supported, so e.g. with an `en` locale defined, it will be selected by
* `messages.locale = 'en-US'` and vice versa.
*
* @memberof Messages
* @member {string|null} locale
*/
Object.defineProperty(this, 'locale', {
get: function() {
return this._locale;
},
set: function(lc) {
this._locale = this.resolveLocale(lc);
}
});
this.locale = defaultLocale;
/**
* Default fallback locale
*
* One of Messages#availableLocales or `null`. Partial matches of language tags
* are supported, so e.g. with an `en` locale defined, it will be selected by
* `messages.defaultLocale = 'en-US'` and vice versa.
*
* @memberof Messages
* @member {string|null} defaultLocale
*/
Object.defineProperty(this, 'defaultLocale', {
get: function() {
return this._defaultLocale;
},
set: function(lc) {
this._defaultLocale = this.resolveLocale(lc);
}
});
this._defaultLocale = this._locale;
}
module.exports = Messages;
/**
* Add new messages to the accessor; useful if loading data dynamically
*
* The locale code `lc` should be an exact match for the locale being updated,
* or empty to default to the current locale. Use {@link #resolveLocale} for
* resolving partial locale strings.
*
* If `keypath` is empty, adds or sets the complete message object for the
* corresponding locale. If any keys in `keypath` do not exist, a new object
* will be created at that key.
*
* @param {function|object} data Hierarchical map of keys to functions, or a
* single message function
* @param {string} [lc] If empty or undefined, defaults to `this.locale`
* @param {string[]} [keypath] The keypath being added
* @returns {Messages} The Messages instance, to allow for chaining
*/
Messages.prototype.addMessages = function(data, lc, keypath) {
if (!lc) lc = this.locale;
if (typeof data !== 'function') {
data = Object.keys(data).reduce(function(map, key) {
if (key !== 'toString') map[key] = data[key];
return map;
}, {});
}
if (Array.isArray(keypath) && keypath.length > 0) {
var parent = this._data[lc];
for (var i = 0; i < keypath.length - 1; ++i) {
var key = keypath[i];
if (!parent[key]) parent[key] = {};
parent = parent[key];
}
parent[keypath[keypath.length - 1]] = data;
} else {
this._data[lc] = data;
}
return this;
};
/**
* Resolve `lc` to the key of an available locale or `null`, allowing for
* partial matches. For example, with an `en` locale defined, it will be
* selected by `messages.defaultLocale = 'en-US'` and vice versa.
*
* @param {string} lc Locale code
* @returns {string|null}
*/
Messages.prototype.resolveLocale = function(lc) {
if (this._data[lc]) return lc;
if (lc) {
var l = String(lc);
while ((l = l.replace(/[-_]?[^-_]*$/, ''))) {
if (this._data[l]) return l;
}
var ll = this.availableLocales;
var re = new RegExp('^' + lc + '[-_]');
for (var i = 0; i < ll.length; ++i) {
if (re.test(ll[i])) return ll[i];
}
}
return null;
};
/**
* Get the list of fallback locales
* @param {string} [lc] If empty or undefined, defaults to `this.locale`
* @returns {string[]}
*/
Messages.prototype.getFallback = function(lc) {
if (!lc) lc = this.locale;
return (
this._fallback[lc] ||
(lc === this.defaultLocale || !this.defaultLocale
? []
: [this.defaultLocale])
);
};
/**
* Set the fallback locale or locales for `lc`
*
* To disable fallback for the locale, use `setFallback(lc, [])`.
* To use the default fallback, use `setFallback(lc, null)`.
*
* @param {string} lc
* @param {string[]|null} fallback
* @returns {Messages} The Messages instance, to allow for chaining
*/
Messages.prototype.setFallback = function(lc, fallback) {
this._fallback[lc] = Array.isArray(fallback) ? fallback : null;
return this;
};
/**
* Check if `key` is a message function for the locale
*
* `key` may be a `string` for functions at the root level, or `string[]` for
* accessing hierarchical objects. If an exact match is not found and `fallback`
* is true, the fallback locales are checked for the first match.
*
* @param {string|string[]} key The key or keypath being sought
* @param {string} [lc] If empty or undefined, defaults to `this.locale`
* @param {boolean} [fallback=false] If true, also checks fallback locales
* @returns {boolean}
*/
Messages.prototype.hasMessage = function(key, lc, fallback) {
if (!lc) lc = this.locale;
var fb = fallback ? this.getFallback(lc) : null;
return _has(this._data, lc, key, fb, 'function');
};
/**
* Check if `key` is a message object for the locale
*
* `key` may be a `string` for functions at the root level, or `string[]` for
* accessing hierarchical objects. If an exact match is not found and `fallback`
* is true, the fallback locales are checked for the first match.
*
* @param {string|string[]} key The key or keypath being sought
* @param {string} [lc] If empty or undefined, defaults to `this.locale`
* @param {boolean} [fallback=false] If true, also checks fallback locales
* @returns {boolean}
*/
Messages.prototype.hasObject = function(key, lc, fallback) {
if (!lc) lc = this.locale;
var fb = fallback ? this.getFallback(lc) : null;
return _has(this._data, lc, key, fb, 'object');
};
/**
* Get the message or object corresponding to `key`
*
* `key` may be a `string` for functions at the root level, or `string[]` for
* accessing hierarchical objects. If an exact match is not found, the fallback
* locales are checked for the first match.
*
* If `key` maps to a message function, it will be called with `props`. If it
* maps to an object, the object is returned directly.
*
* @param {string|string[]} key The key or keypath being sought
* @param {object} [props] Optional properties passed to the function
* @param {string} [lc] If empty or undefined, defaults to `this.locale`
* @returns {string|Object<string,function|object>}
*/
Messages.prototype.get = function(key, props, lc) {
if (!lc) lc = this.locale;
var msg = _get(this._data[lc], key);
if (msg) return typeof msg == 'function' ? msg(props) : msg;
var fb = this.getFallback(lc);
for (var i = 0; i < fb.length; ++i) {
msg = _get(this._data[fb[i]], key);
if (msg) return typeof msg == 'function' ? msg(props) : msg;
}
return key;
};
/** @private */
function _get(obj, key) {
if (!obj) return null;
if (Array.isArray(key)) {
for (var i = 0; i < key.length; ++i) {
obj = obj[key[i]];
if (!obj) return null;
}
return obj;
}
return obj[key];
}
/** @private */
function _has(data, lc, key, fallback, type) {
var msg = _get(data[lc], key);
if (msg) return typeof msg === type;
if (fallback) {
for (var i = 0; i < fallback.length; ++i) {
msg = _get(data[fallback[i]], key);
if (msg) return typeof msg === type;
}
}
return false;
}
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../make-plural/bin/make-plural" "$@"
else
exec node "$basedir/../make-plural/bin/make-plural" "$@"
fi
+17
View File
@@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\make-plural\bin\make-plural" %*
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../make-plural/bin/make-plural" $args
} else {
& "$basedir/node$exe" "$basedir/../make-plural/bin/make-plural" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../make-plural/bin/make-plural" $args
} else {
& "node$exe" "$basedir/../make-plural/bin/make-plural" $args
}
$ret=$LASTEXITCODE
}
exit $ret
+14
View File
@@ -0,0 +1,14 @@
Copyright (c) 2014-2016 by Eemeli Aro <eemeli@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+302
View File
@@ -0,0 +1,302 @@
[![ISC License](https://img.shields.io/npm/l/make-plural.svg)](http://en.wikipedia.org/wiki/ISC_license)
[![Build Status](https://travis-ci.org/eemeli/make-plural.svg?branch=master)](https://travis-ci.org/eemeli/make-plural)
make-plural
===========
Make-plural is a JavaScript module that translates [Unicode CLDR] pluralization
[rules] to JavaScript functions. It includes both a live parser as well as the
generated output for the latest edition of the CLDR; the latter is just over 2kB
in size when minified & gzipped and covers 199 languages, so it's probably what
you want unless you really know what you're doing.
Make-plural is written in [ECMAScript 6] and transpiled using [Babel] and
[Browserify] to CommonJS and AMD and ES6 module formats, as well as being
suitable for use in browser environments.
[Unicode CLDR]: http://cldr.unicode.org/
[rules]: http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html
[ECMAScript 6]: https://people.mozilla.org/~jorendorff/es6-draft.html
[Babel]: https://babeljs.io/
[Browserify]: http://browserify.org/
## Installation
```
npm install make-plural
```
_or_
```
bower install make-plural
```
_or_
```
git clone https://github.com/eemeli/make-plural.git
cd make-plural
npm install
make all
```
_or_ download the latest release from
[here](https://github.com/eemeli/make-plural/releases/latest)
## Precompiled plurals
`umd/plurals.js` contains an UMD module that can be included with node's
`require` or AMD's `define`. In a browser environment, it will populate a global
object `plurals`. Said module contains 199 functions (one per [language][rules]),
each taking as a first parameter the value to be classified (either a number or
a string), and as an optional second parameter, a boolean that if true, applies
ordinal rather than cardinal rules.
`umd/pluralCategories.js` has a similar structure to `umd/plurals.js`, but
contains an array of the pluralization categories the cardinal and ordinal rules
each language's pluralization function may output.
`es6/plurals.js` and `es6/pluralCategories.js` are the ES6 module equivalents of
the above.
If your language isn't directly included in either of the above, try removing
any trailing parts that are separated from the stem by `-` or `_`. Note also
that the [capitalization of locale codes] is lowercase for the language, but
uppercase for the country, so for example the code for Portugese as spoken in
Portugal is `pt-PT`.
[capitalization of locale codes]: https://tools.ietf.org/html/bcp47#section-2.1.1
### Precompiled use: Node
```js
var plurals = require('make-plural')
// { af: [Function],
// ak: [Function],
// am: [Function],
// snip 193 lines...
// yo: [Function],
// zh: [Function],
// zu: [Function] }
plurals.en(1) // 1st param is the value
// 'one'
plurals.en(2)
// 'other'
plurals.en(2, true) // 2nd param, if true-ish, is for ordinal rules
// 'two'
console.log(plurals.en.toString())
// function (n, ord) {
// var s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n,
// n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);
// if (ord) return (n10 == 1 && n100 != 11) ? 'one'
// : (n10 == 2 && n100 != 12) ? 'two'
// : (n10 == 3 && n100 != 13) ? 'few'
// : 'other';
// return (n == 1 && v0) ? 'one' : 'other';
// }
var pluralCategories = require('make-plural/umd/pluralCategories')
// { af: { cardinal: [ 'one', 'other' ], ordinal: [ 'other' ] },
// ak: { cardinal: [ 'one', 'other' ], ordinal: [ 'other' ] },
// am: { cardinal: [ 'one', 'other' ], ordinal: [ 'other' ] },
// ar:
// { cardinal: [ 'zero', 'one', 'two', 'few', 'many', 'other' ],
// ordinal: [ 'other' ] },
// snip 255 lines...
// zh: { cardinal: [ 'other' ], ordinal: [ 'other' ] },
// zu: { cardinal: [ 'one', 'other' ], ordinal: [ 'other' ] } }
```
### Precompiled use: Web
```html
<script src="path/to/make-plural/umd/plurals.js"></script>
<script>
var ru = plurals.ru
console.log('1: ' + plurals.ru(1) + ', 3.0: ' + plurals.ru(3.0) +
', "1.0": ' + plurals.ru('1.0') + ', "0": ' + plurals.ru('0'));
console.log(plurals.ru.toString());
</script>
```
With outputs:
```
1: one, 3.0: few, "1.0": other, "0": many
function(n, ord) {
var s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1),
i100 = i.slice(-2);
if (ord) return 'other';
return (v0 && i10 == 1 && i100 != 11) ? 'one'
: (v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12
|| i100 > 14)) ? 'few'
: (v0 && i10 == 0 || v0 && (i10 >= 5 && i10 <= 9)
|| v0 && (i100 >= 11 && i100 <= 14)) ? 'many'
: 'other';
}
```
Note that with `umd/plurals.min.js`, the stringified function would be rendered
as:
```js
function (e,t){var r=String(e).split("."),n=r[0],o=!r[1],c=n.slice(-1),
i=n.slice(-2);return t?"other":o&&1==c&&11!=i?"one":o&&c>=2&&4>=c&&(12>i||i>14)?
"few":o&&0==c||o&&c>=5&&9>=c||o&&i>=11&&14>=i?"many":"other"}
```
## Live compiler: `make-plural.js`
### MakePlural.load(cldr, ...)
Loads CLDR rules from one or more `cldr` variables, each of which must be an
object formatted like [this][json].
No plural data is included by default, so you'll need to call this at least
once, or otherwise fill the `MakePlural.rules` object.
The default CLDR rules are included in make-plural, and may be loaded as seen
in the examples below.
[json]: https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/plurals.json
### new MakePlural(lc, { cardinals, ordinals })
Returns a function that takes an argument `n` and returns its plural category
for the given locale `lc`. If no direct match for `lc` is found, it is compared
case-insensitively to known locales.
The returned function has an overloaded `toString(name)` method that may be
used to generate a clean string representation of the function, with an
optional name `name`.
The optional second parameter may contain the following boolean members:
* `cardinals` — if true, rules for cardinal values (1 day, 2 days, etc.) are
included
* `ordinals` — if true, rules for ordinal values (1st, 2nd, etc.) are included
If both `cardinals` and `ordinals` are true, the returned function takes a
second parameter `ord`. Then, if `ord` is true, the function will return the
ordinal rather than cardinal category applicable to `n` in locale `lc`.
If the second parameter is undefined, the values are taken from
`MakePlural.cardinals` (default `true`) and `MakePlural.ordinals` (default
`false`).
### Live use: Node
```js
var MakePlural = require('make-plural/make-plural').load(
require('make-plural/data/plurals.json'),
require('make-plural/data/ordinals.json'))
// { [Function: MakePlural]
// cardinals: true,
// ordinals: false,
// rules:
// { cardinal:
// { af: [Object],
// ak: [Object],
// am: [Object],
// snip 193 lines...
// yo: [Object],
// zh: [Object],
// zu: [Object] },
// ordinal:
// { af: [Object],
// am: [Object],
// ar: [Object],
// snip 78 lines...
// vi: [Object],
// zh: [Object],
// zu: [Object] } } }
var sk = new MakePlural('sk') // Note: not including ordinals by default
// { [Function]
// _obj:
// { lc: 'sk',
// cardinals: true,
// ordinals: false,
// categories: { cardinal: [Object], ordinal: [] },
// parser: { v0: 1, i: 1 },
// tests: { obj: [Circular], ordinal: {}, cardinal: [Object] },
// fn: [Circular] },
// categories: { cardinal: [ 'one', 'few', 'many', 'other' ], ordinal: [] },
// test: [Function],
// toString: [Function] }
sk(1)
// 'one'
sk(3.0)
// 'few'
sk('1.0')
// 'many'
sk('0')
// 'other'
console.log(sk.toString())
// function(n) {
// var s = String(n).split('.'), i = s[0], v0 = !s[1];
// return (i == 1 && v0 ) ? 'one'
// : ((i >= 2 && i <= 4) && v0 ) ? 'few'
// : (!v0 ) ? 'many'
// : 'other';
// }
```
`make-plural` may also be used in browser environments; see `test/index.html`
for an example of its use.
## CLI Usage
```sh
$ ./bin/make-plural > plurals.js
$ ./bin/make-plural fr
function fr(n, ord) {
if (ord) return (n == 1) ? 'one' : 'other';
return (n >= 0 && n < 2) ? 'one' : 'other';
}
$ ./bin/make-plural --locale fr --value 1.5
one
$ ./bin/make-plural 1.5 -l fr --ordinal
other
```
Please see the source of `src/index.js` for more details.
## Dependencies
Make-plural has no required runtime dependencies. CLDR plural rule data is
included in JSON format; make-plural supports the [LDML Language Plural Rules]
as used in CLDR release 24 and later.
The CLI binary `bin/make-plural` does use [minimist] as an argument parser, but
that is not required for any other use.
Using `MakePlural.load()`, you may make use of external sources of CLDR data.
For example, the following works when using together with [cldr-data]:
```js
var cldr = require('cldr-data');
var MakePlural = require('make-plural/make-plural').load(
cldr('supplemental/plurals'),
cldr('supplemental/ordinals')
);
var en = new MakePlural('en');
en(3, true);
// 'few'
```
[LDML Language Plural Rules]: http://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules
[minimist]: https://www.npmjs.com/package/minimist
[cldr-data]: https://www.npmjs.org/package/cldr-data
+17
View File
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cardinals = exports.combined = void 0;
var combined = {
plurals: ["function(n, ord) {\n if (ord) return 'other';\n return 'other';\n}", "function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one' : 'other';\n}", "function(n, ord) {\n if (ord) return 'other';\n return ((n == 0\n || n == 1)) ? 'one' : 'other';\n}", "function(n, ord) {\n var s = String(n).split('.'), v0 = !s[1];\n if (ord) return 'other';\n return (n == 1 && v0) ? 'one' : 'other';\n}"],
categories: ['{cardinal:["other"],ordinal:["other"]}', '{cardinal:["one","other"],ordinal:["other"]}', '{cardinal:["one","other"],ordinal:["one","other"]}', '{cardinal:["one","two","other"],ordinal:["other"]}']
};
exports.combined = combined;
var cardinals = {
plurals: ["function(n) {\n return 'other';\n}", "function(n) {\n return (n == 1) ? 'one' : 'other';\n}", "function(n) {\n return ((n == 0\n || n == 1)) ? 'one' : 'other';\n}", "function(n) {\n var s = String(n).split('.'), v0 = !s[1];\n return (n == 1 && v0) ? 'one' : 'other';\n}"],
categories: ['{cardinal:["other"],ordinal:[]}', '{cardinal:["one","other"],ordinal:[]}', '{cardinal:["one","other"],ordinal:[]}', '{cardinal:["one","two","other"],ordinal:[]}']
};
exports.cardinals = cardinals;
+130
View File
@@ -0,0 +1,130 @@
#!/usr/bin/env node
"use strict";
var common = _interopRequireWildcard(require("./common"));
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
/** A compiler for make-plural.js
*
* Usage:
* ./bin/make-plural // checks all locale rules
* ./bin/make-plural [lc] // prints the locale function for LC
* ./bin/make-plural [lc] [n] [ord] // prints the (ORD ? ordinal : plural) category for N in locale LC
*/
var argv = require('minimist')(process.argv.slice(2), {
default: {
locale: null,
value: null,
ordinal: null,
cardinal: null,
categories: false,
es6: false
},
alias: {
locale: 'l',
value: 'v',
ordinal: 'o',
cardinal: 'c',
es6: 'e'
},
string: ['locale', 'value'],
boolean: ['categories', 'es6']
});
var MakePlural = require('../make-plural').load(require('../data/plurals.json'), require('../data/ordinals.json'));
var es6module = function es6module(value) {
return "\nexport default {\n".concat(value, "\n}");
}; // UMD pattern adapted from https://github.com/umdjs/umd/blob/master/returnExports.js
var umd = function umd(global, value) {
return "\n(function (root, ".concat(global, ") {\n if (typeof define === 'function' && define.amd) {\n define(").concat(global, ");\n } else if (typeof exports === 'object') {\n module.exports = ").concat(global, ";\n } else {\n root.").concat(global, " = ").concat(global, ";\n }\n}(this, {\n").concat(value, "\n}));");
};
function mapForEachLanguage(cb, opt) {
var style = opt && !opt.cardinals ? 'ordinal' : 'cardinal';
var languages = [];
for (var lc in MakePlural.rules[style]) {
var key = /^[A-Z_$][0-9A-Z_$]*$/i.test(lc) && lc !== 'in' ? lc : JSON.stringify(lc);
var mp = new MakePlural(lc, opt).test();
languages.push(key + ': ' + cb(mp));
}
return languages;
}
function printPluralsModule(es6) {
var cp = common[MakePlural.ordinals ? 'combined' : 'cardinals'].plurals;
var plurals = mapForEachLanguage(function (mp) {
var fn = mp.toString();
cp.forEach(function (p, i) {
if (fn === p) fn = "_cp[".concat(i, "]");
});
return fn;
});
if (es6) {
console.log('const _cp = [\n' + cp.join(',\n') + '\n];');
console.log(es6module(plurals.join(',\n\n')));
} else {
console.log('var _cp = [\n' + cp.join(',\n') + '\n];');
console.log(umd('plurals', plurals.join(',\n\n')));
}
}
function printCategoriesModule(es6) {
var cc = common[MakePlural.ordinals ? 'combined' : 'cardinals'].categories;
var categories = mapForEachLanguage(function (mp) {
var cat = JSON.stringify(mp.categories).replace(/"(\w+)":/g, '$1:');
cc.forEach(function (c, i) {
if (cat === c) cat = "_cc[".concat(i, "]");
});
return cat;
});
if (es6) {
console.log('const _cc = [\n ' + cc.join(',\n ') + '\n];');
console.log(es6module(categories.join(',\n')));
} else {
console.log('var _cc = [\n ' + cc.join(',\n ') + '\n];');
console.log(umd('pluralCategories', categories.join(',\n')));
}
}
function truthy(v) {
if (v === '0' || v === 'false') return false;
return !!v;
}
argv._.forEach(function (a) {
if (argv.locale === null) argv.locale = a;else if (argv.value === null) argv.value = a;else if (argv.ordinal === null) argv.ordinal = a;
});
MakePlural.cardinals = argv.cardinal !== null ? truthy(argv.cardinal) : true;
MakePlural.ordinals = argv.ordinal !== null ? truthy(argv.ordinal) : true;
if (argv.locale) {
var mp = new MakePlural(argv.locale).test();
if (argv.categories) {
var cats = mp.categories.cardinal.concat(mp.categories.ordinal).filter(function (v, i, self) {
return self.indexOf(v) === i;
});
console.log(cats.join(', '));
} else if (argv.value !== null) {
console.log(mp(argv.value, truthy(argv.ordinal)));
} else {
console.log(mp.toString(argv.locale));
}
} else {
if (argv.categories) {
printCategoriesModule(argv.es6);
} else {
printPluralsModule(argv.es6);
}
}
+366
View File
@@ -0,0 +1,366 @@
{
"supplemental": {
"version": {
"_number": "$Revision: 14397 $",
"_unicodeVersion": "11.0.0",
"_cldrVersion": "34"
},
"plurals-type-ordinal": {
"af": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"am": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ar": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"as": {
"pluralRule-count-one": "n = 1,5,7,8,9,10 @integer 1, 5, 7~10",
"pluralRule-count-two": "n = 2,3 @integer 2, 3",
"pluralRule-count-few": "n = 4 @integer 4",
"pluralRule-count-many": "n = 6 @integer 6",
"pluralRule-count-other": " @integer 0, 11~25, 100, 1000, 10000, 100000, 1000000, …"
},
"az": {
"pluralRule-count-one": "i % 10 = 1,2,5,7,8 or i % 100 = 20,50,70,80 @integer 1, 2, 5, 7, 8, 11, 12, 15, 17, 18, 20~22, 25, 101, 1001, …",
"pluralRule-count-few": "i % 10 = 3,4 or i % 1000 = 100,200,300,400,500,600,700,800,900 @integer 3, 4, 13, 14, 23, 24, 33, 34, 43, 44, 53, 54, 63, 64, 73, 74, 100, 1003, …",
"pluralRule-count-many": "i = 0 or i % 10 = 6 or i % 100 = 40,60,90 @integer 0, 6, 16, 26, 36, 40, 46, 56, 106, 1006, …",
"pluralRule-count-other": " @integer 9, 10, 19, 29, 30, 39, 49, 59, 69, 79, 109, 1000, 10000, 100000, 1000000, …"
},
"be": {
"pluralRule-count-few": "n % 10 = 2,3 and n % 100 != 12,13 @integer 2, 3, 22, 23, 32, 33, 42, 43, 52, 53, 62, 63, 72, 73, 82, 83, 102, 1002, …",
"pluralRule-count-other": " @integer 0, 1, 4~17, 100, 1000, 10000, 100000, 1000000, …"
},
"bg": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"bn": {
"pluralRule-count-one": "n = 1,5,7,8,9,10 @integer 1, 5, 7~10",
"pluralRule-count-two": "n = 2,3 @integer 2, 3",
"pluralRule-count-few": "n = 4 @integer 4",
"pluralRule-count-many": "n = 6 @integer 6",
"pluralRule-count-other": " @integer 0, 11~25, 100, 1000, 10000, 100000, 1000000, …"
},
"bs": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ca": {
"pluralRule-count-one": "n = 1,3 @integer 1, 3",
"pluralRule-count-two": "n = 2 @integer 2",
"pluralRule-count-few": "n = 4 @integer 4",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …"
},
"ce": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"cs": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"cy": {
"pluralRule-count-zero": "n = 0,7,8,9 @integer 0, 7~9",
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-two": "n = 2 @integer 2",
"pluralRule-count-few": "n = 3,4 @integer 3, 4",
"pluralRule-count-many": "n = 5,6 @integer 5, 6",
"pluralRule-count-other": " @integer 10~25, 100, 1000, 10000, 100000, 1000000, …"
},
"da": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"de": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"dsb": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"el": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"en": {
"pluralRule-count-one": "n % 10 = 1 and n % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …",
"pluralRule-count-two": "n % 10 = 2 and n % 100 != 12 @integer 2, 22, 32, 42, 52, 62, 72, 82, 102, 1002, …",
"pluralRule-count-few": "n % 10 = 3 and n % 100 != 13 @integer 3, 23, 33, 43, 53, 63, 73, 83, 103, 1003, …",
"pluralRule-count-other": " @integer 0, 4~18, 100, 1000, 10000, 100000, 1000000, …"
},
"es": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"et": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"eu": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"fa": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"fi": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"fil": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"fr": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"fy": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ga": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"gd": {
"pluralRule-count-one": "n = 1,11 @integer 1, 11",
"pluralRule-count-two": "n = 2,12 @integer 2, 12",
"pluralRule-count-few": "n = 3,13 @integer 3, 13",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …"
},
"gl": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"gsw": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"gu": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-two": "n = 2,3 @integer 2, 3",
"pluralRule-count-few": "n = 4 @integer 4",
"pluralRule-count-many": "n = 6 @integer 6",
"pluralRule-count-other": " @integer 0, 5, 7~20, 100, 1000, 10000, 100000, 1000000, …"
},
"he": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"hi": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-two": "n = 2,3 @integer 2, 3",
"pluralRule-count-few": "n = 4 @integer 4",
"pluralRule-count-many": "n = 6 @integer 6",
"pluralRule-count-other": " @integer 0, 5, 7~20, 100, 1000, 10000, 100000, 1000000, …"
},
"hr": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"hsb": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"hu": {
"pluralRule-count-one": "n = 1,5 @integer 1, 5",
"pluralRule-count-other": " @integer 0, 2~4, 6~17, 100, 1000, 10000, 100000, 1000000, …"
},
"hy": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"ia": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"id": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"in": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"is": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"it": {
"pluralRule-count-many": "n = 11,8,80,800 @integer 8, 11, 80, 800",
"pluralRule-count-other": " @integer 0~7, 9, 10, 12~17, 100, 1000, 10000, 100000, 1000000, …"
},
"iw": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ja": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ka": {
"pluralRule-count-one": "i = 1 @integer 1",
"pluralRule-count-many": "i = 0 or i % 100 = 2..20,40,60,80 @integer 0, 2~16, 102, 1002, …",
"pluralRule-count-other": " @integer 21~36, 100, 1000, 10000, 100000, 1000000, …"
},
"kk": {
"pluralRule-count-many": "n % 10 = 6 or n % 10 = 9 or n % 10 = 0 and n != 0 @integer 6, 9, 10, 16, 19, 20, 26, 29, 30, 36, 39, 40, 100, 1000, 10000, 100000, 1000000, …",
"pluralRule-count-other": " @integer 0~5, 7, 8, 11~15, 17, 18, 21, 101, 1001, …"
},
"km": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"kn": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ko": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ky": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"lo": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"lt": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"lv": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"mk": {
"pluralRule-count-one": "i % 10 = 1 and i % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …",
"pluralRule-count-two": "i % 10 = 2 and i % 100 != 12 @integer 2, 22, 32, 42, 52, 62, 72, 82, 102, 1002, …",
"pluralRule-count-many": "i % 10 = 7,8 and i % 100 != 17,18 @integer 7, 8, 27, 28, 37, 38, 47, 48, 57, 58, 67, 68, 77, 78, 87, 88, 107, 1007, …",
"pluralRule-count-other": " @integer 0, 3~6, 9~19, 100, 1000, 10000, 100000, 1000000, …"
},
"ml": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"mn": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"mo": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"mr": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-two": "n = 2,3 @integer 2, 3",
"pluralRule-count-few": "n = 4 @integer 4",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …"
},
"ms": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"my": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"nb": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ne": {
"pluralRule-count-one": "n = 1..4 @integer 1~4",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …"
},
"nl": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"or": {
"pluralRule-count-one": "n = 1,5,7..9 @integer 1, 5, 7~9",
"pluralRule-count-two": "n = 2,3 @integer 2, 3",
"pluralRule-count-few": "n = 4 @integer 4",
"pluralRule-count-many": "n = 6 @integer 6",
"pluralRule-count-other": " @integer 0, 10~24, 100, 1000, 10000, 100000, 1000000, …"
},
"pa": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"pl": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"prg": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ps": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"pt": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ro": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"root": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ru": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"sc": {
"pluralRule-count-many": "n = 11,8,80,800 @integer 8, 11, 80, 800",
"pluralRule-count-other": " @integer 0~7, 9, 10, 12~17, 100, 1000, 10000, 100000, 1000000, …"
},
"scn": {
"pluralRule-count-many": "n = 11,8,80,800 @integer 8, 11, 80, 800",
"pluralRule-count-other": " @integer 0~7, 9, 10, 12~17, 100, 1000, 10000, 100000, 1000000, …"
},
"sd": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"sh": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"si": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"sk": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"sl": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"sq": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-many": "n % 10 = 4 and n % 100 != 14 @integer 4, 24, 34, 44, 54, 64, 74, 84, 104, 1004, …",
"pluralRule-count-other": " @integer 0, 2, 3, 5~17, 100, 1000, 10000, 100000, 1000000, …"
},
"sr": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"sv": {
"pluralRule-count-one": "n % 10 = 1,2 and n % 100 != 11,12 @integer 1, 2, 21, 22, 31, 32, 41, 42, 51, 52, 61, 62, 71, 72, 81, 82, 101, 1001, …",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, …"
},
"sw": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"ta": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"te": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"th": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"tk": {
"pluralRule-count-few": "n % 10 = 6,9 or n = 10 @integer 6, 9, 10, 16, 19, 26, 29, 36, 39, 106, 1006, …",
"pluralRule-count-other": " @integer 0~5, 7, 8, 11~15, 17, 18, 20, 100, 1000, 10000, 100000, 1000000, …"
},
"tl": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"tr": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"uk": {
"pluralRule-count-few": "n % 10 = 3 and n % 100 != 13 @integer 3, 23, 33, 43, 53, 63, 73, 83, 103, 1003, …",
"pluralRule-count-other": " @integer 0~2, 4~16, 100, 1000, 10000, 100000, 1000000, …"
},
"ur": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"uz": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"vi": {
"pluralRule-count-one": "n = 1 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …"
},
"yue": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"zh": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
},
"zu": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …"
}
}
}
}
+877
View File
@@ -0,0 +1,877 @@
{
"supplemental": {
"version": {
"_number": "$Revision: 14397 $",
"_unicodeVersion": "11.0.0",
"_cldrVersion": "34"
},
"plurals-type-cardinal": {
"af": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ak": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"am": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ar": {
"pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000",
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-few": "n % 100 = 3..10 @integer 3~10, 103~110, 1003, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …",
"pluralRule-count-many": "n % 100 = 11..99 @integer 11~26, 111, 1011, … @decimal 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …",
"pluralRule-count-other": " @integer 100~102, 200~202, 300~302, 400~402, 500~502, 600, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ars": {
"pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000",
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-few": "n % 100 = 3..10 @integer 3~10, 103~110, 1003, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …",
"pluralRule-count-many": "n % 100 = 11..99 @integer 11~26, 111, 1011, … @decimal 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …",
"pluralRule-count-other": " @integer 100~102, 200~202, 300~302, 400~402, 500~502, 600, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"as": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"asa": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ast": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"az": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"be": {
"pluralRule-count-one": "n % 10 = 1 and n % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 71.0, 81.0, 101.0, 1001.0, …",
"pluralRule-count-few": "n % 10 = 2..4 and n % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 2.0, 3.0, 4.0, 22.0, 23.0, 24.0, 32.0, 33.0, 102.0, 1002.0, …",
"pluralRule-count-many": "n % 10 = 0 or n % 10 = 5..9 or n % 100 = 11..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.1, 1000.1, …"
},
"bem": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"bez": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"bg": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"bh": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"bm": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"bn": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"bo": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"br": {
"pluralRule-count-one": "n % 10 = 1 and n % 100 != 11,71,91 @integer 1, 21, 31, 41, 51, 61, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 81.0, 101.0, 1001.0, …",
"pluralRule-count-two": "n % 10 = 2 and n % 100 != 12,72,92 @integer 2, 22, 32, 42, 52, 62, 82, 102, 1002, … @decimal 2.0, 22.0, 32.0, 42.0, 52.0, 62.0, 82.0, 102.0, 1002.0, …",
"pluralRule-count-few": "n % 10 = 3..4,9 and n % 100 != 10..19,70..79,90..99 @integer 3, 4, 9, 23, 24, 29, 33, 34, 39, 43, 44, 49, 103, 1003, … @decimal 3.0, 4.0, 9.0, 23.0, 24.0, 29.0, 33.0, 34.0, 103.0, 1003.0, …",
"pluralRule-count-many": "n != 0 and n % 1000000 = 0 @integer 1000000, … @decimal 1000000.0, 1000000.00, 1000000.000, …",
"pluralRule-count-other": " @integer 0, 5~8, 10~20, 100, 1000, 10000, 100000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, …"
},
"brx": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"bs": {
"pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ca": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ce": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"cgg": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"chr": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ckb": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"cs": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-few": "i = 2..4 and v = 0 @integer 2~4",
"pluralRule-count-many": "v != 0 @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …"
},
"cy": {
"pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000",
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-few": "n = 3 @integer 3 @decimal 3.0, 3.00, 3.000, 3.0000",
"pluralRule-count-many": "n = 6 @integer 6 @decimal 6.0, 6.00, 6.000, 6.0000",
"pluralRule-count-other": " @integer 4, 5, 7~20, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"da": {
"pluralRule-count-one": "n = 1 or t != 0 and i = 0,1 @integer 1 @decimal 0.1~1.6",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 2.0~3.4, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"de": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"dsb": {
"pluralRule-count-one": "v = 0 and i % 100 = 1 or f % 100 = 1 @integer 1, 101, 201, 301, 401, 501, 601, 701, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-two": "v = 0 and i % 100 = 2 or f % 100 = 2 @integer 2, 102, 202, 302, 402, 502, 602, 702, 1002, … @decimal 0.2, 1.2, 2.2, 3.2, 4.2, 5.2, 6.2, 7.2, 10.2, 100.2, 1000.2, …",
"pluralRule-count-few": "v = 0 and i % 100 = 3..4 or f % 100 = 3..4 @integer 3, 4, 103, 104, 203, 204, 303, 304, 403, 404, 503, 504, 603, 604, 703, 704, 1003, … @decimal 0.3, 0.4, 1.3, 1.4, 2.3, 2.4, 3.3, 3.4, 4.3, 4.4, 5.3, 5.4, 6.3, 6.4, 7.3, 7.4, 10.3, 100.3, 1000.3, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"dv": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"dz": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ee": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"el": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"en": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"eo": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"es": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"et": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"eu": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"fa": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ff": {
"pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"fi": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"fil": {
"pluralRule-count-one": "v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9 @integer 0~3, 5, 7, 8, 10~13, 15, 17, 18, 20, 21, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1.3, 1.5, 1.7, 1.8, 2.0, 2.1, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0.6, 0.9, 1.4, 1.6, 1.9, 2.4, 2.6, 10.4, 100.4, 1000.4, …"
},
"fo": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"fr": {
"pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"fur": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"fy": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ga": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-few": "n = 3..6 @integer 3~6 @decimal 3.0, 4.0, 5.0, 6.0, 3.00, 4.00, 5.00, 6.00, 3.000, 4.000, 5.000, 6.000, 3.0000, 4.0000, 5.0000, 6.0000",
"pluralRule-count-many": "n = 7..10 @integer 7~10 @decimal 7.0, 8.0, 9.0, 10.0, 7.00, 8.00, 9.00, 10.00, 7.000, 8.000, 9.000, 10.000, 7.0000, 8.0000, 9.0000, 10.0000",
"pluralRule-count-other": " @integer 0, 11~25, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"gd": {
"pluralRule-count-one": "n = 1,11 @integer 1, 11 @decimal 1.0, 11.0, 1.00, 11.00, 1.000, 11.000, 1.0000",
"pluralRule-count-two": "n = 2,12 @integer 2, 12 @decimal 2.0, 12.0, 2.00, 12.00, 2.000, 12.000, 2.0000",
"pluralRule-count-few": "n = 3..10,13..19 @integer 3~10, 13~19 @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 3.00",
"pluralRule-count-other": " @integer 0, 20~34, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"gl": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"gsw": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"gu": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"guw": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"gv": {
"pluralRule-count-one": "v = 0 and i % 10 = 1 @integer 1, 11, 21, 31, 41, 51, 61, 71, 101, 1001, …",
"pluralRule-count-two": "v = 0 and i % 10 = 2 @integer 2, 12, 22, 32, 42, 52, 62, 72, 102, 1002, …",
"pluralRule-count-few": "v = 0 and i % 100 = 0,20,40,60,80 @integer 0, 20, 40, 60, 80, 100, 120, 140, 1000, 10000, 100000, 1000000, …",
"pluralRule-count-many": "v != 0 @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @integer 3~10, 13~19, 23, 103, 1003, …"
},
"ha": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"haw": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"he": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-two": "i = 2 and v = 0 @integer 2",
"pluralRule-count-many": "v = 0 and n != 0..10 and n % 10 = 0 @integer 20, 30, 40, 50, 60, 70, 80, 90, 100, 1000, 10000, 100000, 1000000, …",
"pluralRule-count-other": " @integer 0, 3~17, 101, 1001, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"hi": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"hr": {
"pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"hsb": {
"pluralRule-count-one": "v = 0 and i % 100 = 1 or f % 100 = 1 @integer 1, 101, 201, 301, 401, 501, 601, 701, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-two": "v = 0 and i % 100 = 2 or f % 100 = 2 @integer 2, 102, 202, 302, 402, 502, 602, 702, 1002, … @decimal 0.2, 1.2, 2.2, 3.2, 4.2, 5.2, 6.2, 7.2, 10.2, 100.2, 1000.2, …",
"pluralRule-count-few": "v = 0 and i % 100 = 3..4 or f % 100 = 3..4 @integer 3, 4, 103, 104, 203, 204, 303, 304, 403, 404, 503, 504, 603, 604, 703, 704, 1003, … @decimal 0.3, 0.4, 1.3, 1.4, 2.3, 2.4, 3.3, 3.4, 4.3, 4.4, 5.3, 5.4, 6.3, 6.4, 7.3, 7.4, 10.3, 100.3, 1000.3, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"hu": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"hy": {
"pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ia": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"id": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ig": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ii": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"in": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"io": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"is": {
"pluralRule-count-one": "t = 0 and i % 10 = 1 and i % 100 != 11 or t != 0 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1~1.6, 10.1, 100.1, 1000.1, …",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"it": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"iu": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"iw": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-two": "i = 2 and v = 0 @integer 2",
"pluralRule-count-many": "v = 0 and n != 0..10 and n % 10 = 0 @integer 20, 30, 40, 50, 60, 70, 80, 90, 100, 1000, 10000, 100000, 1000000, …",
"pluralRule-count-other": " @integer 0, 3~17, 101, 1001, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ja": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"jbo": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"jgo": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ji": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"jmc": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"jv": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"jw": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ka": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kab": {
"pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kaj": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kcg": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kde": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kea": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kk": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kkj": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kl": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"km": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kn": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ko": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ks": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ksb": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ksh": {
"pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000",
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ku": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"kw": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ky": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"lag": {
"pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000",
"pluralRule-count-one": "i = 0,1 and n != 0 @integer 1 @decimal 0.1~1.6",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"lb": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"lg": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"lkt": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ln": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"lo": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"lt": {
"pluralRule-count-one": "n % 10 = 1 and n % 100 != 11..19 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 71.0, 81.0, 101.0, 1001.0, …",
"pluralRule-count-few": "n % 10 = 2..9 and n % 100 != 11..19 @integer 2~9, 22~29, 102, 1002, … @decimal 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 22.0, 102.0, 1002.0, …",
"pluralRule-count-many": "f != 0 @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.1, 1000.1, …",
"pluralRule-count-other": " @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"lv": {
"pluralRule-count-zero": "n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19 @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-one": "n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-other": " @integer 2~9, 22~29, 102, 1002, … @decimal 0.2~0.9, 1.2~1.9, 10.2, 100.2, 1000.2, …"
},
"mas": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"mg": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"mgo": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"mk": {
"pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.2~1.0, 1.2~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ml": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"mn": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"mo": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-few": "v != 0 or n = 0 or n != 1 and n % 100 = 1..19 @integer 0, 2~16, 101, 1001, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @integer 20~35, 100, 1000, 10000, 100000, 1000000, …"
},
"mr": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ms": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"mt": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-few": "n = 0 or n % 100 = 2..10 @integer 0, 2~10, 102~107, 1002, … @decimal 0.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 10.0, 102.0, 1002.0, …",
"pluralRule-count-many": "n % 100 = 11..19 @integer 11~19, 111~117, 1011, … @decimal 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …",
"pluralRule-count-other": " @integer 20~35, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"my": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nah": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"naq": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nb": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nd": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ne": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nl": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nn": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nnh": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"no": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nqo": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nr": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nso": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ny": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"nyn": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"om": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"or": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"os": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"pa": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"pap": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"pl": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, …",
"pluralRule-count-many": "v = 0 and i != 1 and i % 10 = 0..1 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 12..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …",
"pluralRule-count-other": " @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"prg": {
"pluralRule-count-zero": "n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19 @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-one": "n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-other": " @integer 2~9, 22~29, 102, 1002, … @decimal 0.2~0.9, 1.2~1.9, 10.2, 100.2, 1000.2, …"
},
"ps": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"pt": {
"pluralRule-count-one": "i = 0..1 @integer 0, 1 @decimal 0.0~1.5",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"pt-PT": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"rm": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ro": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-few": "v != 0 or n = 0 or n != 1 and n % 100 = 1..19 @integer 0, 2~16, 101, 1001, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @integer 20~35, 100, 1000, 10000, 100000, 1000000, …"
},
"rof": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"root": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ru": {
"pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …",
"pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, …",
"pluralRule-count-many": "v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …",
"pluralRule-count-other": " @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"rwk": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sah": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"saq": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sc": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"scn": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sd": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sdh": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"se": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"seh": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ses": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sg": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sh": {
"pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"shi": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-few": "n = 2..10 @integer 2~10 @decimal 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00",
"pluralRule-count-other": " @integer 11~26, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~1.9, 2.1~2.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"si": {
"pluralRule-count-one": "n = 0,1 or i = 0 and f = 1 @integer 0, 1 @decimal 0.0, 0.1, 1.0, 0.00, 0.01, 1.00, 0.000, 0.001, 1.000, 0.0000, 0.0001, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.2~0.9, 1.1~1.8, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sk": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-few": "i = 2..4 and v = 0 @integer 2~4",
"pluralRule-count-many": "v != 0 @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …"
},
"sl": {
"pluralRule-count-one": "v = 0 and i % 100 = 1 @integer 1, 101, 201, 301, 401, 501, 601, 701, 1001, …",
"pluralRule-count-two": "v = 0 and i % 100 = 2 @integer 2, 102, 202, 302, 402, 502, 602, 702, 1002, …",
"pluralRule-count-few": "v = 0 and i % 100 = 3..4 or v != 0 @integer 3, 4, 103, 104, 203, 204, 303, 304, 403, 404, 503, 504, 603, 604, 703, 704, 1003, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …"
},
"sma": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"smi": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"smj": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"smn": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sms": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sn": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"so": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sq": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sr": {
"pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …",
"pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …",
"pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ss": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ssy": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"st": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sv": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sw": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"syr": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ta": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"te": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"teo": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"th": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ti": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"tig": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"tk": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"tl": {
"pluralRule-count-one": "v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9 @integer 0~3, 5, 7, 8, 10~13, 15, 17, 18, 20, 21, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1.3, 1.5, 1.7, 1.8, 2.0, 2.1, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …",
"pluralRule-count-other": " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0.6, 0.9, 1.4, 1.6, 1.9, 2.4, 2.6, 10.4, 100.4, 1000.4, …"
},
"tn": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"to": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"tr": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ts": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"tzm": {
"pluralRule-count-one": "n = 0..1 or n = 11..99 @integer 0, 1, 11~24 @decimal 0.0, 1.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0",
"pluralRule-count-other": " @integer 2~10, 100~106, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ug": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"uk": {
"pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …",
"pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, …",
"pluralRule-count-many": "v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …",
"pluralRule-count-other": " @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ur": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"uz": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"ve": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"vi": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"vo": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"vun": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"wa": {
"pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"wae": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"wo": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"xh": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"xog": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"yi": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"yo": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"yue": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"zh": {
"pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"zu": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
}
}
}
}
@@ -0,0 +1,216 @@
const _cc = [
{cardinal:["other"],ordinal:["other"]},
{cardinal:["one","other"],ordinal:["other"]},
{cardinal:["one","other"],ordinal:["one","other"]},
{cardinal:["one","two","other"],ordinal:["other"]}
];
export default {
af: _cc[1],
ak: _cc[1],
am: _cc[1],
ar: {cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},
ars: {cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},
as: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
asa: _cc[1],
ast: _cc[1],
az: {cardinal:["one","other"],ordinal:["one","few","many","other"]},
be: {cardinal:["one","few","many","other"],ordinal:["few","other"]},
bem: _cc[1],
bez: _cc[1],
bg: _cc[1],
bh: _cc[1],
bm: _cc[0],
bn: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
bo: _cc[0],
br: {cardinal:["one","two","few","many","other"],ordinal:["other"]},
brx: _cc[1],
bs: {cardinal:["one","few","other"],ordinal:["other"]},
ca: {cardinal:["one","other"],ordinal:["one","two","few","other"]},
ce: _cc[1],
cgg: _cc[1],
chr: _cc[1],
ckb: _cc[1],
cs: {cardinal:["one","few","many","other"],ordinal:["other"]},
cy: {cardinal:["zero","one","two","few","many","other"],ordinal:["zero","one","two","few","many","other"]},
da: _cc[1],
de: _cc[1],
dsb: {cardinal:["one","two","few","other"],ordinal:["other"]},
dv: _cc[1],
dz: _cc[0],
ee: _cc[1],
el: _cc[1],
en: {cardinal:["one","other"],ordinal:["one","two","few","other"]},
eo: _cc[1],
es: _cc[1],
et: _cc[1],
eu: _cc[1],
fa: _cc[1],
ff: _cc[1],
fi: _cc[1],
fil: _cc[2],
fo: _cc[1],
fr: _cc[2],
fur: _cc[1],
fy: _cc[1],
ga: {cardinal:["one","two","few","many","other"],ordinal:["one","other"]},
gd: {cardinal:["one","two","few","other"],ordinal:["one","two","few","other"]},
gl: _cc[1],
gsw: _cc[1],
gu: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
guw: _cc[1],
gv: {cardinal:["one","two","few","many","other"],ordinal:["other"]},
ha: _cc[1],
haw: _cc[1],
he: {cardinal:["one","two","many","other"],ordinal:["other"]},
hi: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
hr: {cardinal:["one","few","other"],ordinal:["other"]},
hsb: {cardinal:["one","two","few","other"],ordinal:["other"]},
hu: _cc[2],
hy: _cc[2],
ia: _cc[1],
id: _cc[0],
ig: _cc[0],
ii: _cc[0],
"in": _cc[0],
io: _cc[1],
is: _cc[1],
it: {cardinal:["one","other"],ordinal:["many","other"]},
iu: _cc[3],
iw: {cardinal:["one","two","many","other"],ordinal:["other"]},
ja: _cc[0],
jbo: _cc[0],
jgo: _cc[1],
ji: _cc[1],
jmc: _cc[1],
jv: _cc[0],
jw: _cc[0],
ka: {cardinal:["one","other"],ordinal:["one","many","other"]},
kab: _cc[1],
kaj: _cc[1],
kcg: _cc[1],
kde: _cc[0],
kea: _cc[0],
kk: {cardinal:["one","other"],ordinal:["many","other"]},
kkj: _cc[1],
kl: _cc[1],
km: _cc[0],
kn: _cc[1],
ko: _cc[0],
ks: _cc[1],
ksb: _cc[1],
ksh: {cardinal:["zero","one","other"],ordinal:["other"]},
ku: _cc[1],
kw: _cc[3],
ky: _cc[1],
lag: {cardinal:["zero","one","other"],ordinal:["other"]},
lb: _cc[1],
lg: _cc[1],
lkt: _cc[0],
ln: _cc[1],
lo: {cardinal:["other"],ordinal:["one","other"]},
lt: {cardinal:["one","few","many","other"],ordinal:["other"]},
lv: {cardinal:["zero","one","other"],ordinal:["other"]},
mas: _cc[1],
mg: _cc[1],
mgo: _cc[1],
mk: {cardinal:["one","other"],ordinal:["one","two","many","other"]},
ml: _cc[1],
mn: _cc[1],
mo: {cardinal:["one","few","other"],ordinal:["one","other"]},
mr: {cardinal:["one","other"],ordinal:["one","two","few","other"]},
ms: {cardinal:["other"],ordinal:["one","other"]},
mt: {cardinal:["one","few","many","other"],ordinal:["other"]},
my: _cc[0],
nah: _cc[1],
naq: _cc[3],
nb: _cc[1],
nd: _cc[1],
ne: _cc[2],
nl: _cc[1],
nn: _cc[1],
nnh: _cc[1],
no: _cc[1],
nqo: _cc[0],
nr: _cc[1],
nso: _cc[1],
ny: _cc[1],
nyn: _cc[1],
om: _cc[1],
or: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
os: _cc[1],
pa: _cc[1],
pap: _cc[1],
pl: {cardinal:["one","few","many","other"],ordinal:["other"]},
prg: {cardinal:["zero","one","other"],ordinal:["other"]},
ps: _cc[1],
pt: _cc[1],
"pt-PT": _cc[1],
rm: _cc[1],
ro: {cardinal:["one","few","other"],ordinal:["one","other"]},
rof: _cc[1],
root: _cc[0],
ru: {cardinal:["one","few","many","other"],ordinal:["other"]},
rwk: _cc[1],
sah: _cc[0],
saq: _cc[1],
sc: {cardinal:["one","other"],ordinal:["many","other"]},
scn: {cardinal:["one","other"],ordinal:["many","other"]},
sd: _cc[1],
sdh: _cc[1],
se: _cc[3],
seh: _cc[1],
ses: _cc[0],
sg: _cc[0],
sh: {cardinal:["one","few","other"],ordinal:["other"]},
shi: {cardinal:["one","few","other"],ordinal:["other"]},
si: _cc[1],
sk: {cardinal:["one","few","many","other"],ordinal:["other"]},
sl: {cardinal:["one","two","few","other"],ordinal:["other"]},
sma: _cc[3],
smi: _cc[3],
smj: _cc[3],
smn: _cc[3],
sms: _cc[3],
sn: _cc[1],
so: _cc[1],
sq: {cardinal:["one","other"],ordinal:["one","many","other"]},
sr: {cardinal:["one","few","other"],ordinal:["other"]},
ss: _cc[1],
ssy: _cc[1],
st: _cc[1],
sv: _cc[2],
sw: _cc[1],
syr: _cc[1],
ta: _cc[1],
te: _cc[1],
teo: _cc[1],
th: _cc[0],
ti: _cc[1],
tig: _cc[1],
tk: {cardinal:["one","other"],ordinal:["few","other"]},
tl: _cc[2],
tn: _cc[1],
to: _cc[0],
tr: _cc[1],
ts: _cc[1],
tzm: _cc[1],
ug: _cc[1],
uk: {cardinal:["one","few","many","other"],ordinal:["few","other"]},
ur: _cc[1],
uz: _cc[1],
ve: _cc[1],
vi: {cardinal:["other"],ordinal:["one","other"]},
vo: _cc[1],
vun: _cc[1],
wa: _cc[1],
wae: _cc[1],
wo: _cc[0],
xh: _cc[1],
xog: _cc[1],
yi: _cc[1],
yo: _cc[0],
yue: _cc[0],
zh: _cc[0],
zu: _cc[1]
}
File diff suppressed because it is too large Load Diff
+335
View File
@@ -0,0 +1,335 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.MakePlural = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
/**
* make-plural -- https://github.com/eemeli/make-plural
* Copyright (c) 2014-2016 by Eemeli Aro <eemeli@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* The software is provided "as is" and the author disclaims all warranties
* with regard to this software including all implied warranties of
* merchantability and fitness. In no event shall the author be liable for
* any special, direct, indirect, or consequential damages or any damages
* whatsoever resulting from loss of use, data or profits, whether in an
* action of contract, negligence or other tortious action, arising out of
* or in connection with the use or performance of this software.
*/
var Parser =
/*#__PURE__*/
function () {
function Parser() {
_classCallCheck(this, Parser);
}
_createClass(Parser, [{
key: "parse",
value: function parse(cond) {
var _this = this;
if (cond === 'i = 0 or n = 1') return 'n >= 0 && n <= 1';
if (cond === 'i = 0,1') return 'n >= 0 && n < 2';
if (cond === 'i = 1 and v = 0') {
this.v0 = 1;
return 'n == 1 && v0';
}
return cond.replace(/([tv]) (!?)= 0/g, function (m, sym, noteq) {
var sn = sym + '0';
_this[sn] = 1;
return noteq ? '!' + sn : sn;
}).replace(/\b[fintv]\b/g, function (m) {
_this[m] = 1;
return m;
}).replace(/([fin]) % (10+)/g, function (m, sym, num) {
var sn = sym + num;
_this[sn] = 1;
return sn;
}).replace(/n10+ = 0/g, 't0 && $&').replace(/(\w+ (!?)= )([0-9.]+,[0-9.,]+)/g, function (m, se, noteq, x) {
if (m === 'n = 0,1') return '(n == 0 || n == 1)';
if (noteq) return se + x.split(',').join(' && ' + se);
return '(' + se + x.split(',').join(' || ' + se) + ')';
}).replace(/(\w+) (!?)= ([0-9]+)\.\.([0-9]+)/g, function (m, sym, noteq, x0, x1) {
if (Number(x0) + 1 === Number(x1)) {
if (noteq) return "".concat(sym, " != ").concat(x0, " && ").concat(sym, " != ").concat(x1);
return "(".concat(sym, " == ").concat(x0, " || ").concat(sym, " == ").concat(x1, ")");
}
if (noteq) return "(".concat(sym, " < ").concat(x0, " || ").concat(sym, " > ").concat(x1, ")");
if (sym === 'n') {
_this.t0 = 1;
return "(t0 && n >= ".concat(x0, " && n <= ").concat(x1, ")");
}
return "(".concat(sym, " >= ").concat(x0, " && ").concat(sym, " <= ").concat(x1, ")");
}).replace(/ and /g, ' && ').replace(/ or /g, ' || ').replace(/ = /g, ' == ');
}
}, {
key: "vars",
value: function vars() {
var vars = [];
if (this.i) vars.push('i = s[0]');
if (this.f || this.v) vars.push("f = s[1] || ''");
if (this.t) vars.push("t = (s[1] || '').replace(/0+$/, '')");
if (this.v) vars.push('v = f.length');
if (this.v0) vars.push('v0 = !s[1]');
if (this.t0 || this.n10 || this.n100) vars.push('t0 = Number(s[0]) == n');
for (var k in this) {
if (/^.10+$/.test(k)) {
var k0 = k[0] === 'n' ? 't0 && s[0]' : k[0];
vars.push("".concat(k, " = ").concat(k0, ".slice(-").concat(k.substr(2).length, ")"));
}
}
if (!vars.length) return '';
return 'var ' + ["s = String(n).split('.')"].concat(vars).join(', ');
}
}]);
return Parser;
}();
var Tests =
/*#__PURE__*/
function () {
function Tests(obj) {
_classCallCheck(this, Tests);
this.obj = obj;
this.ordinal = {};
this.cardinal = {};
}
_createClass(Tests, [{
key: "add",
value: function add(type, cat, src) {
this[type][cat] = {
src: src,
values: null
};
}
}, {
key: "testCond",
value: function testCond(n, type, expResult, fn) {
try {
var r = (fn || this.obj.fn)(n, type === 'ordinal');
} catch (e) {
r = e.toString();
}
if (r !== expResult) {
throw new Error('Locale ' + JSON.stringify(this.obj.lc) + type + ' rule self-test failed for v = ' + JSON.stringify(n) + ' (was ' + JSON.stringify(r) + ', expected ' + JSON.stringify(expResult) + ')');
}
return true;
}
}, {
key: "testCat",
value: function testCat(type, cat, fn) {
var _this2 = this;
var data = this[type][cat];
if (!data.values) {
data.values = data.src.join(' ').replace(/^[ ,]+|[ ,…]+$/g, '').replace(/(0\.[0-9])~(1\.[1-9])/g, '$1 1.0 $2').split(/[ ,~…]+/);
}
data.values.forEach(function (n) {
_this2.testCond(n, type, cat, fn);
if (!/\.0+$/.test(n)) _this2.testCond(Number(n), type, cat, fn);
});
return true;
}
}, {
key: "testAll",
value: function testAll() {
for (var cat in this.cardinal) {
this.testCat('cardinal', cat);
}
for (var _cat in this.ordinal) {
this.testCat('ordinal', _cat);
}
return true;
}
}]);
return Tests;
}();
var MakePlural =
/*#__PURE__*/
function () {
function MakePlural(lc) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MakePlural,
cardinals = _ref.cardinals,
ordinals = _ref.ordinals;
_classCallCheck(this, MakePlural);
if (!cardinals && !ordinals) throw new Error('At least one type of plural is required');
this.lc = lc;
this.categories = {
cardinal: [],
ordinal: []
};
this.parser = new Parser();
this.tests = new Tests(this);
this.fn = this.buildFunction(cardinals, ordinals);
this.fn._obj = this;
this.fn.categories = this.categories;
this.fn.test = function () {
return this.tests.testAll() && this.fn;
}.bind(this);
this.fn.toString = this.fnToString.bind(this);
return this.fn;
}
_createClass(MakePlural, [{
key: "compile",
value: function compile(type, req) {
var cases = [];
var rules = MakePlural.getRules(type, this.lc);
if (!rules) {
if (req) throw new Error("Locale \"".concat(this.lc, "\" ").concat(type, " rules not found"));
this.categories[type] = ['other'];
return "'other'";
}
for (var r in rules) {
var _rules$r$trim$split = rules[r].trim().split(/\s*@\w*/),
_rules$r$trim$split2 = _toArray(_rules$r$trim$split),
cond = _rules$r$trim$split2[0],
examples = _rules$r$trim$split2.slice(1);
var cat = r.replace('pluralRule-count-', '');
if (cond) cases.push([this.parser.parse(cond), cat]);
this.tests.add(type, cat, examples);
}
this.categories[type] = cases.map(function (c) {
return c[1];
}).concat('other');
if (cases.length === 1) {
return "(".concat(cases[0][0], ") ? '").concat(cases[0][1], "' : 'other'");
} else {
return _toConsumableArray(cases.map(function (c) {
return "(".concat(c[0], ") ? '").concat(c[1], "'");
})).concat(["'other'"]).join('\n : ');
}
}
}, {
key: "buildFunction",
value: function buildFunction(cardinals, ordinals) {
var _this3 = this;
var compile = function compile(c) {
return c ? (c[1] ? 'return ' : 'if (ord) return ') + _this3.compile.apply(_this3, _toConsumableArray(c)) : '';
};
var fold = {
vars: function vars(str) {
return " ".concat(str, ";").replace(/(.{1,78})(,|$) ?/g, '$1$2\n ');
},
cond: function cond(str) {
return " ".concat(str, ";").replace(/(.{1,78}) (\|\| |$) ?/gm, '$1\n $2');
}
};
var cond = [ordinals && ['ordinal', !cardinals], cardinals && ['cardinal', true]].map(compile).map(fold.cond);
var body = [fold.vars(this.parser.vars())].concat(_toConsumableArray(cond)).filter(function (line) {
return !/^[\s;]*$/.test(line);
}).map(function (line) {
return line.replace(/\s+$/gm, '');
}).join('\n');
var args = ordinals && cardinals ? 'n, ord' : 'n';
return new Function(args, body); // eslint-disable-line no-new-func
}
}, {
key: "fnToString",
value: function fnToString(name) {
return Function.prototype.toString.call(this.fn).replace(/^function( \w+)?/, name ? 'function ' + name : 'function').replace(/\n\/\*(``)?\*\//, '');
}
}], [{
key: "load",
value: function load() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
args.forEach(function (cldr) {
var data = cldr && cldr.supplemental || null;
if (!data) throw new Error('Data does not appear to be CLDR data');
MakePlural.rules = {
cardinal: data['plurals-type-cardinal'] || MakePlural.rules.cardinal,
ordinal: data['plurals-type-ordinal'] || MakePlural.rules.ordinal
};
});
return MakePlural;
}
}, {
key: "getRules",
value: function getRules(type, locale) {
if (locale.length) {
var cat = MakePlural.rules[type];
if (locale in cat) return cat[locale];
var lc0 = locale.toLowerCase();
for (var lc in cat) {
if (lc.toLowerCase() === lc0) return cat[lc];
}
}
return null;
}
}]);
return MakePlural;
}();
exports.default = MakePlural;
MakePlural.cardinals = true;
MakePlural.ordinals = false;
MakePlural.rules = {
cardinal: {},
ordinal: {}
};
module.exports = exports.default;
},{}]},{},[1])(1)
});
File diff suppressed because one or more lines are too long
+52
View File
@@ -0,0 +1,52 @@
{
"name": "make-plural",
"version": "4.3.0",
"description": "Translates Unicode CLDR pluralization rules to executable JavaScript",
"keywords": [
"unicode",
"cldr",
"i18n",
"internationalization",
"pluralization"
],
"author": "Eemeli Aro <eemeli@gmail.com>",
"license": "ISC",
"homepage": "https://github.com/eemeli/make-plural#readme",
"repository": "eemeli/make-plural",
"bugs": {
"url": "https://github.com/eemeli/make-plural/issues"
},
"files": [
"bin/",
"data/",
"es6/",
"make-plural.*",
"umd/"
],
"bin": {
"make-plural": "./bin/make-plural"
},
"main": "umd/plurals",
"scripts": {
"lint": "standard 'src/*.js'",
"test": "make test",
"version": "git add -f $FILES"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"babel-plugin-add-module-exports": "^1.0.0",
"babelify": "^10.0.0",
"browserify": "^16.2.3",
"cldr-core": "^34.0.0",
"expect.js": "*",
"http-server": "^0.11.1",
"mocha": "^5.2.0",
"standard": "^12.0.1",
"uglify-js": "^3.4.9"
},
"optionalDependencies": {
"minimist": "^1.2.0"
}
}
@@ -0,0 +1,224 @@
var _cc = [
{cardinal:["other"],ordinal:["other"]},
{cardinal:["one","other"],ordinal:["other"]},
{cardinal:["one","other"],ordinal:["one","other"]},
{cardinal:["one","two","other"],ordinal:["other"]}
];
(function (root, pluralCategories) {
if (typeof define === 'function' && define.amd) {
define(pluralCategories);
} else if (typeof exports === 'object') {
module.exports = pluralCategories;
} else {
root.pluralCategories = pluralCategories;
}
}(this, {
af: _cc[1],
ak: _cc[1],
am: _cc[1],
ar: {cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},
ars: {cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},
as: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
asa: _cc[1],
ast: _cc[1],
az: {cardinal:["one","other"],ordinal:["one","few","many","other"]},
be: {cardinal:["one","few","many","other"],ordinal:["few","other"]},
bem: _cc[1],
bez: _cc[1],
bg: _cc[1],
bh: _cc[1],
bm: _cc[0],
bn: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
bo: _cc[0],
br: {cardinal:["one","two","few","many","other"],ordinal:["other"]},
brx: _cc[1],
bs: {cardinal:["one","few","other"],ordinal:["other"]},
ca: {cardinal:["one","other"],ordinal:["one","two","few","other"]},
ce: _cc[1],
cgg: _cc[1],
chr: _cc[1],
ckb: _cc[1],
cs: {cardinal:["one","few","many","other"],ordinal:["other"]},
cy: {cardinal:["zero","one","two","few","many","other"],ordinal:["zero","one","two","few","many","other"]},
da: _cc[1],
de: _cc[1],
dsb: {cardinal:["one","two","few","other"],ordinal:["other"]},
dv: _cc[1],
dz: _cc[0],
ee: _cc[1],
el: _cc[1],
en: {cardinal:["one","other"],ordinal:["one","two","few","other"]},
eo: _cc[1],
es: _cc[1],
et: _cc[1],
eu: _cc[1],
fa: _cc[1],
ff: _cc[1],
fi: _cc[1],
fil: _cc[2],
fo: _cc[1],
fr: _cc[2],
fur: _cc[1],
fy: _cc[1],
ga: {cardinal:["one","two","few","many","other"],ordinal:["one","other"]},
gd: {cardinal:["one","two","few","other"],ordinal:["one","two","few","other"]},
gl: _cc[1],
gsw: _cc[1],
gu: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
guw: _cc[1],
gv: {cardinal:["one","two","few","many","other"],ordinal:["other"]},
ha: _cc[1],
haw: _cc[1],
he: {cardinal:["one","two","many","other"],ordinal:["other"]},
hi: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
hr: {cardinal:["one","few","other"],ordinal:["other"]},
hsb: {cardinal:["one","two","few","other"],ordinal:["other"]},
hu: _cc[2],
hy: _cc[2],
ia: _cc[1],
id: _cc[0],
ig: _cc[0],
ii: _cc[0],
"in": _cc[0],
io: _cc[1],
is: _cc[1],
it: {cardinal:["one","other"],ordinal:["many","other"]},
iu: _cc[3],
iw: {cardinal:["one","two","many","other"],ordinal:["other"]},
ja: _cc[0],
jbo: _cc[0],
jgo: _cc[1],
ji: _cc[1],
jmc: _cc[1],
jv: _cc[0],
jw: _cc[0],
ka: {cardinal:["one","other"],ordinal:["one","many","other"]},
kab: _cc[1],
kaj: _cc[1],
kcg: _cc[1],
kde: _cc[0],
kea: _cc[0],
kk: {cardinal:["one","other"],ordinal:["many","other"]},
kkj: _cc[1],
kl: _cc[1],
km: _cc[0],
kn: _cc[1],
ko: _cc[0],
ks: _cc[1],
ksb: _cc[1],
ksh: {cardinal:["zero","one","other"],ordinal:["other"]},
ku: _cc[1],
kw: _cc[3],
ky: _cc[1],
lag: {cardinal:["zero","one","other"],ordinal:["other"]},
lb: _cc[1],
lg: _cc[1],
lkt: _cc[0],
ln: _cc[1],
lo: {cardinal:["other"],ordinal:["one","other"]},
lt: {cardinal:["one","few","many","other"],ordinal:["other"]},
lv: {cardinal:["zero","one","other"],ordinal:["other"]},
mas: _cc[1],
mg: _cc[1],
mgo: _cc[1],
mk: {cardinal:["one","other"],ordinal:["one","two","many","other"]},
ml: _cc[1],
mn: _cc[1],
mo: {cardinal:["one","few","other"],ordinal:["one","other"]},
mr: {cardinal:["one","other"],ordinal:["one","two","few","other"]},
ms: {cardinal:["other"],ordinal:["one","other"]},
mt: {cardinal:["one","few","many","other"],ordinal:["other"]},
my: _cc[0],
nah: _cc[1],
naq: _cc[3],
nb: _cc[1],
nd: _cc[1],
ne: _cc[2],
nl: _cc[1],
nn: _cc[1],
nnh: _cc[1],
no: _cc[1],
nqo: _cc[0],
nr: _cc[1],
nso: _cc[1],
ny: _cc[1],
nyn: _cc[1],
om: _cc[1],
or: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
os: _cc[1],
pa: _cc[1],
pap: _cc[1],
pl: {cardinal:["one","few","many","other"],ordinal:["other"]},
prg: {cardinal:["zero","one","other"],ordinal:["other"]},
ps: _cc[1],
pt: _cc[1],
"pt-PT": _cc[1],
rm: _cc[1],
ro: {cardinal:["one","few","other"],ordinal:["one","other"]},
rof: _cc[1],
root: _cc[0],
ru: {cardinal:["one","few","many","other"],ordinal:["other"]},
rwk: _cc[1],
sah: _cc[0],
saq: _cc[1],
sc: {cardinal:["one","other"],ordinal:["many","other"]},
scn: {cardinal:["one","other"],ordinal:["many","other"]},
sd: _cc[1],
sdh: _cc[1],
se: _cc[3],
seh: _cc[1],
ses: _cc[0],
sg: _cc[0],
sh: {cardinal:["one","few","other"],ordinal:["other"]},
shi: {cardinal:["one","few","other"],ordinal:["other"]},
si: _cc[1],
sk: {cardinal:["one","few","many","other"],ordinal:["other"]},
sl: {cardinal:["one","two","few","other"],ordinal:["other"]},
sma: _cc[3],
smi: _cc[3],
smj: _cc[3],
smn: _cc[3],
sms: _cc[3],
sn: _cc[1],
so: _cc[1],
sq: {cardinal:["one","other"],ordinal:["one","many","other"]},
sr: {cardinal:["one","few","other"],ordinal:["other"]},
ss: _cc[1],
ssy: _cc[1],
st: _cc[1],
sv: _cc[2],
sw: _cc[1],
syr: _cc[1],
ta: _cc[1],
te: _cc[1],
teo: _cc[1],
th: _cc[0],
ti: _cc[1],
tig: _cc[1],
tk: {cardinal:["one","other"],ordinal:["few","other"]},
tl: _cc[2],
tn: _cc[1],
to: _cc[0],
tr: _cc[1],
ts: _cc[1],
tzm: _cc[1],
ug: _cc[1],
uk: {cardinal:["one","few","many","other"],ordinal:["few","other"]},
ur: _cc[1],
uz: _cc[1],
ve: _cc[1],
vi: {cardinal:["other"],ordinal:["one","other"]},
vo: _cc[1],
vun: _cc[1],
wa: _cc[1],
wae: _cc[1],
wo: _cc[0],
xh: _cc[1],
xog: _cc[1],
yi: _cc[1],
yo: _cc[0],
yue: _cc[0],
zh: _cc[0],
zu: _cc[1]
}));
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+92
View File
@@ -0,0 +1,92 @@
{
"name": "messageformat",
"version": "2.3.0",
"description": "PluralFormat and SelectFormat Message and i18n Tool - A JavaScript Implemenation of the ICU standards.",
"keywords": [
"i18n",
"pluralformat",
"icu",
"gettext",
"choiceformat",
"selectformat",
"messageformat",
"internationalization"
],
"author": "Alex Sexton <alexsexton@gmail.com>",
"contributors": [
"Eemeli Aro <eemeli@gmail.com>"
],
"license": "MIT",
"homepage": "https://messageformat.github.io/messageformat/",
"repository": "messageformat/messageformat",
"main": "index.js",
"browser": "./messageformat.js",
"files": [
"index.d.ts",
"lib",
"messageformat.js",
"messageformat.js.map",
"messages.js"
],
"babel": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "6.5.0"
}
}
]
],
"plugins": [
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
]
]
},
"eslintConfig": {
"env": {
"commonjs": true,
"es6": true
},
"overrides": [
{
"files": [
"src/*.js"
],
"parser": "babel-eslint"
},
{
"files": [
"webpack.config.js"
],
"env": {
"node": true
}
}
]
},
"dependencies": {
"make-plural": "^4.3.0",
"messageformat-formatters": "^2.0.1",
"messageformat-parser": "^4.1.2"
},
"devDependencies": {
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"babel-loader": "^8.0.6",
"webpack": "^4.32.2",
"webpack-cli": "^3.3.2"
},
"scripts": {
"prebuild": "babel src -d lib",
"build": "webpack --mode production"
},
"gitHead": "cd47ed7db2b7a4f5e21df4cd6284ae3f7dad05a1"
}