grosser-i18n_data 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +58 -0
- data/Rakefile +80 -0
- data/cache/file_data_provider/countries-AF.txt +246 -0
- data/cache/file_data_provider/countries-AM.txt +246 -0
- data/cache/file_data_provider/countries-AR.txt +246 -0
- data/cache/file_data_provider/countries-AZ.txt +246 -0
- data/cache/file_data_provider/countries-BE.txt +246 -0
- data/cache/file_data_provider/countries-BG.txt +246 -0
- data/cache/file_data_provider/countries-BN.txt +246 -0
- data/cache/file_data_provider/countries-BR.txt +246 -0
- data/cache/file_data_provider/countries-BS.txt +246 -0
- data/cache/file_data_provider/countries-CA.txt +246 -0
- data/cache/file_data_provider/countries-CS.txt +246 -0
- data/cache/file_data_provider/countries-CY.txt +246 -0
- data/cache/file_data_provider/countries-DA.txt +246 -0
- data/cache/file_data_provider/countries-DE.txt +246 -0
- data/cache/file_data_provider/countries-DZ.txt +246 -0
- data/cache/file_data_provider/countries-EL.txt +246 -0
- data/cache/file_data_provider/countries-EN.txt +246 -0
- data/cache/file_data_provider/countries-EO.txt +246 -0
- data/cache/file_data_provider/countries-ES.txt +246 -0
- data/cache/file_data_provider/countries-ET.txt +246 -0
- data/cache/file_data_provider/countries-EU.txt +246 -0
- data/cache/file_data_provider/countries-FA.txt +246 -0
- data/cache/file_data_provider/countries-FI.txt +246 -0
- data/cache/file_data_provider/countries-FO.txt +246 -0
- data/cache/file_data_provider/countries-FR.txt +246 -0
- data/cache/file_data_provider/countries-GA.txt +246 -0
- data/cache/file_data_provider/countries-GL.txt +246 -0
- data/cache/file_data_provider/countries-GU.txt +246 -0
- data/cache/file_data_provider/countries-HE.txt +246 -0
- data/cache/file_data_provider/countries-HI.txt +246 -0
- data/cache/file_data_provider/countries-HR.txt +246 -0
- data/cache/file_data_provider/countries-HU.txt +246 -0
- data/cache/file_data_provider/countries-HY.txt +246 -0
- data/cache/file_data_provider/countries-ID.txt +246 -0
- data/cache/file_data_provider/countries-IS.txt +246 -0
- data/cache/file_data_provider/countries-IT.txt +246 -0
- data/cache/file_data_provider/countries-JA.txt +246 -0
- data/cache/file_data_provider/countries-KA.txt +246 -0
- data/cache/file_data_provider/countries-KK.txt +246 -0
- data/cache/file_data_provider/countries-KM.txt +246 -0
- data/cache/file_data_provider/countries-KN.txt +246 -0
- data/cache/file_data_provider/countries-KO.txt +246 -0
- data/cache/file_data_provider/countries-KU.txt +246 -0
- data/cache/file_data_provider/countries-LT.txt +246 -0
- data/cache/file_data_provider/countries-LV.txt +246 -0
- data/cache/file_data_provider/countries-MI.txt +246 -0
- data/cache/file_data_provider/countries-MK.txt +246 -0
- data/cache/file_data_provider/countries-ML.txt +246 -0
- data/cache/file_data_provider/countries-MN.txt +246 -0
- data/cache/file_data_provider/countries-MR.txt +246 -0
- data/cache/file_data_provider/countries-MS.txt +246 -0
- data/cache/file_data_provider/countries-MT.txt +246 -0
- data/cache/file_data_provider/countries-NB.txt +246 -0
- data/cache/file_data_provider/countries-NE.txt +246 -0
- data/cache/file_data_provider/countries-NL.txt +246 -0
- data/cache/file_data_provider/countries-NN.txt +246 -0
- data/cache/file_data_provider/countries-OC.txt +246 -0
- data/cache/file_data_provider/countries-PA.txt +246 -0
- data/cache/file_data_provider/countries-PL.txt +246 -0
- data/cache/file_data_provider/countries-PS.txt +246 -0
- data/cache/file_data_provider/countries-PT.txt +246 -0
- data/cache/file_data_provider/countries-RO.txt +246 -0
- data/cache/file_data_provider/countries-RU.txt +246 -0
- data/cache/file_data_provider/countries-RW.txt +246 -0
- data/cache/file_data_provider/countries-SK.txt +246 -0
- data/cache/file_data_provider/countries-SL.txt +246 -0
- data/cache/file_data_provider/countries-SO.txt +246 -0
- data/cache/file_data_provider/countries-SQ.txt +246 -0
- data/cache/file_data_provider/countries-SR.txt +246 -0
- data/cache/file_data_provider/countries-SV.txt +246 -0
- data/cache/file_data_provider/countries-SW.txt +246 -0
- data/cache/file_data_provider/countries-TA.txt +246 -0
- data/cache/file_data_provider/countries-TH.txt +246 -0
- data/cache/file_data_provider/countries-TI.txt +246 -0
- data/cache/file_data_provider/countries-TK.txt +246 -0
- data/cache/file_data_provider/countries-TL.txt +246 -0
- data/cache/file_data_provider/countries-TR.txt +246 -0
- data/cache/file_data_provider/countries-TT.txt +246 -0
- data/cache/file_data_provider/countries-UK.txt +246 -0
- data/cache/file_data_provider/countries-VE.txt +246 -0
- data/cache/file_data_provider/countries-VI.txt +246 -0
- data/cache/file_data_provider/countries-WA.txt +246 -0
- data/cache/file_data_provider/countries-WO.txt +246 -0
- data/cache/file_data_provider/countries-XH.txt +246 -0
- data/cache/file_data_provider/countries-ZU.txt +246 -0
- data/cache/file_data_provider/languages-AF.txt +185 -0
- data/cache/file_data_provider/languages-AM.txt +185 -0
- data/cache/file_data_provider/languages-AR.txt +185 -0
- data/cache/file_data_provider/languages-AZ.txt +185 -0
- data/cache/file_data_provider/languages-BE.txt +185 -0
- data/cache/file_data_provider/languages-BG.txt +185 -0
- data/cache/file_data_provider/languages-BR.txt +185 -0
- data/cache/file_data_provider/languages-BS.txt +185 -0
- data/cache/file_data_provider/languages-CA.txt +185 -0
- data/cache/file_data_provider/languages-CS.txt +185 -0
- data/cache/file_data_provider/languages-CY.txt +185 -0
- data/cache/file_data_provider/languages-DA.txt +185 -0
- data/cache/file_data_provider/languages-DE.txt +185 -0
- data/cache/file_data_provider/languages-EL.txt +185 -0
- data/cache/file_data_provider/languages-EN.txt +185 -0
- data/cache/file_data_provider/languages-EO.txt +185 -0
- data/cache/file_data_provider/languages-ES.txt +185 -0
- data/cache/file_data_provider/languages-ET.txt +185 -0
- data/cache/file_data_provider/languages-EU.txt +185 -0
- data/cache/file_data_provider/languages-FA.txt +185 -0
- data/cache/file_data_provider/languages-FI.txt +185 -0
- data/cache/file_data_provider/languages-FR.txt +185 -0
- data/cache/file_data_provider/languages-GA.txt +185 -0
- data/cache/file_data_provider/languages-GL.txt +185 -0
- data/cache/file_data_provider/languages-HE.txt +185 -0
- data/cache/file_data_provider/languages-HI.txt +185 -0
- data/cache/file_data_provider/languages-HR.txt +185 -0
- data/cache/file_data_provider/languages-HU.txt +185 -0
- data/cache/file_data_provider/languages-ID.txt +185 -0
- data/cache/file_data_provider/languages-IS.txt +185 -0
- data/cache/file_data_provider/languages-IT.txt +185 -0
- data/cache/file_data_provider/languages-JA.txt +185 -0
- data/cache/file_data_provider/languages-KO.txt +185 -0
- data/cache/file_data_provider/languages-LT.txt +185 -0
- data/cache/file_data_provider/languages-LV.txt +185 -0
- data/cache/file_data_provider/languages-MI.txt +185 -0
- data/cache/file_data_provider/languages-MK.txt +185 -0
- data/cache/file_data_provider/languages-MN.txt +185 -0
- data/cache/file_data_provider/languages-MR.txt +185 -0
- data/cache/file_data_provider/languages-MS.txt +185 -0
- data/cache/file_data_provider/languages-MT.txt +185 -0
- data/cache/file_data_provider/languages-NB.txt +185 -0
- data/cache/file_data_provider/languages-NL.txt +185 -0
- data/cache/file_data_provider/languages-NN.txt +185 -0
- data/cache/file_data_provider/languages-OC.txt +185 -0
- data/cache/file_data_provider/languages-PL.txt +185 -0
- data/cache/file_data_provider/languages-PS.txt +185 -0
- data/cache/file_data_provider/languages-PT.txt +185 -0
- data/cache/file_data_provider/languages-RO.txt +185 -0
- data/cache/file_data_provider/languages-RU.txt +185 -0
- data/cache/file_data_provider/languages-RW.txt +185 -0
- data/cache/file_data_provider/languages-SK.txt +185 -0
- data/cache/file_data_provider/languages-SL.txt +185 -0
- data/cache/file_data_provider/languages-SR.txt +185 -0
- data/cache/file_data_provider/languages-SV.txt +185 -0
- data/cache/file_data_provider/languages-TA.txt +185 -0
- data/cache/file_data_provider/languages-TH.txt +185 -0
- data/cache/file_data_provider/languages-TI.txt +185 -0
- data/cache/file_data_provider/languages-TR.txt +185 -0
- data/cache/file_data_provider/languages-TT.txt +185 -0
- data/cache/file_data_provider/languages-UK.txt +185 -0
- data/cache/file_data_provider/languages-VE.txt +185 -0
- data/cache/file_data_provider/languages-VI.txt +185 -0
- data/cache/file_data_provider/languages-WA.txt +185 -0
- data/cache/file_data_provider/languages-XH.txt +185 -0
- data/cache/file_data_provider/languages-ZU.txt +185 -0
- data/i18n_data.gemspec +43 -0
- data/lib/i18n_data/file_data_provider.rb +56 -0
- data/lib/i18n_data/live_data_provider.rb +97 -0
- data/lib/i18n_data.rb +30 -0
- data/spec/i18n_data/file_data_provider_spec.rb +23 -0
- data/spec/i18n_data/live_data_provider_spec.rb +40 -0
- data/spec/i18n_data_spec.rb +79 -0
- data/spec/spec_helper.rb +32 -0
- metadata +257 -0
@@ -0,0 +1,185 @@
|
|
1
|
+
SE;;Northern Sami
|
2
|
+
FY;;Isi-Ukraniyani
|
3
|
+
OS;;Isi-Rashiyani
|
4
|
+
GL;;Isi-Galashiyani
|
5
|
+
LU;;Luba-Katanga
|
6
|
+
MI;;Isi-Mawori
|
7
|
+
LV;;Isi-Lavithiyani
|
8
|
+
HA;;Hausa
|
9
|
+
BE;;Isi-Buligariyana
|
10
|
+
GN;;Isi-Buligariyana
|
11
|
+
PI;;Isi-Pholishi
|
12
|
+
UR;;Urdu
|
13
|
+
MK;;Isi-Makhedoniya
|
14
|
+
VE;;Venda
|
15
|
+
AR;;isi-Arabhu
|
16
|
+
SG;;Sango
|
17
|
+
KA;;isi-Jalimani
|
18
|
+
ML;;Malayalam
|
19
|
+
AS;;Assamese
|
20
|
+
EE;;Ewe
|
21
|
+
RU;;Isi-Rashiyani
|
22
|
+
SI;;Isi-Vitheyinamise
|
23
|
+
BG;;Isi-Buligariyana
|
24
|
+
PL;;Isi-Pholishi
|
25
|
+
HE;;Isi-Hebheru
|
26
|
+
NA;;Nauru
|
27
|
+
BH;;Isi-Thayi
|
28
|
+
MN;;Isi-Makhedoniya
|
29
|
+
VI;;Isi-Vitheyinamise
|
30
|
+
RW;;Kinyarwanda
|
31
|
+
NB;;Bokmål, Norwegian; Norwegian Bokmål
|
32
|
+
AV;;isi-Arabhu
|
33
|
+
SK;;Isi-Silovaki
|
34
|
+
BI;;Bislama
|
35
|
+
MO;;Isi-Lavithiyani
|
36
|
+
SL;;Isi-Siloveniyani
|
37
|
+
YI;;Yiddish
|
38
|
+
DV;;Divehi; Dhivehi; Maldivian
|
39
|
+
ND;;Ndebele, North; North Ndebele
|
40
|
+
SM;;Samoan
|
41
|
+
NE;;Nepali
|
42
|
+
AY;;Aymara
|
43
|
+
SN;;Isi-Xhosa
|
44
|
+
KG;;Kongo
|
45
|
+
TA;;Isi-Thamili
|
46
|
+
GU;;Gujarati
|
47
|
+
HI;;Hindi
|
48
|
+
MR;;Isi-Mawori
|
49
|
+
AZ;;Isi-Azerbaijani
|
50
|
+
SO;;Somali
|
51
|
+
BM;;Bambara
|
52
|
+
GV;;Manx
|
53
|
+
CA;;Catalan; Valencian
|
54
|
+
MS;;Malay
|
55
|
+
EL;;Greek, Modern (1453-)
|
56
|
+
NG;;Isi-Bosniyani
|
57
|
+
WA;;Isi-Waloni
|
58
|
+
BN;;Bengali
|
59
|
+
KI;;Kikuyu; Gikuyu
|
60
|
+
UZ;;Uzbek
|
61
|
+
DZ;;Dzongkha
|
62
|
+
MT;;Isi-Malithalise
|
63
|
+
VO;;Volapük
|
64
|
+
JV;;Isi-Jaliphani
|
65
|
+
FA;;Isi-Sebhiyani
|
66
|
+
SQ;;Isi-Azerbaijani
|
67
|
+
BO;;Tibetan
|
68
|
+
KJ;;Kuanyama; Kwanyama
|
69
|
+
EN;;Isi-Ngisi (UK)
|
70
|
+
SR;;Isi-Sebhiyani
|
71
|
+
TE;;Telugu
|
72
|
+
PS;;Pushto; Pashto
|
73
|
+
ZA;;Zhuang; Chuang
|
74
|
+
IA;;Interlingua (International Auxiliary Language Association)
|
75
|
+
EO;;Isi-Esperanto
|
76
|
+
KK;;Kazakh
|
77
|
+
PT;;Isi-Phuthukesi
|
78
|
+
YO;;Yoruba
|
79
|
+
SS;;Swati
|
80
|
+
BR;;Isi-Bretoni
|
81
|
+
KL;;Kalaallisut; Greenlandic
|
82
|
+
TG;;Isi-Thayi
|
83
|
+
CE;;Isi Czechiya
|
84
|
+
NL;;Dutch; Flemish
|
85
|
+
ST;;Sotho, Southern
|
86
|
+
BS;;Isi-Romayinani
|
87
|
+
KM;;Central Khmer
|
88
|
+
TH;;Isi-Thayi
|
89
|
+
LA;;Isi-Lavithiyani
|
90
|
+
HO;;Isi-Thekishi
|
91
|
+
SU;;Sundanese
|
92
|
+
KN;;Kannada
|
93
|
+
TI;;Isi-Thekishi
|
94
|
+
LB;;Luxembourgish; Letzeburgesch
|
95
|
+
MY;;Burmese
|
96
|
+
ID;;Indoneshiya
|
97
|
+
SV;;Isi-Swedishi
|
98
|
+
FF;;Fulah
|
99
|
+
KO;;Isi-Koreyani
|
100
|
+
CH;;Chamorro
|
101
|
+
IE;;Interlingue; Occidental
|
102
|
+
ES;;Spanish; Castilian
|
103
|
+
SW;;Swahili
|
104
|
+
TK;;Turkmen
|
105
|
+
HR;;Isi-Croshiyani
|
106
|
+
ET;;Isi-Estoniyani
|
107
|
+
NN;;Isi-Nowejiyani (Nynorsk)
|
108
|
+
OC;;Occitan (post 1500)
|
109
|
+
TL;;Tagalog
|
110
|
+
ZH;;Isi-Shayina
|
111
|
+
IG;;Igbo
|
112
|
+
EU;;Isi-Basque
|
113
|
+
NO;;Isi-Koreyani
|
114
|
+
FI;;Isi-Finishi
|
115
|
+
HT;;Haitian; Haitian Creole
|
116
|
+
KR;;isi-Kedishi
|
117
|
+
FJ;;Fijian
|
118
|
+
AA;;Afar
|
119
|
+
HU;;Isi-Hangariyani
|
120
|
+
LG;;Ganda
|
121
|
+
KS;;Kashmiri
|
122
|
+
TN;;Tswana
|
123
|
+
NR;;Ndebele, South; South Ndebele
|
124
|
+
AB;;Isi-Azerbaijani
|
125
|
+
II;;Isi-Lithuwaniya
|
126
|
+
DA;;Isi-Danishi
|
127
|
+
TO;;Tonga (Tonga Islands)
|
128
|
+
KU;;isi-Kedishi
|
129
|
+
LI;;Limburgan; Limburger; Limburgish
|
130
|
+
GA;;Isi-Irishi
|
131
|
+
KV;;Komi
|
132
|
+
IK;;Inupiaq
|
133
|
+
CO;;Isi-Bosniyani
|
134
|
+
WO;;Wolof
|
135
|
+
KW;;Isi-Irishi
|
136
|
+
AE;;Avestan
|
137
|
+
HY;;Isi-Romayinani
|
138
|
+
TR;;Isi-Thekishi
|
139
|
+
FO;;Faroese
|
140
|
+
JA;;Isi-Jaliphani
|
141
|
+
NV;;Navajo; Navaho
|
142
|
+
AF;;Isibhunu
|
143
|
+
HZ;;Isi-Hebheru
|
144
|
+
OJ;;Ojibwa
|
145
|
+
TS;;Tsonga
|
146
|
+
CR;;isi-Grike
|
147
|
+
GD;;Gaelic; Scottish Gaelic
|
148
|
+
KY;;Kirghiz; Kyrgyz
|
149
|
+
DE;;isi-Jalimani
|
150
|
+
QU;;Quechua
|
151
|
+
UG;;Uighur; Uyghur
|
152
|
+
CS;;Isi Czechiya
|
153
|
+
IO;;Ido
|
154
|
+
TT;;Tatar
|
155
|
+
LN;;Lingala
|
156
|
+
FR;;Isi-Frentshi
|
157
|
+
NY;;Chichewa; Chewa; Nyanja
|
158
|
+
OM;;Oromo
|
159
|
+
LO;;Lao
|
160
|
+
CU;;Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic
|
161
|
+
PA;;Panjabi; Punjabi
|
162
|
+
XH;;Isi-Xhosa
|
163
|
+
CV;;Chuvash
|
164
|
+
AK;;Isi-Azerbaijani
|
165
|
+
RM;;Isi-Romayinani
|
166
|
+
TW;;Twi
|
167
|
+
UK;;Isi-Ukraniyani
|
168
|
+
IS;;isi-Icilendikhi
|
169
|
+
RN;;Rundi
|
170
|
+
SA;;Sanskrit
|
171
|
+
ZU;;Isi-Zulu
|
172
|
+
IT;;Isi-Taliyane
|
173
|
+
BA;;Bashkir
|
174
|
+
AM;;isi-Arabhu
|
175
|
+
RO;;Isi-Romayinani
|
176
|
+
TY;;Isi-Lavithiyani
|
177
|
+
IU;;Inuktitut
|
178
|
+
MG;;Malagasy
|
179
|
+
AN;;Aragonese
|
180
|
+
SC;;Isi-Makhedoniya
|
181
|
+
CY;;Isi Welsh
|
182
|
+
MH;;Isi-Malithalise
|
183
|
+
LT;;Isi-Lithuwaniya
|
184
|
+
OR;;Oriya
|
185
|
+
SD;;Sindhi
|
data/i18n_data.gemspec
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{i18n_data}
|
5
|
+
s.version = "0.1.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Michael Grosser"]
|
9
|
+
s.date = %q{2009-01-27}
|
10
|
+
s.description = %q{country/language names and 2-letter-code pairs, in 85 languages, for country/language}
|
11
|
+
s.email = %q{grosser.michael@gmail.com}
|
12
|
+
s.extra_rdoc_files = ["lib/i18n_data/file_data_provider.rb", "lib/i18n_data/live_data_provider.rb", "lib/i18n_data.rb", "README.markdown"]
|
13
|
+
s.files = ["Manifest", "lib/i18n_data/file_data_provider.rb", "lib/i18n_data/live_data_provider.rb", "lib/i18n_data.rb", "spec/i18n_data_spec.rb", "spec/i18n_data/file_data_provider_spec.rb", "spec/i18n_data/live_data_provider_spec.rb", "spec/spec_helper.rb", "i18n_data.gemspec", "cache/file_data_provider/languages-TR.txt", "cache/file_data_provider/countries-ZU.txt", "cache/file_data_provider/countries-FA.txt", "cache/file_data_provider/languages-SL.txt", "cache/file_data_provider/countries-MS.txt", "cache/file_data_provider/languages-IS.txt", "cache/file_data_provider/countries-WA.txt", "cache/file_data_provider/languages-ES.txt", "cache/file_data_provider/languages-EO.txt", "cache/file_data_provider/countries-BE.txt", "cache/file_data_provider/countries-EL.txt", "cache/file_data_provider/countries-VE.txt", "cache/file_data_provider/languages-BE.txt", "cache/file_data_provider/languages-VI.txt", "cache/file_data_provider/countries-DE.txt", "cache/file_data_provider/countries-TK.txt", "cache/file_data_provider/languages-EU.txt", "cache/file_data_provider/countries-EU.txt", "cache/file_data_provider/countries-AM.txt", "cache/file_data_provider/countries-PA.txt", "cache/file_data_provider/countries-NN.txt", "cache/file_data_provider/countries-KK.txt", "cache/file_data_provider/countries-SV.txt", "cache/file_data_provider/languages-UK.txt", "cache/file_data_provider/countries-TI.txt", "cache/file_data_provider/countries-HU.txt", "cache/file_data_provider/countries-AR.txt", "cache/file_data_provider/countries-MI.txt", "cache/file_data_provider/countries-HY.txt", "cache/file_data_provider/languages-WA.txt", "cache/file_data_provider/countries-CS.txt", "cache/file_data_provider/countries-NL.txt", "cache/file_data_provider/countries-MT.txt", "cache/file_data_provider/languages-KO.txt", "cache/file_data_provider/languages-NB.txt", "cache/file_data_provider/countries-CY.txt", "cache/file_data_provider/countries-NB.txt", "cache/file_data_provider/countries-MN.txt", "cache/file_data_provider/countries-HR.txt", "cache/file_data_provider/countries-EO.txt", "cache/file_data_provider/countries-PL.txt", "cache/file_data_provider/languages-MT.txt", "cache/file_data_provider/languages-BR.txt", "cache/file_data_provider/countries-VI.txt", "cache/file_data_provider/languages-EN.txt", "cache/file_data_provider/languages-GA.txt", "cache/file_data_provider/countries-TT.txt", "cache/file_data_provider/countries-DA.txt", "cache/file_data_provider/languages-MS.txt", "cache/file_data_provider/countries-HI.txt", "cache/file_data_provider/languages-AZ.txt", "cache/file_data_provider/languages-RW.txt", "cache/file_data_provider/countries-SO.txt", "cache/file_data_provider/languages-GL.txt", "cache/file_data_provider/languages-NN.txt", "cache/file_data_provider/countries-FR.txt", "cache/file_data_provider/countries-ET.txt", "cache/file_data_provider/languages-FR.txt", "cache/file_data_provider/languages-DE.txt", "cache/file_data_provider/languages-BG.txt", "cache/file_data_provider/languages-ZU.txt", "cache/file_data_provider/languages-HR.txt", "cache/file_data_provider/languages-XH.txt", "cache/file_data_provider/languages-HU.txt", "cache/file_data_provider/countries-TR.txt", "cache/file_data_provider/countries-JA.txt", "cache/file_data_provider/languages-PS.txt", "cache/file_data_provider/languages-CY.txt", "cache/file_data_provider/languages-LV.txt", "cache/file_data_provider/countries-LV.txt", "cache/file_data_provider/countries-GL.txt", "cache/file_data_provider/languages-BS.txt", "cache/file_data_provider/languages-OC.txt", "cache/file_data_provider/languages-HI.txt", "cache/file_data_provider/countries-UK.txt", "cache/file_data_provider/countries-OC.txt", "cache/file_data_provider/countries-FO.txt", "cache/file_data_provider/countries-KM.txt", "cache/file_data_provider/languages-MN.txt", "cache/file_data_provider/countries-TL.txt", "cache/file_data_provider/countries-SL.txt", "cache/file_data_provider/countries-XH.txt", "cache/file_data_provider/languages-SV.txt", "cache/file_data_provider/countries-ID.txt", "cache/file_data_provider/languages-LT.txt", "cache/file_data_provider/languages-ID.txt", "cache/file_data_provider/languages-DA.txt", "cache/file_data_provider/languages-RU.txt", "cache/file_data_provider/countries-IT.txt", "cache/file_data_provider/countries-BS.txt", "cache/file_data_provider/countries-AF.txt", "cache/file_data_provider/countries-RO.txt", "cache/file_data_provider/languages-CS.txt", "cache/file_data_provider/countries-DZ.txt", "cache/file_data_provider/languages-MR.txt", "cache/file_data_provider/languages-TI.txt", "cache/file_data_provider/countries-ES.txt", "cache/file_data_provider/countries-ML.txt", "cache/file_data_provider/countries-GA.txt", "cache/file_data_provider/countries-SR.txt", "cache/file_data_provider/countries-GU.txt", "cache/file_data_provider/countries-BR.txt", "cache/file_data_provider/languages-FA.txt", "cache/file_data_provider/countries-WO.txt", "cache/file_data_provider/languages-RO.txt", "cache/file_data_provider/languages-VE.txt", "cache/file_data_provider/countries-KN.txt", "cache/file_data_provider/languages-MI.txt", "cache/file_data_provider/countries-SK.txt", "cache/file_data_provider/countries-SQ.txt", "cache/file_data_provider/languages-PT.txt", "cache/file_data_provider/languages-AM.txt", "cache/file_data_provider/countries-MR.txt", "cache/file_data_provider/countries-LT.txt", "cache/file_data_provider/languages-EL.txt", "cache/file_data_provider/countries-BG.txt", "cache/file_data_provider/countries-SW.txt", "cache/file_data_provider/countries-EN.txt", "cache/file_data_provider/languages-TH.txt", "cache/file_data_provider/countries-BN.txt", "cache/file_data_provider/countries-CA.txt", "cache/file_data_provider/countries-TA.txt", "cache/file_data_provider/languages-TA.txt", "cache/file_data_provider/countries-NE.txt", "cache/file_data_provider/countries-PT.txt", "cache/file_data_provider/countries-IS.txt", "cache/file_data_provider/countries-RU.txt", "cache/file_data_provider/countries-HE.txt", "cache/file_data_provider/languages-TT.txt", "cache/file_data_provider/languages-IT.txt", "cache/file_data_provider/languages-JA.txt", "cache/file_data_provider/languages-PL.txt", "cache/file_data_provider/languages-HE.txt", "cache/file_data_provider/languages-SK.txt", "cache/file_data_provider/countries-PS.txt", "cache/file_data_provider/languages-MK.txt", "cache/file_data_provider/countries-KO.txt", "cache/file_data_provider/countries-FI.txt", "cache/file_data_provider/countries-AZ.txt", "cache/file_data_provider/languages-AR.txt", "cache/file_data_provider/countries-KU.txt", "cache/file_data_provider/countries-KA.txt", "cache/file_data_provider/languages-NL.txt", "cache/file_data_provider/languages-FI.txt", "cache/file_data_provider/countries-MK.txt", "cache/file_data_provider/countries-TH.txt", "cache/file_data_provider/languages-SR.txt", "cache/file_data_provider/languages-CA.txt", "cache/file_data_provider/countries-RW.txt", "cache/file_data_provider/languages-ET.txt", "cache/file_data_provider/languages-AF.txt", "Rakefile", "README.markdown"]
|
14
|
+
s.has_rdoc = true
|
15
|
+
s.homepage = %q{http://github.com/grosser/i18n_data}
|
16
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "I18n_data", "--main", "README.markdown"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.rubyforge_project = %q{i18n_data}
|
19
|
+
s.rubygems_version = %q{1.3.1}
|
20
|
+
s.summary = %q{country/language names and 2-letter-code pairs, in 85 languages, for country/language}
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
+
s.specification_version = 2
|
25
|
+
|
26
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
27
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
28
|
+
s.add_development_dependency(%q<echoe>, [">= 0"])
|
29
|
+
s.add_development_dependency(%q<spec>, [">= 0"])
|
30
|
+
s.add_development_dependency(%q<mocha>, [">= 0"])
|
31
|
+
else
|
32
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
33
|
+
s.add_dependency(%q<echoe>, [">= 0"])
|
34
|
+
s.add_dependency(%q<spec>, [">= 0"])
|
35
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
36
|
+
end
|
37
|
+
else
|
38
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
39
|
+
s.add_dependency(%q<echoe>, [">= 0"])
|
40
|
+
s.add_dependency(%q<spec>, [">= 0"])
|
41
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module I18NData
|
2
|
+
module FileDataProvider
|
3
|
+
DATA_SEPERATOR = ";;"
|
4
|
+
extend self
|
5
|
+
|
6
|
+
def codes(type,language_code)
|
7
|
+
unless data = read_from_file(type,language_code)
|
8
|
+
raise NoTranslationAvailable.new("#{type}-#{language_code}")
|
9
|
+
end
|
10
|
+
data
|
11
|
+
end
|
12
|
+
|
13
|
+
def write_cache(provider)
|
14
|
+
languages = provider.codes(:languages,'EN').keys
|
15
|
+
languages.each{|language_code|
|
16
|
+
[:languages,:countries].each {|type|
|
17
|
+
begin
|
18
|
+
data = provider.send(:codes,type,language_code)
|
19
|
+
write_to_file(data,type,language_code)
|
20
|
+
rescue NoTranslationAvailable
|
21
|
+
end
|
22
|
+
}
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def read_from_file(type,language_code)
|
29
|
+
file = cache_for(type,language_code)
|
30
|
+
return nil unless File.exist?(file)
|
31
|
+
data = {}
|
32
|
+
IO.read(file).split("\n").each{|line|
|
33
|
+
code, translation = line.split(DATA_SEPERATOR)
|
34
|
+
data[code] = translation
|
35
|
+
}
|
36
|
+
data
|
37
|
+
end
|
38
|
+
|
39
|
+
def write_to_file(data,type,language_code)
|
40
|
+
return if data.empty?
|
41
|
+
file = cache_for(type,language_code)
|
42
|
+
FileUtils.mkdir_p(File.dirname(file))
|
43
|
+
File.open(file,'w') do |f|
|
44
|
+
f.puts data.map{|code,translation|"#{code}#{DATA_SEPERATOR}#{translation}"} * "\n"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def cache_for(type,language_code)
|
49
|
+
cache("#{type}-#{language_code}")
|
50
|
+
end
|
51
|
+
|
52
|
+
def cache(file)
|
53
|
+
File.join(File.dirname(__FILE__),'..','..','cache','file_data_provider',"#{file}.txt")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
require 'rexml/document'
|
3
|
+
gem 'activesupport', '> 2.2'
|
4
|
+
require 'activesupport'
|
5
|
+
|
6
|
+
module I18NData
|
7
|
+
# fetches data online from debian svn
|
8
|
+
module LiveDataProvider
|
9
|
+
extend ActiveSupport::Memoizable
|
10
|
+
extend self
|
11
|
+
|
12
|
+
XML_CODES = {
|
13
|
+
:countries => 'http://svn.debian.org/viewsvn/*checkout*/pkg-isocodes/trunk/iso-codes/iso_3166/iso_3166.xml',
|
14
|
+
:languages => 'http://svn.debian.org/viewsvn/*checkout*/pkg-isocodes/trunk/iso-codes/iso_639/iso_639.xml'
|
15
|
+
}
|
16
|
+
TRANSLATIONS = {
|
17
|
+
:languages => 'http://svn.debian.org/viewsvn/*checkout*/pkg-isocodes/trunk/iso-codes/iso_639/',
|
18
|
+
:countries => 'http://svn.debian.org/viewsvn/*checkout*/pkg-isocodes/trunk/iso-codes/iso_3166/'
|
19
|
+
}
|
20
|
+
|
21
|
+
def codes(type,language_code)
|
22
|
+
language_code = language_code.upcase
|
23
|
+
if language_code == 'EN'
|
24
|
+
send("english_#{type}")
|
25
|
+
else
|
26
|
+
translated(type,language_code)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def translate(type,language,to_language_code)
|
33
|
+
translated = translations(type,to_language_code)[language]
|
34
|
+
translated.to_s.empty? ? nil : translated
|
35
|
+
end
|
36
|
+
|
37
|
+
def translated(type,language_code)
|
38
|
+
translations = {}
|
39
|
+
send("english_#{type}").each do |code,name|
|
40
|
+
translation = translate(type,name,language_code)
|
41
|
+
translations[code] = translation ? translation : name
|
42
|
+
end
|
43
|
+
translations
|
44
|
+
end
|
45
|
+
memoize :translated
|
46
|
+
|
47
|
+
def translations(type,language_code)
|
48
|
+
begin
|
49
|
+
data = open(TRANSLATIONS[type]+"#{language_code.downcase}.po").readlines
|
50
|
+
rescue
|
51
|
+
raise NoTranslationAvailable.new("for #{type} and language code = #{language_code}")
|
52
|
+
end
|
53
|
+
|
54
|
+
po_to_hash(data)
|
55
|
+
end
|
56
|
+
memoize :translations
|
57
|
+
|
58
|
+
def english_languages
|
59
|
+
codes = {}
|
60
|
+
xml(:languages).elements.each('*/iso_639_entry') do |entry|
|
61
|
+
name = entry.attributes['name'].to_s.gsub("'","\\'")
|
62
|
+
code = entry.attributes['iso_639_1_code'].to_s.upcase
|
63
|
+
next if code.empty? or name.empty?
|
64
|
+
codes[code]=name
|
65
|
+
end
|
66
|
+
codes
|
67
|
+
end
|
68
|
+
memoize :english_languages
|
69
|
+
|
70
|
+
def english_countries
|
71
|
+
codes = {}
|
72
|
+
xml(:countries).elements.each('*/iso_3166_entry') do |entry|
|
73
|
+
name = entry.attributes['name'].to_s.gsub("'","\\'")
|
74
|
+
code = entry.attributes['alpha_2_code'].to_s.upcase
|
75
|
+
codes[code]=name
|
76
|
+
end
|
77
|
+
codes
|
78
|
+
end
|
79
|
+
memoize :english_countries
|
80
|
+
|
81
|
+
def po_to_hash(data)
|
82
|
+
names = data.select{|l| l =~ /^msgid/}.map{|line| line.match(/^msgid "(.*?)"/)[1]}
|
83
|
+
translations = data.select{|l| l =~ /^msgstr/}.map{|line| line.match(/^msgstr "(.*?)"/)[1]}
|
84
|
+
|
85
|
+
translated = {}
|
86
|
+
names.each_with_index do |name,index|
|
87
|
+
translated[name]=translations[index]
|
88
|
+
end
|
89
|
+
translated
|
90
|
+
end
|
91
|
+
|
92
|
+
def xml(type)
|
93
|
+
xml = open(XML_CODES[type]).read
|
94
|
+
REXML::Document.new(xml)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
data/lib/i18n_data.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
module I18NData
|
2
|
+
extend self
|
3
|
+
|
4
|
+
def languages(language_code='EN')
|
5
|
+
data_provider.codes(:languages,language_code)
|
6
|
+
end
|
7
|
+
|
8
|
+
def countries(language_code='EN')
|
9
|
+
data_provider.codes(:countries,language_code)
|
10
|
+
end
|
11
|
+
|
12
|
+
def data_provider
|
13
|
+
if @data_provider
|
14
|
+
@data_provider
|
15
|
+
else
|
16
|
+
require 'i18n_data/file_data_provider'
|
17
|
+
FileDataProvider
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def data_provider=(provider)
|
22
|
+
@data_provider = provider
|
23
|
+
end
|
24
|
+
|
25
|
+
class NoTranslationAvailable < Exception
|
26
|
+
def to_s
|
27
|
+
"NoTranslationAvailable -- #{super}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__),'..',"spec_helper")
|
2
|
+
require 'i18n_data/file_data_provider'
|
3
|
+
|
4
|
+
describe I18NData::FileDataProvider do
|
5
|
+
before do
|
6
|
+
`rm -f #{I18NData::FileDataProvider.send(:cache_for,"XX","YY")}`
|
7
|
+
end
|
8
|
+
|
9
|
+
def read(x,y)
|
10
|
+
I18NData::FileDataProvider.codes(x,y)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "preserves data when writing and then reading" do
|
14
|
+
data = {"x"=>"y","z"=>"w"}
|
15
|
+
I18NData::FileDataProvider.send(:write_to_file,data,"XX","YY")
|
16
|
+
read("XX","YY").should == data
|
17
|
+
end
|
18
|
+
|
19
|
+
it "does not write empty data sets" do
|
20
|
+
I18NData::FileDataProvider.send(:write_to_file,{},"XX","YY")
|
21
|
+
lambda{read("XX","YY")}.should raise_error I18NData::NoTranslationAvailable
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__),'..',"spec_helper")
|
2
|
+
require 'i18n_data/live_data_provider'
|
3
|
+
|
4
|
+
describe I18NData::LiveDataProvider do
|
5
|
+
describe :po_to_hash do
|
6
|
+
def po_to_hash(text)
|
7
|
+
I18NData::LiveDataProvider.send(:po_to_hash,text)
|
8
|
+
end
|
9
|
+
it "parses po file into translations" do
|
10
|
+
text = <<EOF
|
11
|
+
# come comment msgstr
|
12
|
+
msgid "one"
|
13
|
+
msgstr "1"
|
14
|
+
EOF
|
15
|
+
po_to_hash(text).should == {"one"=>"1"}
|
16
|
+
end
|
17
|
+
it "keeps order of translations" do
|
18
|
+
text = <<EOF
|
19
|
+
msgid "one"
|
20
|
+
msgstr "1"
|
21
|
+
msgid "two"
|
22
|
+
msgstr ""
|
23
|
+
msgid "three"
|
24
|
+
msgstr "3"
|
25
|
+
EOF
|
26
|
+
po_to_hash(text).should == {"one"=>"1","two"=>"","three"=>"3"}
|
27
|
+
end
|
28
|
+
pending_it "finds x-line long translations" do
|
29
|
+
text = <<EOF
|
30
|
+
#. name for chu, cu
|
31
|
+
msgid ""
|
32
|
+
"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church "
|
33
|
+
"Slavonic"
|
34
|
+
msgstr "Kirchenslavisch"
|
35
|
+
EOF
|
36
|
+
long_name = "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"
|
37
|
+
po_to_hash(text)[long_name].should == "Kirchenslavisch"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require File.expand_path("spec_helper", File.dirname(__FILE__))
|
2
|
+
|
3
|
+
NUM_2_LETTER_LANGUAGES = 185
|
4
|
+
NUM_COUNTRIES = 246
|
5
|
+
|
6
|
+
describe I18NData do
|
7
|
+
require "i18n_data/live_data_provider"
|
8
|
+
require "i18n_data/file_data_provider"
|
9
|
+
[I18NData::LiveDataProvider,I18NData::FileDataProvider].each do |provider|
|
10
|
+
describe "using #{provider}" do
|
11
|
+
before :all do
|
12
|
+
I18NData.data_provider = provider
|
13
|
+
end
|
14
|
+
describe :languages do
|
15
|
+
it "raises NoTranslationAvailable for unavailable languages" do
|
16
|
+
lambda{I18NData.languages('XX')}.should raise_error(I18NData::NoTranslationAvailable)
|
17
|
+
end
|
18
|
+
describe :english do
|
19
|
+
it "does not contain blanks" do
|
20
|
+
I18NData.languages.detect {|k,v| k.blank? or v.blank?}.should == nil
|
21
|
+
end
|
22
|
+
it "has english as default" do
|
23
|
+
I18NData.languages['DE'].should == 'German'
|
24
|
+
end
|
25
|
+
it "contains all languages" do
|
26
|
+
I18NData.languages.size.should == NUM_2_LETTER_LANGUAGES
|
27
|
+
end
|
28
|
+
end
|
29
|
+
describe :translated do
|
30
|
+
it "is translated" do
|
31
|
+
I18NData.languages('DE')['DE'].should == 'Deutsch'
|
32
|
+
end
|
33
|
+
it "contains all languages" do
|
34
|
+
I18NData.languages('DE').size.should == NUM_2_LETTER_LANGUAGES
|
35
|
+
end
|
36
|
+
it "has english names for not-translateable languages" do
|
37
|
+
I18NData.languages('IS')['HA'].should == I18NData.languages['HA']
|
38
|
+
end
|
39
|
+
it "does not contain blanks" do
|
40
|
+
I18NData.languages('GL').detect {|k,v| k.blank? or v.blank?}.should == nil
|
41
|
+
end
|
42
|
+
it "is written in unicode" do
|
43
|
+
I18NData.languages('DE')['DA'].should == 'Dänisch'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
describe :countries do
|
48
|
+
describe :english do
|
49
|
+
it "has english as default" do
|
50
|
+
I18NData.countries['DE'].should == 'Germany'
|
51
|
+
end
|
52
|
+
it "does not contain blanks" do
|
53
|
+
I18NData.countries.detect {|k,v| k.blank? or v.blank?}.should == nil
|
54
|
+
end
|
55
|
+
it "contains all countries" do
|
56
|
+
I18NData.countries.size.should == NUM_COUNTRIES
|
57
|
+
end
|
58
|
+
end
|
59
|
+
describe :translated do
|
60
|
+
it "is translated" do
|
61
|
+
I18NData.countries('DE')['DE'].should == 'Deutschland'
|
62
|
+
end
|
63
|
+
it "contains all countries" do
|
64
|
+
I18NData.countries('DE').size.should == NUM_COUNTRIES
|
65
|
+
end
|
66
|
+
it "has english names for not-translateable countries" do
|
67
|
+
I18NData.countries('IS')['PK'].should == I18NData.countries['PK']
|
68
|
+
end
|
69
|
+
it "does not contain blanks" do
|
70
|
+
I18NData.countries('GL').detect {|k,v| k.blank? or v.blank?}.should == nil
|
71
|
+
end
|
72
|
+
it "is written in unicode" do
|
73
|
+
I18NData.countries('DE')['DK'].should == 'Dänemark'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# ---- requirements
|
2
|
+
require 'rubygems'
|
3
|
+
require 'activesupport'
|
4
|
+
require 'spec'
|
5
|
+
require 'mocha'
|
6
|
+
|
7
|
+
$LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))
|
8
|
+
require 'i18n_data'
|
9
|
+
|
10
|
+
# ---- bugfix
|
11
|
+
#`exit?': undefined method `run?' for Test::Unit:Module (NoMethodError)
|
12
|
+
#can be solved with require test/unit but this will result in extra test-output
|
13
|
+
module Test
|
14
|
+
module Unit
|
15
|
+
def self.run?
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
# ---- rspec
|
23
|
+
Spec::Runner.configure do |config|
|
24
|
+
config.mock_with :mocha
|
25
|
+
end
|
26
|
+
|
27
|
+
# ---- Helpers
|
28
|
+
def pending_it(text,&block)
|
29
|
+
it text do
|
30
|
+
pending(&block)
|
31
|
+
end
|
32
|
+
end
|