iso_bsd-i18n 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.gitignore +28 -0
- data/.rspec +1 -0
- data/.travis.yml +1 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +20 -0
- data/README.md +40 -0
- data/Rakefile +41 -0
- data/iso_bsd-i18n.gemspec +31 -0
- data/lib/iso_bsd-i18n.rb +18 -0
- data/lib/iso_bsd-i18n/division.rb +58 -0
- data/lib/iso_bsd-i18n/iso_bsd-i18n_initializer.rb +7 -0
- data/lib/iso_bsd-i18n/rarity.rb +130 -0
- data/lib/iso_bsd-i18n/size.rb +244 -0
- data/lib/iso_bsd-i18n/version.rb +3 -0
- data/locales/en.yml +177 -0
- data/locales/es.yml +177 -0
- data/spec/division_spec.rb +28 -0
- data/spec/iso_bsd-i18n_spec.rb +8 -0
- data/spec/rarity_spec.rb +112 -0
- data/spec/size_spec.rb +54 -0
- data/spec/spec_helper.rb +12 -0
- metadata +138 -0
data/locales/en.yml
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
en:
|
2
|
+
isobsd:
|
3
|
+
wheel: wheel
|
4
|
+
tire: tire
|
5
|
+
messages:
|
6
|
+
:unknown: desconocido
|
7
|
+
:not_applicable: n/a
|
8
|
+
rarity:
|
9
|
+
:rare: rare
|
10
|
+
:common: common
|
11
|
+
:uncommon: uncommmon
|
12
|
+
:sizes:
|
13
|
+
635:
|
14
|
+
:trad:
|
15
|
+
1: 28 x 1 1/2
|
16
|
+
2: 700 B
|
17
|
+
:app: rod-brake roadsters
|
18
|
+
630:
|
19
|
+
:trad: 27 x anything
|
20
|
+
:app: older road bikes
|
21
|
+
622:
|
22
|
+
:trad:
|
23
|
+
1: 700 C
|
24
|
+
2: 28 x (two fractions)
|
25
|
+
3: 29 inch
|
26
|
+
4: 28 x 1 1/2 F.13 Canada
|
27
|
+
:app:
|
28
|
+
1: newer road bikes
|
29
|
+
2: 29er mountain bikes
|
30
|
+
599:
|
31
|
+
:trad:
|
32
|
+
1: 26 x 1.25
|
33
|
+
2: 26 x 1.375
|
34
|
+
:app: Very old U.S. lightweights
|
35
|
+
597:
|
36
|
+
:trad:
|
37
|
+
1: 26 x 1 1/4
|
38
|
+
2: 26 x 1 3/8 (S-6)
|
39
|
+
:app:
|
40
|
+
1: older British sports and club bikes
|
41
|
+
2: Schwinn lightweights
|
42
|
+
590:
|
43
|
+
:trad:
|
44
|
+
1: 26 x 1 3/8 (E.A.3)
|
45
|
+
2: 650 A
|
46
|
+
:app:
|
47
|
+
1: most English 3-speeds
|
48
|
+
2: department-store or juvenile 10 speeds
|
49
|
+
587:
|
50
|
+
:trad: 700 D
|
51
|
+
:app: Oddball size formerly used on some GT models.
|
52
|
+
584:
|
53
|
+
:trad:
|
54
|
+
1: 650 B
|
55
|
+
2: 26 x 1 1/2
|
56
|
+
:app:
|
57
|
+
1: French utility bikes
|
58
|
+
2: tandems and loaded-touring
|
59
|
+
3: some older Raleigh
|
60
|
+
4: Schwinn mountain bikes
|
61
|
+
571:
|
62
|
+
:trad:
|
63
|
+
1: 26 x 1
|
64
|
+
2: 26 x 1 3/4
|
65
|
+
3: 650 C
|
66
|
+
:app:
|
67
|
+
1: triathalon
|
68
|
+
2: time trial
|
69
|
+
3: high performace road bikes for smaller riders
|
70
|
+
559:
|
71
|
+
:trad: 26 x 1.00- x 2.125
|
72
|
+
:app:
|
73
|
+
1: most mountain bikes
|
74
|
+
2: cruisers
|
75
|
+
547:
|
76
|
+
:trad:
|
77
|
+
1: 24 x 1 1/4
|
78
|
+
2: 24 x 1 3/8 (S-5)
|
79
|
+
:app:
|
80
|
+
1: British or Schwinn juvenile
|
81
|
+
2: Schwinn juvenile lightweights
|
82
|
+
540:
|
83
|
+
:trad:
|
84
|
+
1: 24 x 1 1/8
|
85
|
+
2: 24 x 1 3/8 (E.5)
|
86
|
+
3: 600 A
|
87
|
+
:app:
|
88
|
+
1: British juvenile
|
89
|
+
2: most wheelchairs
|
90
|
+
520:
|
91
|
+
:trad:
|
92
|
+
1: 24 x 1
|
93
|
+
2: 24 x 1 1/8
|
94
|
+
:app:
|
95
|
+
1: high performance wheels for smaller riders
|
96
|
+
2: Terry front
|
97
|
+
507:
|
98
|
+
:trad: 24 x 1.5- x 2.125
|
99
|
+
:app:
|
100
|
+
1: juevenile mountain bikes
|
101
|
+
2: cruisers
|
102
|
+
490:
|
103
|
+
:trad: 550 A
|
104
|
+
:app: European Juvenile road bikes
|
105
|
+
457:
|
106
|
+
:trad:
|
107
|
+
1: 22 x 1.75
|
108
|
+
2: 22 x 2.125
|
109
|
+
:app: juvenile
|
110
|
+
451:
|
111
|
+
:trad:
|
112
|
+
1: 20 x 1 1/8
|
113
|
+
2: 20 x 1 1/4
|
114
|
+
3: 20 x 1 3/8
|
115
|
+
:app:
|
116
|
+
1: juevenile lightweights
|
117
|
+
2: BMX for light riders
|
118
|
+
3: some recumbents
|
119
|
+
440:
|
120
|
+
:trad: 500 A
|
121
|
+
:app: European Juvenile, folding
|
122
|
+
419:
|
123
|
+
:trad: 20 x 1 3/4
|
124
|
+
:app: Schwinn juvenile
|
125
|
+
406:
|
126
|
+
:trad: 20 x 1.5- x 2.125
|
127
|
+
:app:
|
128
|
+
0: most BMX
|
129
|
+
1: juevenile
|
130
|
+
2: folders
|
131
|
+
3: trailers
|
132
|
+
4: some recumbents
|
133
|
+
390:
|
134
|
+
:trad: 450 A
|
135
|
+
:app: European Juvenile
|
136
|
+
369:
|
137
|
+
:trad: 17 x 1 1/4
|
138
|
+
:app: Alex Moulton AM series
|
139
|
+
355:
|
140
|
+
:trad: 18 x 1.5- x 2.125
|
141
|
+
:app:
|
142
|
+
1: Birdy folding bikes
|
143
|
+
2: juevenile
|
144
|
+
349:
|
145
|
+
:trad: 16 x 1 3/8
|
146
|
+
:app:
|
147
|
+
1: older Moulton
|
148
|
+
2: Brompton & other folders
|
149
|
+
3: recumbent front
|
150
|
+
4: juvenil
|
151
|
+
340:
|
152
|
+
:trad: 400 A
|
153
|
+
:app: European Juvenile
|
154
|
+
337:
|
155
|
+
:trad: 16 x 1 3/8
|
156
|
+
:app: Polish juvenile
|
157
|
+
317:
|
158
|
+
:trad: 16 x 1 3/4
|
159
|
+
:app: Schwinn juvenile
|
160
|
+
305:
|
161
|
+
:trad: 16 x 1.75- x 2.125
|
162
|
+
:app:
|
163
|
+
1: juevenile
|
164
|
+
2: folders
|
165
|
+
3: trailers
|
166
|
+
4: some recumbents
|
167
|
+
203:
|
168
|
+
:trad: 12 1/2 x anything
|
169
|
+
:app:
|
170
|
+
1: juevenile
|
171
|
+
2: scooters
|
172
|
+
152:
|
173
|
+
:trad: 10 x 2
|
174
|
+
:app: weelchair
|
175
|
+
137:
|
176
|
+
:trad: 8 x 1 1/4
|
177
|
+
:app: wheelchair
|
data/locales/es.yml
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
es:
|
2
|
+
isobsd:
|
3
|
+
wheel: rueda
|
4
|
+
tire: neumático
|
5
|
+
messages:
|
6
|
+
:unknown: desconocido
|
7
|
+
:not_applicable: n/a
|
8
|
+
rarity:
|
9
|
+
:rare: raro
|
10
|
+
:common: común
|
11
|
+
:uncommon: nada frecuente
|
12
|
+
:sizes:
|
13
|
+
635:
|
14
|
+
:trad:
|
15
|
+
1: 28 x 1 1/2
|
16
|
+
2: 700 B
|
17
|
+
:app: frenos de varilla roadsters
|
18
|
+
630:
|
19
|
+
:trad: 27 x todo
|
20
|
+
:app: antiguas bicicletas de carretera
|
21
|
+
622:
|
22
|
+
:trad:
|
23
|
+
1: 700 C
|
24
|
+
2: 28 x (dos fracciones)
|
25
|
+
3: 29 pulgada
|
26
|
+
4: 28 x 1 1/2 F.13 Canadá
|
27
|
+
:app:
|
28
|
+
1: nuevo las bicicletas de carretera
|
29
|
+
2: 29er bicicletas de montaña
|
30
|
+
599:
|
31
|
+
:trad:
|
32
|
+
1: 26 x 1.25
|
33
|
+
2: 26 x 1.375
|
34
|
+
:app: muy viejos pesos ligeros de Estados Unidos
|
35
|
+
597:
|
36
|
+
:trad:
|
37
|
+
1: 26 x 1 1/4
|
38
|
+
2: 26 x 1 3/8 (S-6)
|
39
|
+
:app:
|
40
|
+
1: mayores deportes británicos y motos del Club
|
41
|
+
2: Schwinn pesos ligeros
|
42
|
+
590:
|
43
|
+
:trad:
|
44
|
+
1: 26 x 1 3/8 (E.A.3)
|
45
|
+
2: 650 A
|
46
|
+
:app:
|
47
|
+
1: más inglés de 3 velocidades
|
48
|
+
2: grandes almacenes o menores velocidades de 10
|
49
|
+
587:
|
50
|
+
:trad: 700 D
|
51
|
+
:app: tamaño excéntrico utilizado anteriormente en algunos modelos GT
|
52
|
+
584:
|
53
|
+
:trad:
|
54
|
+
1: 650 B
|
55
|
+
2: 26 x 1 1/2
|
56
|
+
:app:
|
57
|
+
1: motos Francés de servicios públicos
|
58
|
+
2: tándems y cargado de gira
|
59
|
+
3: algunos mayores Raleigh
|
60
|
+
4: Schwinn bicicletas de montaña
|
61
|
+
571:
|
62
|
+
:trad:
|
63
|
+
1: 26 x 1
|
64
|
+
2: 26 x 1 3/4
|
65
|
+
3: 650 C
|
66
|
+
:app:
|
67
|
+
1: triatlón
|
68
|
+
2: tiempo de prueba
|
69
|
+
3: bicicletas de carretera de alto rendimiento para los pequeños jinetes
|
70
|
+
559:
|
71
|
+
:trad: 26 x 1.00- x 2.125
|
72
|
+
:app:
|
73
|
+
1: la mayoría de bicicletas de montaña
|
74
|
+
2: cruceros
|
75
|
+
547:
|
76
|
+
:trad:
|
77
|
+
1: 24 x 1 1/4
|
78
|
+
2: 24 x 1 3/8 (S-5)
|
79
|
+
:app:
|
80
|
+
1: Británico o juvenil Schwinn
|
81
|
+
2: Schwinn menores pesos ligeros
|
82
|
+
540:
|
83
|
+
:trad:
|
84
|
+
1: 24 x 1 1/8
|
85
|
+
2: 24 x 1 3/8 (E.5)
|
86
|
+
3: 600 A
|
87
|
+
:app:
|
88
|
+
1: Británico juvenil
|
89
|
+
2: la mayoría de las sillas de ruedas
|
90
|
+
520:
|
91
|
+
:trad:
|
92
|
+
1: 24 x 1
|
93
|
+
2: 24 x 1 1/8
|
94
|
+
:app:
|
95
|
+
1: high performance wheels for smaller riders
|
96
|
+
2: ruedas de alto rendimiento para los pequeños jinetes
|
97
|
+
507:
|
98
|
+
:trad: 24 x 1.5- x 2.125
|
99
|
+
:app:
|
100
|
+
1: bicicletas de montaña juveniles
|
101
|
+
2: cruceros
|
102
|
+
490:
|
103
|
+
:trad: 550 A
|
104
|
+
:app: bicicletas de carretera Europeos juveniles
|
105
|
+
457:
|
106
|
+
:trad:
|
107
|
+
1: 22 x 1.75
|
108
|
+
2: 22 x 2.125
|
109
|
+
:app: juvenil
|
110
|
+
451:
|
111
|
+
:trad:
|
112
|
+
1: 20 x 1 1/8
|
113
|
+
2: 20 x 1 1/4
|
114
|
+
3: 20 x 1 3/8
|
115
|
+
:app:
|
116
|
+
1: pesos ligeros juveniles
|
117
|
+
2: BMX para los jinetes ligeros
|
118
|
+
3: algunas bicicletas reclinadas
|
119
|
+
440:
|
120
|
+
:trad: 500 A
|
121
|
+
:app: Europeo juvenil, plegable
|
122
|
+
419:
|
123
|
+
:trad: 20 x 1 3/4
|
124
|
+
:app: Schwinn juvenil
|
125
|
+
406:
|
126
|
+
:trad: 20 x 1.5- x 2.125
|
127
|
+
:app:
|
128
|
+
0: mayoría BMX
|
129
|
+
1: juvenil
|
130
|
+
2: plegables
|
131
|
+
3: remolques
|
132
|
+
4: algunas bicicletas reclinadas
|
133
|
+
390:
|
134
|
+
:trad: 450 A
|
135
|
+
:app: Europeo juvenil
|
136
|
+
369:
|
137
|
+
:trad: 17 x 1 1/4
|
138
|
+
:app: Alex Moulton serie AM
|
139
|
+
355:
|
140
|
+
:trad: 18 x 1.5- x 2.125
|
141
|
+
:app:
|
142
|
+
1: Birdy bicicletas plegables
|
143
|
+
2: juvenil
|
144
|
+
349:
|
145
|
+
:trad: 16 x 1 3/8
|
146
|
+
:app:
|
147
|
+
1: más viejo Moulton
|
148
|
+
2: Brompton y otras plegables
|
149
|
+
3: frente reclinada
|
150
|
+
4: juvenil
|
151
|
+
340:
|
152
|
+
:trad: 400 A
|
153
|
+
:app: Europeo juvenil
|
154
|
+
337:
|
155
|
+
:trad: 16 x 1 3/8
|
156
|
+
:app: Polaco juvenil
|
157
|
+
317:
|
158
|
+
:trad: 16 x 1 3/4
|
159
|
+
:app: Schwinn juvenil
|
160
|
+
305:
|
161
|
+
:trad: 16 x 1.75- x 2.125
|
162
|
+
:app:
|
163
|
+
1: juvenil
|
164
|
+
2: plegables
|
165
|
+
3: remolques
|
166
|
+
4: algunas bicicletas reclinadas
|
167
|
+
203:
|
168
|
+
:trad: 12 1/2 x anything
|
169
|
+
:app:
|
170
|
+
1: juvenil
|
171
|
+
2: scooters
|
172
|
+
152:
|
173
|
+
:trad: 10 x 2
|
174
|
+
:app: silla de ruedas
|
175
|
+
137:
|
176
|
+
:trad: 8 x 1 1/4
|
177
|
+
:app: silla de ruedas
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
require 'iso_bsd-i18n'
|
4
|
+
module IsoBsdI18n
|
5
|
+
|
6
|
+
describe Division do
|
7
|
+
|
8
|
+
describe "a customized division" do
|
9
|
+
before(:all) do
|
10
|
+
@list = {:common => [630], :uncommon => [622], :rare => [590]}
|
11
|
+
@division = Division.new(@list)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should have common, uncommon and rare matching custom list" do
|
15
|
+
@division.common.sizes.length.should == @list[:common].length
|
16
|
+
@division.uncommon.sizes.length.should == @list[:uncommon].length
|
17
|
+
@division.rare.sizes.length.should == @list[:rare].length
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "#hash" do
|
21
|
+
it "should produce the original list" do
|
22
|
+
@division.hash.should == @list
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end # describe Division
|
28
|
+
end # module IsoBsdI18n
|
@@ -0,0 +1,8 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
Dir.glob('locales/*.yml').each do |locale_file|
|
4
|
+
describe "a i18n #{locale_file} locale file" do
|
5
|
+
it_behaves_like 'a valid locale file', locale_file
|
6
|
+
it { locale_file.should be_a_subset_of 'locales/en.yml' }
|
7
|
+
end
|
8
|
+
end
|
data/spec/rarity_spec.rb
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
require 'iso_bsd-i18n'
|
4
|
+
module IsoBsdI18n
|
5
|
+
|
6
|
+
describe Rarity do
|
7
|
+
describe "the default division" do
|
8
|
+
after(:each) do
|
9
|
+
Rarity::default_division=nil
|
10
|
+
end
|
11
|
+
it "should not be nil" do
|
12
|
+
Rarity::default_division.should_not be_nil
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should be settable" do
|
16
|
+
h = {:test=>[100]}
|
17
|
+
Rarity::default_division = h
|
18
|
+
d = Division.new(h)
|
19
|
+
Rarity::default_division.should == d
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should be resettable" do
|
23
|
+
h = {:test=>[100]}
|
24
|
+
d = Division.new(h)
|
25
|
+
h_initial = Rarity::default_division
|
26
|
+
Rarity::default_division = h
|
27
|
+
Rarity::default_division = nil
|
28
|
+
Rarity::default_division.should == h_initial
|
29
|
+
end
|
30
|
+
end #describe default_division
|
31
|
+
|
32
|
+
describe "#get" do
|
33
|
+
it "should have a get for each group" do
|
34
|
+
h = Rarity::default_division_raw
|
35
|
+
h.each_key do |k|
|
36
|
+
Rarity::get(k).should_not be_nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end #describe getters
|
40
|
+
end #describe Rarity
|
41
|
+
|
42
|
+
describe Rarity::Value do
|
43
|
+
|
44
|
+
it "should allow for custom division data" do
|
45
|
+
s = Size.all.first
|
46
|
+
my_div_data = {:common => [s.to_i], :uncommon => [], :rare => []}
|
47
|
+
s.rarity(my_div_data).should be_common
|
48
|
+
|
49
|
+
my_div = Division.new({:common => [s.to_i], :uncommon => [], :rare => []})
|
50
|
+
my_div.class.should == Division
|
51
|
+
s.rarity(my_div).should be_common
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "default_division" do
|
57
|
+
before(:each) do
|
58
|
+
@d = Rarity::default_division
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should have common, uncommon and rare" do
|
62
|
+
@d.common.should_not be_nil
|
63
|
+
@d.uncommon.should_not be_nil
|
64
|
+
@d.rare.should_not be_nil
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "common, uncommon and rare" do
|
68
|
+
it "should be the same type" do
|
69
|
+
@d.common.class.should == @d.uncommon.class
|
70
|
+
@d.rare.class.should == @d.common.class
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe "common" do
|
75
|
+
before(:each) do
|
76
|
+
@c = @d.common
|
77
|
+
end
|
78
|
+
it "should be a collection" do
|
79
|
+
@c.class.should == SizeCollection.new.class
|
80
|
+
end
|
81
|
+
|
82
|
+
describe "sizes" do
|
83
|
+
before(:each) do
|
84
|
+
@sizes = @c.sizes
|
85
|
+
end
|
86
|
+
it "should be an array" do
|
87
|
+
@sizes.class.should == [].class
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should have array elements of type Size" do
|
91
|
+
@sizes.first.class.should == Size.new(0).class
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should have rarity that evaluate to be common" do
|
95
|
+
@sizes.first.rarity.should be_common
|
96
|
+
end
|
97
|
+
|
98
|
+
it "should not have rarity that evaluates to rare or uncommon" do
|
99
|
+
@sizes.first.rarity.should_not be_rare
|
100
|
+
@sizes.first.rarity.should_not be_uncommon
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should map to the 'common' label" do
|
104
|
+
str = @sizes.first.rarity.to_s
|
105
|
+
str.should == I18n.translate('isobsd.rarity.common')
|
106
|
+
end
|
107
|
+
end # describe "sizes"
|
108
|
+
end # describe "common"
|
109
|
+
end # describe default_division
|
110
|
+
|
111
|
+
|
112
|
+
end # module IsoBsdI18n
|