Skip to content

Commit

Permalink
Merge branch 'feature/add_swedish_language' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
kslazarev committed Feb 7, 2013
2 parents 5c69e96 + f79312a commit 3ab40b3
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Converti les nombres en lettres en utilisant la librairie I18n.
* Türkçe**
* Italiano**
* Nederlands**
* Swedish**

** Experimental

Expand All @@ -42,6 +43,7 @@ Converti les nombres en lettres en utilisant la librairie I18n.
=> "yirmi bir"
=> "ventiuno"
=> "éénentwintig"
=> "tjugo-en"

231.to_words
=> "two hundred thirty-one"
Expand All @@ -52,6 +54,7 @@ Converti les nombres en lettres en utilisant la librairie I18n.
=> "iki yüz otuz bir"
=> "2 cento trentauno"
=> "tweehonderdéénendertig"
=> "två hundra trettio-en"

4030.to_words
=> "four thousand thirty"
Expand All @@ -62,6 +65,7 @@ Converti les nombres en lettres en utilisant la librairie I18n.
=> "dört bin otuz"
=> "quattro mille trenta"
=> "vierthousanddertig"
=> "fyra tusen trettio"

1000100.to_words
=> "one million one hundred"
Expand All @@ -72,6 +76,7 @@ Converti les nombres en lettres en utilisant la librairie I18n.
=> "bir milyon bir yüz"
=> "uno milione 1 cento"
=> "één miljoen honderd"
=> "en miljoner en hundra"

1000000000000000000000000000000000.to_words
=> "one decillion"
Expand All @@ -82,6 +87,7 @@ Converti les nombres en lettres en utilisant la librairie I18n.
=> "bir desilyon"
=> "uno decillion"
=> "één decillion"
=> "en decillion"

[1, 2, 3].to_words
=> ["one", "two", "three"]
Expand All @@ -98,6 +104,7 @@ Converti les nombres en lettres en utilisant la librairie I18n.
=> ["on bir", "yirmi iki", "bir yüz otuz üç"]
=> ["undici", "ventidue", "1 cento trentatre"]
=> ["elf", "tweeentwintig", "honderddrieendertig"]
=> ["elva", "tjugo-två", "en hundra trettio-tre"]

== Requirements / Требования / Configuration Requise

Expand Down
7 changes: 7 additions & 0 deletions lib/numbers_and_words/i18n/locales/numbers.se.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
se:
numbers:
ones: [noll, en, två, tre, fyra, fem, sex, sju, åtta, nio]
teens: [tio, elva, tolv, tretton, fjorton, femton, sexton, sjutton, arton, nitton]
tens: [noll, tio, tjugo, trettio, fyrtio, femtio, sextio, sjuttio, åttio, nittio]
hundreds: hundra
mega: [ett, tusen, miljoner, miljarder, biljoner, kvadriljon, kvintiljon, sextillion, septillion, octillion, nonillion, decillion]
1 change: 1 addition & 0 deletions lib/numbers_and_words/strategies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
require 'numbers_and_words/strategies/nl'
require 'numbers_and_words/strategies/it'
require 'numbers_and_words/strategies/hu'
require 'numbers_and_words/strategies/se'
8 changes: 8 additions & 0 deletions lib/numbers_and_words/strategies/se.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module NumbersAndWords
module Strategies
class Se < Base
include Families::Latin
include NumbersAndWords::TranslationsHelpers::Se
end
end
end
1 change: 1 addition & 0 deletions lib/numbers_and_words/translations_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
require 'numbers_and_words/translations_helpers/nl'
require 'numbers_and_words/translations_helpers/it'
require 'numbers_and_words/translations_helpers/hu'
require 'numbers_and_words/translations_helpers/se'
12 changes: 12 additions & 0 deletions lib/numbers_and_words/translations_helpers/se.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module NumbersAndWords
module TranslationsHelpers
module Se
include NumbersAndWords::TranslationsHelpers::Base
include NumbersAndWords::TranslationsHelpers::Families::Latin

def translation_tens_with_ones numbers
super numbers, '-'
end
end
end
end
19 changes: 19 additions & 0 deletions spec/numbers_and_words/array/fixture_examples/se.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
to_words:
simple_example:
?
- 1
- 2
- 3
:
- en
- två
- tre
complex_example:
?
- 101
- 21
- 13
:
- en hundra en
- tjugo-en
- tretton
51 changes: 51 additions & 0 deletions spec/numbers_and_words/integer/fixture_examples/se.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
to_words:
ones:
0: noll
1: en
9: nio
teens:
10: tio
11: elva
19: nitton
20: tjugo
21: tjugo-en
80: åttio
90: nittio
99: nittio-nio
hundreds:
100: en hundra
101: en hundra en
111: en hundra elva
120: en hundra tjugo
121: en hundra tjugo-en
900: nio hundra
909: nio hundra nio
919: nio hundra nitton
990: nio hundra nittio
999: nio hundra nittio-nio
thousands:
1000: en tusen
2000: två tusen
4000: fyra tusen
5000: fem tusen
11000: elva tusen
21000: tjugo-en tusen
999000: nio hundra nittio-nio tusen
999999: nio hundra nittio-nio tusen nio hundra nittio-nio
millions:
1000000: en miljoner
2000000: två miljoner
4000000: fyra miljoner
5000000: fem miljoner
999000000: nio hundra nittio-nio miljoner
999000999: nio hundra nittio-nio miljoner nio hundra nittio-nio
999999000: nio hundra nittio-nio miljoner nio hundra nittio-nio tusen
999999999: nio hundra nittio-nio miljoner nio hundra nittio-nio tusen nio hundra nittio-nio
billions:
1174315110: en miljarder en hundra sjuttio-fyra miljoner tre hundra femton tusen en hundra tio
1174315119: en miljarder en hundra sjuttio-fyra miljoner tre hundra femton tusen en hundra nitton
15174315119: femton miljarder en hundra sjuttio-fyra miljoner tre hundra femton tusen en hundra nitton
35174315119: trettio-fem miljarder en hundra sjuttio-fyra miljoner tre hundra femton tusen en hundra nitton
935174315119: nio hundra trettio-fem miljarder en hundra sjuttio-fyra miljoner tre hundra femton tusen en hundra nitton
trillions:
2935174315119: två biljoner kvadriljon nio hundra trettio-fem miljarder en hundra sjuttio-fyra miljoner tre hundra femton tusen en hundra nitton

0 comments on commit 3ab40b3

Please sign in to comment.