Skip to content
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ Currently supported languages are:
## Contributing

### Configure your own language
Each language has its own unique grammar exceptions. You can create your own
language.json file in the folder "i18n" and give writtenNumber support for it. I
don't think the current scheme and logic cover all the cases, but may be cover
Each language has its own unique grammar exceptions. You can create your own
language.json file in the folder "i18n" and give writtenNumber support for it. I
don't think the current scheme and logic cover all the cases, but may be cover
some.

The following parameters have been used for the currently available languages:
Expand All @@ -88,6 +88,7 @@ The following parameters have been used for the currently available languages:
| `alternativeBase` | Object | Alternative versions of base cardinals numbers for usage with specific units. These bases will be treated as an extension for the default `base`. | ``` "alternativeBase": { "feminine": {"1":"одна","2":"дві"} } ``` |
| `units` | Array | A list of number units (string or Object). Gives support to singular, dual an plural units. Check the Object parameters below. | |
| `unitExceptions` | Object | Sometimes grammar exceptions affect the base cardinal joined to the unit. You can set specific exceptions to any base cardinal number. | Converting 1232000 in Spanish: Without Exception (Wrong): -> **uno** millón doscientos treinta y dos mil With Exception: -> **un** millón doscientos treinta y dos mil |
| `cardinalExceptions` | Object | For setting exceptions for when individual cardinals are written differently on their own, as compared with how they are written when quantifying units | 1 => *eins*, 1000 => *ein*tausend |

### Units parameters

