Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Webpack instead of Grunt; add a standalone version without locales; #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Created by https://www.gitignore.io

# Webstorm
.idea

### Node ###
# Logs
logs
Expand Down
38 changes: 0 additions & 38 deletions Gruntfile.js

This file was deleted.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ writtenNumber(1234, {lang: 'vi'}); // => 'một ngàn hai trăm và ba mươi
writtenNumber(1234, {lang: 'uk'}); // => 'одна тисяча двісті тридцять чотири'
writtenNumber(1234, {lang: 'id'}); // => 'seribu dua ratus tiga puluh empat'
```
### Standalone version
If you don't want the overhead of including all the locales.
```javascript
var writtenNumber = require('lib/written-number.standalone');
var en = require('lib/i18n/en');
writtenNumber(1234, {lang: en}); // => 'one thousand two hundred and thirty-four'

var es = require('lib/i18n/es');
writtenNumber.defaults.lang = es;
writtenNumber(4758); // => 'cuatro mil setecientos cincuenta y ocho'
```

## Options
- `noAnd` - Defaults to `false`. Determines whether to use a separator. The
Expand Down
147 changes: 147 additions & 0 deletions dist/i18n/ar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
"useLongScale": false,
"baseSeparator": "",
"unitSeparator": "",
"allSeparator": "و",
"base": {
"0": "صفر",
"1": "واحد",
"2": "اثنان",
"3": "ثلاثة",
"4": "أربعة",
"5": "خمسة",
"6": "ستة",
"7": "سبعة",
"8": "ثمانية",
"9": "تسعة",

"10": "عشرة",
"11": "أحد عشر",
"12": "إثنا عشر",
"13": "ثلاثة عشر",
"14": "أربعة عشر",
"15": "خمسة عشر",
"16": "ستة عشر",
"17": "سبعة عشر",
"18": "ثمانية عشر",
"19": "تسعة عشر",

"20": "عشرون",
"21": "واحد وعشرون",
"22": "اثنان وعشرون",
"23": "ثلاثة وعشرون",
"24": "أربعة وعشرون",
"25": "خمسة وعشرون",
"26": "ستة وعشرون",
"27": "سبعة وعشرون",
"28": "ثمانية وعشرون",
"29": "تسعة وعشرون",

"30": "ثلاثون",
"31": "واحد وثلاثون",
"32": "اثنان وثلاثون",
"33": "ثلاثة وثلاثون",
"34": "أربعة وثلاثون",
"35": "خمسة وثلاثون",
"36": "ستة وثلاثون",
"37": "سبعة وثلاثون",
"38": "ثمانية وثلاثون",
"39": "تسعة وثلاثون",

"40": "أربعون",
"41": "واحد وأربعون",
"42": "اثنان وأربعون",
"43": "ثلاثة وأربعون",
"44": "أربعة وأربعون",
"45": "خمسة وأربعون",
"46": "ستة وأربعون",
"47": "سبعة وأربعون",
"48": "ثمانية وأربعون",
"49": "تسعة وأربعون",

"50": "خمسون",
"51": "واحد وخمسون",
"52": "اثنان وخمسون",
"53": "ثلاثة وخمسون",
"54": "أربعة وخمسون",
"55": "خمسة وخمسون",
"56": "ستة وخمسون",
"57": "سبعة وخمسون",
"58": "ثمانية وخمسون",
"59": "تسعة وخمسون",

"60": "ستون",
"61": "واحد وستون",
"62": "اثنان وستون",
"63": "ثلاثة وستون",
"64": "أربعة وستون",
"65": "خمسة وستون",
"66": "ستة وستون",
"67": "سبعة وستون",
"68": "ثمانية وستون",
"69": "تسعة وستون",

"70": "سبعون",
"71": "واحد وسبعون",
"72": "اثنان وسبعون",
"73": "ثلاثة وسبعون",
"74": "أربعة وسبعون",
"75": "خمسة وسبعون",
"76": "ستة وسبعون",
"77": "سبعة وسبعون",
"78": "ثمانية وسبعون",
"79": "تسعة وسبعون",

"80": "ثمانون",
"81": "واحد وثمانون",
"82": "اثنان وثمانون",
"83": "ثلاثة وثمانون",
"84": "أربعة وثمانون",
"85": "خمسة وثمانون",
"86": "ستة وثمانون",
"87": "سبعة وثمانون",
"88": "ثمانية وثمانون",
"89": "تسعة وثمانون",

"90": "تسعون",
"91": "واحد وتسعون",
"92": "اثنان وتسعون",
"93": "ثلاثة وتسعون",
"94": "أربعة وتسعون",
"95": "خمسة وتسعون",
"96": "ستة وتسعون",
"97": "سبعة وتسعون",
"98": "ثمانية وتسعون",
"99": "تسعة وتسعون",

"200": "مائتان",
"300": "ثلاثمائة",
"400": "أربعمائة",
"500": "خمسمائة",
"600": "ستمائة",
"700": "سبعمائة",
"800": "ثمانمائة",
"900": "تسعمائة"
},
"units" : [
{"singular":"مائة", "useBaseInstead": true, "useBaseException": [1]},
{"singular":"ألف", "dual":"ألفان", "plural":"آلاف", "restrictedPlural": true, "avoidPrefixException": [1, 2]},
{"singular":"مليون", "dual":"مليونان", "plural":"ملايين", "restrictedPlural": true, "avoidPrefixException": [1, 2]},
{"singular":"مليار", "dual":"ملياران", "plural":"ملايير", "restrictedPlural": true, "avoidPrefixException": [1, 2]},

{"singular":"تريليون", "avoidPrefixException": [1]},
{"singular":"كوادريليون", "avoidPrefixException": [1]},
{"singular":"كوينتليون", "avoidPrefixException": [1]},
{"singular":"سكستليون", "avoidPrefixException": [1]},
{"singular":"سبتيلليون", "avoidPrefixException": [1]},
{"singular":"أوكتيليون", "avoidPrefixException": [1]},
{"singular":"نونيلليون", "avoidPrefixException": [1]},
{"singular":"دشيليون", "avoidPrefixException": [1]},
{"singular":"أوندشيلليون", "avoidPrefixException": [1]},
{"singular":"دودشيليون", "avoidPrefixException": [1]},
{"singular":"تريدشيليون", "avoidPrefixException": [1]},
{"singular":"كواتوردشيليون", "avoidPrefixException": [1]},
{"singular":"كويندشيليون" , "avoidPrefixException": [1]}
],
"unitExceptions": {}
}
52 changes: 52 additions & 0 deletions dist/i18n/az.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"useLongScale": false,
"baseSeparator": " ",
"unitSeparator": "",
"base": {
"0": "sıfır",
"1": "bir",
"2": "iki",
"3": "üç",
"4": "dörd",
"5": "beş",
"6": "altı",
"7": "yeddi",
"8": "səkkiz",
"9": "doqquz",
"10": "on",
"20": "iyirmi",
"30": "otuz",
"40": "qırx",
"50": "əlli",
"60": "altmış",
"70": "yetmiş",
"80": "səksən",
"90": "doxsan"
},
"units" : [
{
"singular": "yüz",
"avoidPrefixException": [1]
},
{
"singular": "min",
"avoidPrefixException": [1]
},
"milyon",
"milyard",
"trilyon",
"kvadrilyon",
"kentilyon",
"sekstilyon",
"septilyon",
"oktilyon",
"nonilyon",
"desilyon",
"andesilyon",
"dodesilyon",
"tredesilyon",
"katordesilyon",
"kendesilyon"
],
"unitExceptions": []
}
42 changes: 42 additions & 0 deletions dist/i18n/en-indian.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"useLongScale": false,
"baseSeparator": "-",
"unitSeparator": "and ",
"base": {
"0": "zero",
"1": "one",
"2": "two",
"3": "three",
"4": "four",
"5": "five",
"6": "six",
"7": "seven",
"8": "eight",
"9": "nine",
"10": "ten",
"11": "eleven",
"12": "twelve",
"13": "thirteen",
"14": "fourteen",
"15": "fifteen",
"16": "sixteen",
"17": "seventeen",
"18": "eighteen",
"19": "nineteen",
"20": "twenty",
"30": "thirty",
"40": "forty",
"50": "fifty",
"60": "sixty",
"70": "seventy",
"80": "eighty",
"90": "ninety"
},
"units" : {
"2": "hundred",
"3": "thousand",
"5": "lakh",
"7": "crore"
},
"unitExceptions": []
}
55 changes: 55 additions & 0 deletions dist/i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"useLongScale": false,
"baseSeparator": "-",
"unitSeparator": "and ",
"base": {
"0": "zero",
"1": "one",
"2": "two",
"3": "three",
"4": "four",
"5": "five",
"6": "six",
"7": "seven",
"8": "eight",
"9": "nine",
"10": "ten",
"11": "eleven",
"12": "twelve",
"13": "thirteen",
"14": "fourteen",
"15": "fifteen",
"16": "sixteen",
"17": "seventeen",
"18": "eighteen",
"19": "nineteen",
"20": "twenty",
"30": "thirty",
"40": "forty",
"50": "fifty",
"60": "sixty",
"70": "seventy",
"80": "eighty",
"90": "ninety"
},
"units" : [
"hundred",
"thousand",
"million",
"billion",
"trillion",
"quadrillion",
"quintillion",
"sextillion",
"septillion",
"octillion",
"nonillion",
"decillion",
"undecillion",
"duodecillion",
"tredecillion",
"quattuordecillion",
"quindecillion"
],
"unitExceptions": []
}
Loading