Skip to content

Commit

Permalink
Cleanup (#149)
Browse files Browse the repository at this point in the history
Simplify the translation classes and arrange locales consistently to make it easier for developers to improve current languages or add new ones.
  • Loading branch information
jlduran committed Aug 19, 2017
1 parent cff58d1 commit 5998291
Show file tree
Hide file tree
Showing 62 changed files with 447 additions and 531 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -11,8 +11,8 @@
## 0.11.1 (July 23, 2017)

### Features
* Add support for Spanish floating-point numbers \[[#146](https://github.com/kslazarev/numbers_and_words/pull/146)\]
* Add support for French floating-point numbers \[[#144](https://github.com/kslazarev/numbers_and_words/pull/144)\]
* Add support for Spanish floating-point numbers. \[[#146](https://github.com/kslazarev/numbers_and_words/pull/146)\]
* Add support for French floating-point numbers. \[[#144](https://github.com/kslazarev/numbers_and_words/pull/144)\]

## 0.11.0 (June 26, 2017)

Expand Down
63 changes: 37 additions & 26 deletions lib/numbers_and_words/i18n/locales/numbers.cs.yml
@@ -1,22 +1,13 @@
cs:
numbers:
union: ''
union_separator: ''
integral: celých
ones:
male: [nula, jeden, dva, tři, čtyři, pět, šest, sedm, osm, devět]
female: [nula, jedna, dvě, tři, čtyři, pět, šest, sedm, osm, devět]
neuter: [nula, jedno, dvě, tři, čtyři, pět, šest, sedm, osm, devět]
teens: [deset, jedenáct, dvanáct, třináct, čtrnáct, patnáct, šestnáct, sedmnáct, osmnáct, devatenáct]
teens: [_, jedenáct, dvanáct, třináct, čtrnáct, patnáct, šestnáct, sedmnáct, osmnáct, devatenáct]
tens: [_, deset, dvacet, třicet, čtyřicet, padesát, šedesát, sedmdesát, osmdesát, devadesát]
hundreds: [_, jedno sto, dvě stě, tři sta, čtyři sta, pět set, šest set, sedm set, osm set, devět set]
# gem pouziva se deleni po 10^3, http://www.converter.cz/prevody/velka-cisla.htm
# mega: [ones, thousands, miliony, miliardy, biliony, biliardy, triliony, triliardy, quadriliony, quadriliardy]
micro:
one: [_, desetina, setina, tisícina, milióntina, miliardtina, bilióntina]
few: [_, desetiny, setiny, tisíciny, milióntiny, miliardtiny, bilióntiny]
many: [_, desetin, setin, tisícin, milióntin, miliardtin, bilióntin]
sub_micro: [_, deseti, sto]
mega: [_, thousands, millions, billions, trillions, quadrillions, quintillions, sextillions, septillions, octillions]
thousands:
one: tisíc
few: tisíce
Expand Down Expand Up @@ -53,26 +44,15 @@ cs:
one: kvadriliarda
few: kvadriliardy
many: kvadriliard
mega:
- ones
- thousands
- millions
- billions
- trillions
- quadrillions
- quintillion
- sextillions
- septillions
- octillions
ordinal:
ones:
male: [nultý, první, druhý, třetí, čtvrtý, pátý, šestý, sedmý, osmý, devátý]
female: [nultá, první, druhá, třetí, čtvrtá, pátá, šestá, sedmá, osmá, devátá]
neuter: [nulté, první, druhé, třetí, čtvrté, páté, šesté, sedmé, osmé, deváté]
teens:
male: [desátý, jedenáctý, dvanáctý, třináctý, čtrnáctý, patnáctý, šestnáctý, sedmnáctý, osmnáctý, devatenáctý]
female: [desátá, jedenáctá, dvanáctá, třináctá, čtrnáctá, patnáctá, šestnáctá, sedmnáctá, osmnáctá, devatenáctá]
neuter: [desáté, jedenácté, dvanácté, třinácté, čtrnácté, patnácté, šestnácté, sedmnácté, osmnácté, devatenácté]
male: [_, jedenáctý, dvanáctý, třináctý, čtrnáctý, patnáctý, šestnáctý, sedmnáctý, osmnáctý, devatenáctý]
female: [_, jedenáctá, dvanáctá, třináctá, čtrnáctá, patnáctá, šestnáctá, sedmnáctá, osmnáctá, devatenáctá]
neuter: [_, jedenácté, dvanácté, třinácté, čtrnácté, patnácté, šestnácté, sedmnácté, osmnácté, devatenácté]
tens:
male: [_, desátý, dvacátý, třicátý, čtyřicátý, padesátý, šedesátý, sedmdesátý, osmdesátý, devadesátý]
female: [_, desátá, dvacátá, třicátá, čtyřicátá, padesátá, šedesátá, sedmdesátá, osmdesátá, devadesátá]
Expand All @@ -81,4 +61,35 @@ cs:
male: [_, stý, dvoustý, třístý, čtyřstý, pětistý, šestistý, sedmistý, osmistý, devítistý]
female: [_, stá, dvoustá, třístá, čtyřstá, pětistá, šestistá, sedmistá, osmistá, devítistá]
neuter: [_, sté, dvousté, třísté, čtyřsté, pětisté, šestisté, sedmisté, osmisté, devítisté]

integral: celých
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths]
tenths:
one: desetina
few: desetiny
many: desetin
hundredths:
one: setina
few: setiny
many: setin
thousandths:
one: tisícina
few: tisíciny
many: tisícin
millionths:
one: milióntina
few: milióntiny
many: milióntin
billionths:
one: miliardtina
few: miliardtiny
many: miliardtin
trillionths:
one: bilióntina
few: bilióntiny
many: bilióntin
micro_separator: ''
micro_prefix:
tens: deseti
hundreds: sto
union: ''
union: ''
9 changes: 5 additions & 4 deletions lib/numbers_and_words/i18n/locales/numbers.de.yml
Expand Up @@ -4,10 +4,10 @@ de:
default: ['null', eins, zwei, drei, vier, fünf, sechs, sieben, acht, neun]
combine: ['null', ein, zwei, drei, vier, fünf, sechs, sieben, acht, neun]
gender: ['null', eine, zwei, drei, vier, fünf, sechs, sieben, acht, neun]
teens: [zehn, elf, zwölf, dreizehn, vierzehn, fünfzehn, sechzehn, siebzehn, achtzehn, neunzehn]
tens: [null, zehn, zwanzig, dreißig, vierzig, fünfzig, sechzig, siebzig, achtzig, neunzig]
mega: [ones, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions]
teens: [_, elf, zwölf, dreizehn, vierzehn, fünfzehn, sechzehn, siebzehn, achtzehn, neunzehn]
tens: [_, zehn, zwanzig, dreißig, vierzig, fünfzig, sechzig, siebzig, achtzig, neunzig]
hundreds: hundert
mega: [_, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions]
thousands:
one: tausend
other: tausend
Expand Down Expand Up @@ -40,4 +40,5 @@ de:
other: Quintillionen
decillions:
one: Quintilliarde
other: Quintilliarden
other: Quintilliarden
union: und
32 changes: 24 additions & 8 deletions lib/numbers_and_words/i18n/locales/numbers.en-GB.yml
@@ -1,18 +1,17 @@
en-GB:
numbers:
ones: [zero, one, two, three, four, five, six, seven, eight, nine]
teens: [ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
tens: [zero, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
teens: [_, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
tens: [_, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
hundreds: hundred
mega: [ones, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion]
mega: [_, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, undecillion, duodecillion, tredecillion, quattuordecillion]
ordinal:
ones: [zeroth, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth]
teens: [tenth, eleventh, twelfth, thirteenth, fourteenth, fifteenth, sixteenth, seventeenth, eighteenth, nineteenth]
tens: [zeroth, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
tens: [_, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
hundreds: hundredth
mega: [zeroth, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth]
union_separator: point
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths]
mega: [_, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth, undecillionth, duodecillionth, tredecillionth, quattuordecillionth]
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths, undecillionths, duodecillionths, tredecillionths, quattuordecillionths]
tenths:
one: tenth
other: tenths
Expand Down Expand Up @@ -52,4 +51,21 @@ en-GB:
decillionths:
one: decillionth
other: decillionths
union: and
undecillionths:
one: undecillionth
other: undecillionths
duodecillionths:
one: duodecillionth
other: duodecillionths
tredecillionths:
one: tredecillionth
other: tredecillionths
quattuordecillionths:
one: quattuordecillionth
other: quattuordecillionths
micro_separator: point
micro_prefix:
tens: ten
hundreds: hundred
union: '-'
union: and
16 changes: 10 additions & 6 deletions lib/numbers_and_words/i18n/locales/numbers.en.yml
@@ -1,17 +1,16 @@
en:
numbers:
ones: [zero, one, two, three, four, five, six, seven, eight, nine]
teens: [ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
tens: [zero, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
teens: [_, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
tens: [_, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
hundreds: hundred
mega: [ones, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, undecillion, duodecillion, tredecillion, quattuordecillion]
mega: [_, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, undecillion, duodecillion, tredecillion, quattuordecillion]
ordinal:
ones: [zeroth, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth]
teens: [tenth, eleventh, twelfth, thirteenth, fourteenth, fifteenth, sixteenth, seventeenth, eighteenth, nineteenth]
tens: [zeroth, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
tens: [_, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
hundreds: hundredth
mega: [zeroth, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth, undecillionth, duodecillionth, tredecillionth, quattuordecillionth]
union_separator: and
mega: [_, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth, undecillionth, duodecillionth, tredecillionth, quattuordecillionth]
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths, undecillionths, duodecillionths, tredecillionths, quattuordecillionths]
tenths:
one: tenth
Expand Down Expand Up @@ -64,4 +63,9 @@ en:
quattuordecillionths:
one: quattuordecillionth
other: quattuordecillionths
micro_separator: and
micro_prefix:
tens: ten
hundreds: hundred
union: '-'
union: and
11 changes: 6 additions & 5 deletions lib/numbers_and_words/i18n/locales/numbers.es.yml
Expand Up @@ -44,11 +44,7 @@ es:
one: septillón
other: septillones
quattuordecillions: mil septillones
union: y
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths, undecillionths, duodecillionths, tredecillionths, quattuordecillionths]
micro_prefix:
tens: diez
hundreds: cien
tenths:
one: décima
other: décimas
Expand Down Expand Up @@ -100,4 +96,9 @@ es:
quattuordecillionths:
one: milseptillonésima
other: milseptillonésimas
union_separator: con
micro_separator: con
micro_prefix:
tens: diez
hundreds: cien
union: ''
union: y
8 changes: 4 additions & 4 deletions lib/numbers_and_words/i18n/locales/numbers.et.yml
@@ -1,10 +1,10 @@
et:
numbers:
ones: ["null", üks, kaks, kolm, neli, viis, kuus, seitse, kaheksa, üheksa]
teens: [kümme, üksteist, kaksteist, kolmteist, neliteist, viisteist, kuusteist, seitseteist, kaheksateist, üheksateist]
tens: ["null", kümme, kakskümmend, kolmkümmend, nelikümmend, viiskümmend, kuuskümmend, seitsekümmend, kaheksakümmend, üheksakümmend]
mega: [ones, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions]
ones: ['null', üks, kaks, kolm, neli, viis, kuus, seitse, kaheksa, üheksa]
teens: [_, üksteist, kaksteist, kolmteist, neliteist, viisteist, kuusteist, seitseteist, kaheksateist, üheksateist]
tens: [_, kümme, kakskümmend, kolmkümmend, nelikümmend, viiskümmend, kuuskümmend, seitsekümmend, kaheksakümmend, üheksakümmend]
hundreds: sada
mega: [_, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions]
thousands: tuhat
millions:
one: miljon
Expand Down
86 changes: 45 additions & 41 deletions lib/numbers_and_words/i18n/locales/numbers.fr.yml
@@ -1,12 +1,46 @@
fr:
numbers:
ones: [zéro, un, deux, trois, quatre, cinq, six, sept, huit, neuf]
teens: [dix, onze, douze, treize, quatorze, quinze, seize, dix-sept, dix-huit, dix-neuf]
tens: [zéro, dix, vingt, trente, quarante, cinquante, soixante, soixante-dix, quatre-vingt, quatre-vingt-dix]
mega: [ones, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions]
teens: [_, onze, douze, treize, quatorze, quinze, seize, dix-sept, dix-huit, dix-neuf]
tens: [_, dix, vingt, trente, quarante, cinquante, soixante, soixante-dix, quatre-vingt, quatre-vingt-dix]
eighty: quatre-vingts
union_separator: et
union: et
hundreds:
one: cent
other: cents
mega: [_, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions]
thousands:
one: mille
other: mille
millions:
one: million
other: millions
billions:
one: milliard
other: milliards
trillions:
one: billion
other: billions
quadrillions:
one: billiard
other: billiards
quintillions:
one: trillion
other: trillions
sextillions:
one: trilliard
other: trilliards
septillions:
one: quadrillion
other: quadrillions
octillions:
one: quadrilliard
other: quadrilliards
nonillions:
one: quintillion
other: quintillions
decillions:
one: quintilliard
other: quintilliards
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths, undecillionths, duodecillionths, tredecillionths, quattuordecillionths]
tenths:
one: dixième
Expand Down Expand Up @@ -59,39 +93,9 @@ fr:
quattuordecillionths:
one: septilliardième
other: septilliardièmes
hundreds:
one: cent
other: cents
thousands:
one: mille
other: mille
millions:
one: million
other: millions
billions:
one: milliard
other: milliards
trillions:
one: billion
other: billions
quadrillions:
one: billiard
other: billiards
quintillions:
one: trillion
other: trillions
sextillions:
one: trilliard
other: trilliards
septillions:
one: quadrillion
other: quadrillions
octillions:
one: quadrilliard
other: quadrilliards
nonillions:
one: quintillion
other: quintillions
decillions:
one: quintilliard
other: quintilliards
micro_separator: et
micro_prefix:
tens: dix
hundreds: cent
union: '-'
union: et
18 changes: 11 additions & 7 deletions lib/numbers_and_words/i18n/locales/numbers.hu.yml
@@ -1,16 +1,20 @@
hu:
numbers:
ones: [nulla, egy, kettő, három, négy, öt, hat, hét, nyolc, kilenc]
ones_with_tens: [nulla, egy, kettő, három, négy, öt, hat, hét, nyolc, kilenc]
tens: [nulla, tíz, húsz, harminc, negyven, ötven, hatvan, hetven, nyolcvan, kilencven]
tens_with_ones: [nulla, tizen, huszon, harminc, negyven, ötven, hatvan, hetven, nyolcvan, kilencven]
ones_with_tens: [_, egy, kettő, három, négy, öt, hat, hét, nyolc, kilenc]
tens: [_, tíz, húsz, harminc, negyven, ötven, hatvan, hetven, nyolcvan, kilencven]
tens_with_ones: [_, tizen, huszon, harminc, negyven, ötven, hatvan, hetven, nyolcvan, kilencven]
hundreds: száz
mega: [egy, ezer, millió, milliárd, billió, billiárd, trillió, trilliárd, kvadrillió, kvadrilliárd, kvintillió, kvintilliárd]
union_separator: egész
mega: [_, ezer, millió, milliárd, billió, billiárd, trillió, trilliárd, kvadrillió, kvadrilliárd, kvintillió, kvintilliárd]
ordinal:
ones: [nulladik, első, második, harmadik, negyedik, ötödik, hatodik, hetedik, nyolcadik, kilencedik]
ones_with_tens: [nulladik, egyedik, kettedik, harmadik, negyedik, ötödik, hatodik, hetedik, nyolcadik, kilencedik]
tens: [nulladik, tizedik, huszadik, harmincadik, negyvenedik, ötvenedik, hatvanadik, hetvenedik, nyolcvanadik, kilencvenedik]
tens: [_, tizedik, huszadik, harmincadik, negyvenedik, ötvenedik, hatvanadik, hetvenedik, nyolcvanadik, kilencvenedik]
hundreds: századik
mega: [nulladik, ezredik, milliomodik, milliárdodik, billiomodik, billiárdodik, trilliomodik, trilliárdodik, kvadrilliomodik, kvadrilliárdodik, kvintilliomodik, kvintilliárdodik]
mega: [_, ezredik, milliomodik, milliárdodik, billiomodik, billiárdodik, trilliomodik, trilliárdodik, kvadrilliomodik, kvadrilliárdodik, kvintilliomodik, kvintilliárdodik]
micro: [_, tized, század, ezred, milliomod, milliárdod, billiomod, billiárdod, trilliomod, trilliárdod, kvadrilliomod, kvadrilliárdod, kvintilliomod, kvintilliárdod]
micro_separator: egész
micro_prefix:
tens: tíz
hundreds: száz
union: ''
6 changes: 3 additions & 3 deletions lib/numbers_and_words/i18n/locales/numbers.it.yml
@@ -1,7 +1,7 @@
it:
numbers:
ones: [zero, uno, due, tre, quattro, cinque, sei, sette, otto, nove]
teens: [dieci, undici, dodici, tredici, quattordici, quindici, sedici, diciasette, diciotto, diciannove]
tens: [zero, dieci, venti, trenta, quaranta, cinquanta, sessanta, settanta, ottanta, novanta]
teens: [_, undici, dodici, tredici, quattordici, quindici, sedici, diciasette, diciotto, diciannove]
tens: [_, dieci, venti, trenta, quaranta, cinquanta, sessanta, settanta, ottanta, novanta]
hundreds: cento
mega: [ones, mille, milione, miliardo, triliardo, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion]
mega: [_, mille, milione, miliardo, triliardo, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion]

0 comments on commit 5998291

Please sign in to comment.