m9t 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -0
- data/lib/m9t/version.rb +1 -1
- data/locales/de.yml +68 -0
- data/test/i18n_test.rb +15 -3
- metadata +6 -5
data/README.md
CHANGED
@@ -91,6 +91,12 @@ Alternatives
|
|
91
91
|
- Monkey patches a lot of core classes:
|
92
92
|
- Adds methods to e.g. Object.
|
93
93
|
|
94
|
+
Contributors
|
95
|
+
============
|
96
|
+
|
97
|
+
* [Joe Yates](https://github.com/joeyates)
|
98
|
+
* [Florian Egermann and Mathias Wollin](https://github.com/math)
|
99
|
+
|
94
100
|
License
|
95
101
|
=======
|
96
102
|
|
data/lib/m9t/version.rb
CHANGED
data/locales/de.yml
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# encoding: utf8
|
2
|
+
de:
|
3
|
+
numbers:
|
4
|
+
thousands_separator: '.'
|
5
|
+
decimal_separator: ','
|
6
|
+
units:
|
7
|
+
distance:
|
8
|
+
meters:
|
9
|
+
full:
|
10
|
+
zero: Meter
|
11
|
+
one: Meter
|
12
|
+
other: Meter
|
13
|
+
abbreviated: m
|
14
|
+
kilometers:
|
15
|
+
full:
|
16
|
+
zero: Kilometer
|
17
|
+
one: Kilometer
|
18
|
+
other: Kilometer
|
19
|
+
abbreviated: km
|
20
|
+
miles:
|
21
|
+
full:
|
22
|
+
zero: Meilen
|
23
|
+
one: Meile
|
24
|
+
other: Meilen
|
25
|
+
feet:
|
26
|
+
full:
|
27
|
+
one: Fuß
|
28
|
+
other: Fuß
|
29
|
+
abbreviated: ft
|
30
|
+
direction:
|
31
|
+
degrees:
|
32
|
+
full:
|
33
|
+
zero: Grad
|
34
|
+
one: Grad
|
35
|
+
other: Grad
|
36
|
+
abbreviated: °
|
37
|
+
speed:
|
38
|
+
meters_per_second:
|
39
|
+
full:
|
40
|
+
zero: Meter pro Sekunde
|
41
|
+
one: Meter pro Sekunde
|
42
|
+
other: Meter pro Sekunde
|
43
|
+
abbreviated: m/s
|
44
|
+
kilometers_per_hour:
|
45
|
+
full:
|
46
|
+
one: Kilometer pro Stunde
|
47
|
+
other: Kilometer pro Stunde
|
48
|
+
abbreviated: km/h
|
49
|
+
knots:
|
50
|
+
full:
|
51
|
+
zero: Knoten
|
52
|
+
one: Knoten
|
53
|
+
other: Knoten
|
54
|
+
temperature:
|
55
|
+
degrees:
|
56
|
+
full:
|
57
|
+
zero: Grad
|
58
|
+
one: Grad
|
59
|
+
other: Grad
|
60
|
+
abbreviated: °C
|
61
|
+
kelvin:
|
62
|
+
full:
|
63
|
+
zero: Kelvin
|
64
|
+
one: Kelvin
|
65
|
+
other: Kelvin
|
66
|
+
abbreviated: K
|
67
|
+
direction:
|
68
|
+
sectors: ['N', 'NNO', 'NO', 'ONO', 'O', 'OSO', 'SO', 'SSO', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N']
|
data/test/i18n_test.rb
CHANGED
@@ -3,17 +3,29 @@
|
|
3
3
|
require File.expand_path( 'test_helper', File.dirname( __FILE__ ) )
|
4
4
|
|
5
5
|
class TestI18nMonkeyPatching < Test::Unit::TestCase
|
6
|
-
|
7
6
|
def setup
|
7
|
+
@old_locale = I18n.locale
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
I18n.locale = @old_locale
|
8
12
|
end
|
9
13
|
|
10
|
-
def
|
14
|
+
def test_english_loaded
|
11
15
|
I18n.locale = :en
|
12
16
|
assert_equal('.', I18n.t('numbers.decimal_separator'))
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_italian_loaded
|
13
20
|
I18n.locale = :it
|
14
21
|
assert_equal(',', I18n.t('numbers.decimal_separator'))
|
15
22
|
end
|
16
23
|
|
24
|
+
def test_german_loaded
|
25
|
+
I18n.locale = :de
|
26
|
+
assert_equal('Meile', I18n.t('units.distance.miles.full.one'))
|
27
|
+
end
|
28
|
+
|
17
29
|
def test_localize_float_default
|
18
30
|
assert_equal('1.500000', I18n.localize_float(1.5))
|
19
31
|
end
|
@@ -26,5 +38,5 @@ class TestI18nMonkeyPatching < Test::Unit::TestCase
|
|
26
38
|
I18n.locale = :it
|
27
39
|
assert_equal('1,5', I18n.localize_float(1.5, {:format => '%0.1f'}))
|
28
40
|
end
|
29
|
-
|
30
41
|
end
|
42
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: m9t
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- lib/m9t/speed.rb
|
81
81
|
- lib/m9t/temperature.rb
|
82
82
|
- lib/m9t/version.rb
|
83
|
+
- locales/de.yml
|
83
84
|
- locales/en.yml
|
84
85
|
- locales/it.yml
|
85
86
|
- m9t.gemspec
|
@@ -105,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
106
|
version: '0'
|
106
107
|
segments:
|
107
108
|
- 0
|
108
|
-
hash:
|
109
|
+
hash: 2381801537073680275
|
109
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
111
|
none: false
|
111
112
|
requirements:
|
@@ -114,10 +115,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
115
|
version: '0'
|
115
116
|
segments:
|
116
117
|
- 0
|
117
|
-
hash:
|
118
|
+
hash: 2381801537073680275
|
118
119
|
requirements: []
|
119
120
|
rubyforge_project: nowarning
|
120
|
-
rubygems_version: 1.8.
|
121
|
+
rubygems_version: 1.8.23
|
121
122
|
signing_key:
|
122
123
|
specification_version: 3
|
123
124
|
summary: Measurements and conversions library for Ruby
|