i18n_data 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/cache/file_data_provider/countries-AF.txt +1 -1
- data/cache/file_data_provider/countries-AM.txt +1 -1
- data/cache/file_data_provider/countries-AR.txt +1 -1
- data/cache/file_data_provider/countries-AS.txt +1 -1
- data/cache/file_data_provider/countries-AZ.txt +1 -1
- data/cache/file_data_provider/countries-BE.txt +62 -62
- data/cache/file_data_provider/countries-BG.txt +1 -1
- data/cache/file_data_provider/countries-BN.txt +123 -123
- data/cache/file_data_provider/countries-BN_IN.txt +1 -1
- data/cache/file_data_provider/countries-BR.txt +1 -1
- data/cache/file_data_provider/countries-BS.txt +1 -1
- data/cache/file_data_provider/countries-CA.txt +1 -1
- data/cache/file_data_provider/countries-CS.txt +5 -5
- data/cache/file_data_provider/countries-CY.txt +1 -1
- data/cache/file_data_provider/countries-DA.txt +2 -2
- data/cache/file_data_provider/countries-DE.txt +1 -1
- data/cache/file_data_provider/countries-DZ.txt +1 -1
- data/cache/file_data_provider/countries-EL.txt +2 -2
- data/cache/file_data_provider/countries-EN.txt +1 -1
- data/cache/file_data_provider/countries-EO.txt +1 -1
- data/cache/file_data_provider/countries-ES.txt +4 -4
- data/cache/file_data_provider/countries-ET.txt +2 -2
- data/cache/file_data_provider/countries-EU.txt +2 -2
- data/cache/file_data_provider/countries-FA.txt +1 -1
- data/cache/file_data_provider/countries-FI.txt +1 -1
- data/cache/file_data_provider/countries-FO.txt +1 -1
- data/cache/file_data_provider/countries-FR.txt +1 -1
- data/cache/file_data_provider/countries-GA.txt +3 -3
- data/cache/file_data_provider/countries-GL.txt +1 -1
- data/cache/file_data_provider/countries-GU.txt +1 -1
- data/cache/file_data_provider/countries-HE.txt +1 -1
- data/cache/file_data_provider/countries-HI.txt +10 -10
- data/cache/file_data_provider/countries-HU.txt +1 -1
- data/cache/file_data_provider/countries-HY.txt +75 -75
- data/cache/file_data_provider/countries-IA.txt +249 -0
- data/cache/file_data_provider/countries-ID.txt +1 -1
- data/cache/file_data_provider/countries-IS.txt +6 -6
- data/cache/file_data_provider/countries-IT.txt +1 -1
- data/cache/file_data_provider/countries-JA.txt +1 -1
- data/cache/file_data_provider/countries-KA.txt +1 -1
- data/cache/file_data_provider/countries-KK.txt +1 -1
- data/cache/file_data_provider/countries-KM.txt +1 -1
- data/cache/file_data_provider/countries-KN.txt +1 -1
- data/cache/file_data_provider/countries-KO.txt +1 -1
- data/cache/file_data_provider/countries-KU.txt +1 -1
- data/cache/file_data_provider/countries-LT.txt +1 -1
- data/cache/file_data_provider/countries-LV.txt +1 -1
- data/cache/file_data_provider/countries-MI.txt +169 -169
- data/cache/file_data_provider/countries-MK.txt +1 -1
- data/cache/file_data_provider/countries-ML.txt +1 -1
- data/cache/file_data_provider/countries-MN.txt +1 -1
- data/cache/file_data_provider/countries-MR.txt +1 -1
- data/cache/file_data_provider/countries-MS.txt +1 -1
- data/cache/file_data_provider/countries-MT.txt +1 -1
- data/cache/file_data_provider/countries-NB.txt +2 -2
- data/cache/file_data_provider/countries-NE.txt +1 -1
- data/cache/file_data_provider/countries-NN.txt +7 -7
- data/cache/file_data_provider/countries-OC.txt +1 -1
- data/cache/file_data_provider/countries-OR.txt +1 -1
- data/cache/file_data_provider/countries-PA.txt +1 -1
- data/cache/file_data_provider/countries-PL.txt +1 -1
- data/cache/file_data_provider/countries-PS.txt +1 -1
- data/cache/file_data_provider/countries-PT.txt +1 -1
- data/cache/file_data_provider/countries-PT_BR.txt +8 -8
- data/cache/file_data_provider/countries-RO.txt +1 -1
- data/cache/file_data_provider/countries-RU.txt +1 -1
- data/cache/file_data_provider/countries-RW.txt +1 -1
- data/cache/file_data_provider/countries-SI.txt +1 -1
- data/cache/file_data_provider/countries-SK.txt +1 -1
- data/cache/file_data_provider/countries-SL.txt +1 -1
- data/cache/file_data_provider/countries-SO.txt +1 -1
- data/cache/file_data_provider/countries-SQ.txt +1 -1
- data/cache/file_data_provider/countries-SR.txt +1 -1
- data/cache/file_data_provider/countries-SV.txt +2 -2
- data/cache/file_data_provider/countries-SW.txt +1 -1
- data/cache/file_data_provider/countries-TA.txt +1 -1
- data/cache/file_data_provider/countries-TE.txt +1 -1
- data/cache/file_data_provider/countries-TH.txt +1 -1
- data/cache/file_data_provider/countries-TI.txt +1 -1
- data/cache/file_data_provider/countries-TK.txt +1 -1
- data/cache/file_data_provider/countries-TL.txt +1 -1
- data/cache/file_data_provider/countries-TR.txt +1 -1
- data/cache/file_data_provider/countries-TT.txt +228 -228
- data/cache/file_data_provider/countries-UG.txt +2 -2
- data/cache/file_data_provider/countries-UK.txt +1 -1
- data/cache/file_data_provider/countries-VE.txt +1 -1
- data/cache/file_data_provider/countries-VI.txt +1 -1
- data/cache/file_data_provider/countries-WA.txt +1 -1
- data/cache/file_data_provider/countries-WO.txt +1 -1
- data/cache/file_data_provider/countries-XH.txt +1 -1
- data/cache/file_data_provider/countries-ZH_HK.txt +1 -1
- data/cache/file_data_provider/countries-ZH_TW.txt +1 -1
- data/cache/file_data_provider/countries-ZU.txt +1 -1
- data/cache/file_data_provider/languages-BG.txt +7 -7
- data/cache/file_data_provider/{languages-BN_IN.txt → languages-BN.txt} +0 -0
- data/cache/file_data_provider/languages-DA.txt +184 -184
- data/cache/file_data_provider/languages-DE.txt +1 -1
- data/cache/file_data_provider/languages-HR.txt +4 -4
- data/cache/file_data_provider/languages-PT.txt +20 -20
- data/cache/file_data_provider/languages-TH.txt +12 -12
- data/cache/file_data_provider/languages-TR.txt +10 -10
- data/cache/file_data_provider/languages-TT.txt +150 -150
- data/cache/file_data_provider/languages-VI.txt +1 -1
- data/cache/file_data_provider/languages-ZH_TW.txt +1 -1
- data/lib/i18n_data.rb +7 -2
- data/lib/i18n_data/file_data_provider.rb +23 -2
- data/lib/i18n_data/live_data_provider.rb +25 -4
- data/lib/i18n_data/version.rb +1 -1
- metadata +31 -59
- metadata.gz.sig +0 -0
- data/.gitignore +0 -3
- data/.travis.yml +0 -4
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -28
- data/Rakefile +0 -77
- data/Readme.md +0 -61
- data/example_output/all_names_for_DE.txt +0 -85
- data/example_output/all_names_for_FR.txt +0 -85
- data/example_output/all_names_for_GB.txt +0 -85
- data/example_output/all_names_for_US.txt +0 -85
- data/gem-public_cert.pem +0 -20
- data/i18n_data.gemspec +0 -14
- data/spec/i18n_data/file_data_provider_spec.rb +0 -29
- data/spec/i18n_data/live_data_provider_spec.rb +0 -45
- data/spec/i18n_data_spec.rb +0 -176
- data/spec/spec_helper.rb +0 -2
data/spec/i18n_data_spec.rb
DELETED
@@ -1,176 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require "spec_helper"
|
3
|
-
|
4
|
-
NUM_2_LETTER_LANGUAGES = 185
|
5
|
-
NUM_COUNTRIES = 249
|
6
|
-
|
7
|
-
describe I18nData do
|
8
|
-
require "i18n_data/live_data_provider"
|
9
|
-
require "i18n_data/file_data_provider"
|
10
|
-
|
11
|
-
def blank_keys_or_values(hash)
|
12
|
-
hash.detect{|k,v| k.to_s.empty? or v.to_s.empty?}
|
13
|
-
end
|
14
|
-
|
15
|
-
[I18nData::FileDataProvider, I18nData::LiveDataProvider].each do |provider|
|
16
|
-
describe "using #{provider}" do
|
17
|
-
before :all do
|
18
|
-
I18nData.data_provider = provider
|
19
|
-
end
|
20
|
-
|
21
|
-
describe ".languages" do
|
22
|
-
it "raises NoTranslationAvailable for unavailable languages" do
|
23
|
-
lambda{I18nData.languages('XX')}.should raise_error(I18nData::NoTranslationAvailable)
|
24
|
-
end
|
25
|
-
|
26
|
-
it "is cached" do
|
27
|
-
id = I18nData.languages.object_id
|
28
|
-
I18nData.languages.object_id.should == id
|
29
|
-
I18nData.languages("DE").object_id.should_not == id
|
30
|
-
end
|
31
|
-
|
32
|
-
describe "english" do
|
33
|
-
it "does not contain blanks" do
|
34
|
-
blank_keys_or_values(I18nData.languages).should == nil
|
35
|
-
end
|
36
|
-
|
37
|
-
it "has english as default" do
|
38
|
-
I18nData.languages['DE'].should == 'German'
|
39
|
-
end
|
40
|
-
|
41
|
-
it "contains all languages" do
|
42
|
-
I18nData.languages.size.should == NUM_2_LETTER_LANGUAGES
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe "translated" do
|
47
|
-
it "is translated" do
|
48
|
-
I18nData.languages('DE')['DE'].should == 'Deutsch'
|
49
|
-
end
|
50
|
-
|
51
|
-
it "contains all languages" do
|
52
|
-
I18nData.languages('DE').size.should == NUM_2_LETTER_LANGUAGES
|
53
|
-
end
|
54
|
-
|
55
|
-
it "has english names for not-translateable languages" do
|
56
|
-
I18nData.languages('IS')['HA'].should == I18nData.languages['HA']
|
57
|
-
end
|
58
|
-
|
59
|
-
it "does not contain blanks" do
|
60
|
-
blank_keys_or_values(I18nData.languages('GL')).should == nil
|
61
|
-
end
|
62
|
-
|
63
|
-
it "is written in unicode" do
|
64
|
-
I18nData.languages('DE')['DA'].should == 'Dänisch'
|
65
|
-
end
|
66
|
-
|
67
|
-
it "has default for languages that only have subtypes" do
|
68
|
-
I18nData.languages('ZH')['DA'].should == '丹麦语'
|
69
|
-
end
|
70
|
-
|
71
|
-
it "has language subtypes" do
|
72
|
-
I18nData.languages('zh_TW')['DA'].should == '丹麥語'
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
describe ".countries" do
|
78
|
-
it "is cached" do
|
79
|
-
id = I18nData.countries.object_id
|
80
|
-
I18nData.countries.object_id.should == id
|
81
|
-
I18nData.countries("DE").object_id.should_not == id
|
82
|
-
end
|
83
|
-
|
84
|
-
describe "english" do
|
85
|
-
it "has english as default" do
|
86
|
-
I18nData.countries['DE'].should == 'Germany'
|
87
|
-
end
|
88
|
-
|
89
|
-
it "does not contain blanks" do
|
90
|
-
blank_keys_or_values(I18nData.countries).should == nil
|
91
|
-
end
|
92
|
-
|
93
|
-
it "contains all countries" do
|
94
|
-
I18nData.countries.size.should == NUM_COUNTRIES
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
describe "translated" do
|
99
|
-
it "is translated" do
|
100
|
-
I18nData.countries('DE')['DE'].should == 'Deutschland'
|
101
|
-
end
|
102
|
-
|
103
|
-
it "contains all countries" do
|
104
|
-
I18nData.countries('DE').size.should == NUM_COUNTRIES
|
105
|
-
end
|
106
|
-
|
107
|
-
it "has english names for not-translateable countries" do
|
108
|
-
I18nData.countries('IS')['PK'].should == I18nData.countries['PK']
|
109
|
-
end
|
110
|
-
|
111
|
-
it "does not contain blanks" do
|
112
|
-
blank_keys_or_values(I18nData.countries('GL')).should == nil
|
113
|
-
end
|
114
|
-
|
115
|
-
it "is written in unicode" do
|
116
|
-
I18nData.countries('DE')['DK'].should == 'Dänemark'
|
117
|
-
end
|
118
|
-
|
119
|
-
it "has default for languages that only have subtypes" do
|
120
|
-
I18nData.countries('ZH')['DK'].should == '丹麦'
|
121
|
-
I18nData.countries('BN')['DK'].should == 'ডেনমার্ক'
|
122
|
-
end
|
123
|
-
|
124
|
-
it "has language subtypes" do
|
125
|
-
I18nData.countries('zh_TW')['DK'].should == '丹麥'
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
describe :country_code do
|
133
|
-
before :all do
|
134
|
-
I18nData.data_provider = I18nData::FileDataProvider
|
135
|
-
end
|
136
|
-
|
137
|
-
it "recognises a countries name" do
|
138
|
-
I18nData.country_code('Germany').should == 'DE'
|
139
|
-
end
|
140
|
-
|
141
|
-
it "recognises with blanks" do
|
142
|
-
I18nData.country_code(" Germany \n\r ").should == 'DE'
|
143
|
-
end
|
144
|
-
|
145
|
-
it "returns nil when it cannot recognise" do
|
146
|
-
I18nData.country_code('XY').should == nil
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
describe :language_code do
|
151
|
-
before :all do
|
152
|
-
I18nData.data_provider = I18nData::FileDataProvider
|
153
|
-
end
|
154
|
-
|
155
|
-
it "recognises a countries name" do
|
156
|
-
I18nData.language_code('Deutsch').should == 'DE'
|
157
|
-
end
|
158
|
-
|
159
|
-
it "recognizes languages that are ; seperated" do
|
160
|
-
I18nData.language_code('Dutch').should == 'NL'
|
161
|
-
I18nData.language_code('Flemish').should == 'NL'
|
162
|
-
end
|
163
|
-
|
164
|
-
it "recognises with blanks" do
|
165
|
-
I18nData.language_code(" Deutsch \n\r ").should == 'DE'
|
166
|
-
end
|
167
|
-
|
168
|
-
it "returns nil when it cannot recognise" do
|
169
|
-
I18nData.language_code('XY').should == nil
|
170
|
-
end
|
171
|
-
end
|
172
|
-
|
173
|
-
it "has a VERSION" do
|
174
|
-
I18nData::VERSION.should =~ /^\d+\.\d+\.\d+$/
|
175
|
-
end
|
176
|
-
end
|
data/spec/spec_helper.rb
DELETED