Expand Down
215 changes: 215 additions & 0 deletions lib/i18n/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
{
"useLongScale": false,
"noSpaces": true,
"baseSeparator": "",
"unitSeparator": "",
"base": {
"0": "null",
"1": "ein",
"2": "zwei",
"3": "drei",
"4": "vier",
"5": "fünf",
"6": "sechs",
"7": "sieben",
"8": "acht",
"9": "neun",
"10": "zehn",
"11": "elf",
"12": "zwölf",
"13": "dreizehn",
"14": "vierzehn",
"15": "fünfzehn",
"16": "sechzehn",
"17": "siebenzehn",
"18": "achtzehn",
"19": "neunzehn",
"20": "zwanzig",
"21": "einundzwanzig",
"22": "zweiundzwanzig",
"23": "dreiundzwanzig",
"24": "vierundzwanzig",
"25": "fünfundzwanzig",
"26": "sechsundzwanzig",
"27": "siebenundzwanzig",
"28": "achtundzwanzig",
"29": "neunundzwanzig",
"30": "dreißig",
"31": "einunddreißig",
"32": "zweiunddreißig",
"33": "dreiunddreißig",
"34": "vierunddreißig",
"35": "fünfunddreißig",
"36": "sechsunddreißig",
"37": "siebenunddreißig",
"38": "achtunddreißig",
"39": "neununddreißig",
"40": "vierzig",
"41": "einundvierzig",
"42": "zweiundvierzig",
"43": "dreiundvierzig",
"44": "vierundvierzig",
"45": "fünfundvierzig",
"46": "sechsundvierzig",
"47": "siebenundvierzig",
"48": "achtundvierzig",
"49": "neunundvierzig",
"50": "fünfzig",
"51": "einundfünfzig",
"52": "zweiundfünfzig",
"53": "dreiundfünfzig",
"54": "vierundfünfzig",
"55": "fünfundfünfzig",
"56": "sechsundfünfzig",
"57": "siebenundfünfzig",
"58": "achtundfünfzig",
"59": "neunundfünfzig",
"60": "sechzig",
"61": "einundsechzig",
"62": "zweiundsechzig",
"63": "dreiundsechzig",
"64": "vierundsechzig",
"65": "fünfundsechzig",
"66": "sechsundsechzig",
"67": "siebenundsechzig",
"68": "achtundsechzig",
"69": "neunundsechzig",
"70": "siebzig",
"71": "einundsiebzig",
"72": "zweiundsiebzig",
"73": "dreiundsiebzig",
"74": "vierundsiebzig",
"75": "fünfundsiebzig",
"76": "sechsundsiebzig",
"77": "siebenundsiebzig",
"78": "achtundsiebzig",
"79": "neunundsiebzig",
"80": "achtzig",
"81": "einundachtzig",
"82": "zweiundachtzig",
"83": "dreiundachtzig",
"84": "vierundachtzig",
"85": "fünfundachtzig",
"86": "sechsundachtzig",
"87": "siebenundachtzig",
"88": "achtundachtzig",
"89": "neunundachtzig",
"90": "neunzig",
"91": "einundneunzig",
"92": "zweiundneunzig",
"93": "dreiundneunzig",
"94": "vierundneunzig",
"95": "fünfundneunzig",
"96": "sechsundneunzig",
"97": "siebenundneunzig",
"98": "achtundneunzig",
"99": "neunundneunzig"
},
"unitExceptions": [],
"cardinalExceptions": {
"1": "eins"
},
"alternativeBase": {
"feminine": {
"1": "eine"
}
},
"units" : [
{
"singular": "hundert"
},
{
"singular": "tausend"
},
{
"singular": "Million",
"plural": "Millionen",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Milliarde",
"plural": "Milliarden",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Billion",
"plural": "Billionen",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Billiarde",
"plural": "Billiarden",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Trillion",
"plural": "Trillionen",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Trilliarde",
"plural": "Trilliarden",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Quadrillion",
"plural": "Quadrillionen",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Quadrilliarde",
"plural": "Quadrilliarden",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Quintillion",
"plural": "Quintillionen",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Quintilliarde",
"plural": "Quintilliarden",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Sextillion",
"plural": "Sextillionen",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Sextilliarde",
"plural": "Sextilliarden",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Septillion",
"plural": "Septillionen",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Septilliarde",
"plural": "Septilliarden",
"useAlternativeBase": "feminine",
"spaceException": true
},
{
"singular": "Octillion",
"plural": "Octillionen",
"useAlternativeBase": "feminine",
"spaceException": true
}
]
}
35 changes: 18 additions & 17 deletions lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"useLongScale": false,
"baseSeparator": "-",
"unitSeparator": "and ",
"customSeparator": ",",
"base": {
"0": "zero",
"1": "one",
Expand Down Expand Up @@ -34,22 +35,22 @@
},
"units" : [
"hundred",
"thousand",
"million",
"billion",
"trillion",
"quadrillion",
"quintillion",
"sextillion",
"septillion",
"octillion",
"nonillion",
"decillion",
"undecillion",
"duodecillion",
"tredecillion",
"quattuordecillion",
"quindecillion"
{ "singular": "thousand", "andException": true, "customSeparator": true},
{ "singular": "million", "andException": true, "customSeparator": true},
{ "singular": "billion", "andException": true, "customSeparator": true},
{ "singular": "trillion", "andException": true, "customSeparator": true},
{ "singular": "quadrillion", "andException": true, "customSeparator": true},
{ "singular": "quintillion", "andException": true, "customSeparator": true},
{ "singular": "sextillion", "andException": true, "customSeparator": true},
{ "singular": "septillion", "andException": true, "customSeparator": true},
{ "singular": "octillion", "andException": true, "customSeparator": true},
{ "singular": "nonillion", "andException": true, "customSeparator": true},
{ "singular": "decillion", "andException": true, "customSeparator": true},
{ "singular": "undecillion", "andException": true, "customSeparator": true},
{ "singular": "duodecillion", "andException": true, "customSeparator": true},
{ "singular": "tredecillion", "andException": true, "customSeparator": true},
{ "singular": "quattuordecillion", "andException": true, "customSeparator": true},
{ "singular": "quindecillion", "andException": true, "customSeparator": true}
],
"unitExceptions": []
}
}
Loading