-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from jlduran/refactor-spanish
Refactor Spanish
- Loading branch information
Showing
22 changed files
with
432 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,103 @@ | ||
es: | ||
numbers: | ||
one: un | ||
ones: [cero, uno, dos, tres, cuatro, cinco, seis, siete, ocho, nueve] | ||
one_twenties: ún | ||
ones_twenties: [_, uno, dós, trés, cuatro, cinco, séis, siete, ocho, nueve] | ||
teens: [diez, once, doce, trece, catorce, quince, dieciséis, diecisiete, dieciocho, diecinueve] | ||
tens: [_, diez, veinti, treinta, cuarenta, cincuenta, sesenta, setenta, ochenta, noventa] | ||
twenty: veinte | ||
hundreds: [ciento, doscientos, trescientos, cuatrocientos, quinientos, seiscientos, setecientos, ochocientos, novecientos] | ||
one_hundred: cien | ||
mega: [_, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, undecillion, duodecillion, tredecillion, quattuordecillion] | ||
thousand: mil | ||
million: | ||
ones: | ||
apocopated: un | ||
male: [cero, uno, dos, tres, cuatro, cinco, seis, siete, ocho, nueve] | ||
female: [cero, una, dos, tres, cuatro, cinco, seis, siete, ocho, nueve] | ||
teens: [_, once, doce, trece, catorce, quince, dieciséis, diecisiete, dieciocho, diecinueve] | ||
tens: [_, diez, veinte, treinta, cuarenta, cincuenta, sesenta, setenta, ochenta, noventa] | ||
twenties: | ||
apocopated: veintiún | ||
male: [_, veintiuno, veintidós, veintitrés, veinticuatro, veinticinco, veintiséis, veintisiete, veintiocho, veintinueve] | ||
female: [_, veintiuna, veintidós, veintitrés, veinticuatro, veinticinco, veintiséis, veintisiete, veintiocho, veintinueve] | ||
hundreds: | ||
apocopated: cien | ||
male: [_, ciento, doscientos, trescientos, cuatrocientos, quinientos, seiscientos, setecientos, ochocientos, novecientos] | ||
female: [_, ciento, doscientas, trescientas, cuatrocientas, quinientas, seiscientas, setecientas, ochocientas, novecientas] | ||
mega: [_, thousands, millions, billions, trillions, quadrillions, quintillions, sextillions, septillions, octillions, nonillions, decillions, undecillions, duodecillions, tredecillions, quattuordecillions] | ||
thousands: mil | ||
millions: | ||
one: millón | ||
other: millones | ||
billion: mil millones | ||
trillion: | ||
billions: mil millones | ||
trillions: | ||
one: billón | ||
other: billones | ||
quadrillion: mil billones | ||
quintillion: | ||
quadrillions: mil billones | ||
quintillions: | ||
one: trillón | ||
other: trillones | ||
sextillion: mil trillones | ||
septillion: | ||
sextillions: mil trillones | ||
septillions: | ||
one: cuatrillón | ||
other: cuatrillones | ||
octillion: mil cuatrillones | ||
nonillion: | ||
octillions: mil cuatrillones | ||
nonillions: | ||
one: quintillón | ||
other: quintillones | ||
decillion: mil quintillones | ||
undecillion: | ||
decillions: mil quintillones | ||
undecillions: | ||
one: sextillón | ||
other: sextillones | ||
duodecillion: mil sextillones | ||
tredecillion: | ||
duodecillions: mil sextillones | ||
tredecillions: | ||
one: septillón | ||
other: septillones | ||
quattuordecillion: mil septillones | ||
quattuordecillions: mil septillones | ||
union_separator: con | ||
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 | ||
hundredths: | ||
one: centésima | ||
other: centésimas | ||
thousandths: | ||
one: milésima | ||
other: milésimas | ||
millionths: | ||
one: millonésima | ||
other: millonésimas | ||
billionths: | ||
one: milmillonésima | ||
other: milmillonésimas | ||
trillionths: | ||
one: billonésima | ||
other: billonésimas | ||
quadrillionths: | ||
one: milbillonésima | ||
other: milbillonésimas | ||
quintillionths: | ||
one: trillonésima | ||
other: trillonésimas | ||
sextillionths: | ||
one: miltrillonésima | ||
other: miltrillonésimas | ||
septillionths: | ||
one: cuatrillonésima | ||
other: cuatrillonésimas | ||
octillionths: | ||
one: milcuatrillonésima | ||
other: milcuatrillonésimas | ||
nonillionths: | ||
one: quintillonésima | ||
other: quintillonésimas | ||
decillionths: | ||
one: milquintillonésima | ||
other: milquintillonésimas | ||
undecillionths: | ||
one: sextillonésima | ||
other: sextillonésimas | ||
duodecillionths: | ||
one: milsextillonésima | ||
other: milsextillonésimas | ||
tredecillionths: | ||
one: septillonésima | ||
other: septillonésimas | ||
quattuordecillionths: | ||
one: milseptillonésima | ||
other: milseptillonésimas | ||
union: y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
lib/numbers_and_words/strategies/array_joiner/languages/es.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module NumbersAndWords | ||
module Strategies | ||
module ArrayJoiner | ||
module Languages | ||
class Es < Base | ||
end | ||
end | ||
end | ||
end | ||
end |
1 change: 1 addition & 0 deletions
1
lib/numbers_and_words/strategies/figures_converter/decorators.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
lib/numbers_and_words/strategies/figures_converter/decorators/es.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require 'numbers_and_words/strategies/figures_converter/decorators/es/base' | ||
require 'numbers_and_words/strategies/figures_converter/decorators/es/fractional' | ||
require 'numbers_and_words/strategies/figures_converter/decorators/es/integral' |
12 changes: 12 additions & 0 deletions
12
lib/numbers_and_words/strategies/figures_converter/decorators/es/base.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module NumbersAndWords | ||
module Strategies | ||
module FiguresConverter | ||
module Decorators | ||
module Es | ||
class Base < Decorators::Base | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
38 changes: 38 additions & 0 deletions
38
lib/numbers_and_words/strategies/figures_converter/decorators/es/fractional.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module NumbersAndWords | ||
module Strategies | ||
module FiguresConverter | ||
module Decorators | ||
module Es | ||
class Fractional < Base | ||
def run | ||
@options[:gender] = :female | ||
"#{super} #{fraction_significance}" | ||
end | ||
|
||
private | ||
|
||
def fraction_significance | ||
@strategy.translations.micros full_fraction.fraction_capacity, figures.join.to_i | ||
end | ||
|
||
def full_fraction | ||
(0..zero_length).inject(figures.clone) { |result, _el| result.unshift 0 }.to_figures | ||
end | ||
|
||
def figures | ||
@strategy.figures | ||
end | ||
|
||
def zero_length | ||
fraction_length - figures.length | ||
end | ||
|
||
def fraction_length | ||
@options[:fractional][:length].to_i | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
12 changes: 12 additions & 0 deletions
12
lib/numbers_and_words/strategies/figures_converter/decorators/es/integral.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module NumbersAndWords | ||
module Strategies | ||
module FiguresConverter | ||
module Decorators | ||
module Es | ||
class Integral < Base | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
lib/numbers_and_words/strategies/figures_converter/options.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
lib/numbers_and_words/strategies/figures_converter/options/es.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require 'numbers_and_words/strategies/figures_converter/options/es/apocopated' | ||
require 'numbers_and_words/strategies/figures_converter/options/es/gender' | ||
require 'numbers_and_words/strategies/figures_converter/options/es/remove_zero' |
Oops, something went wrong.