exvo_globalize 0.2.1 → 0.3.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.
Files changed (57) hide show
  1. data/app/controllers/globalize_translations_controller.rb +1 -1
  2. data/config/locales/ar.yml +226 -0
  3. data/config/locales/bg.yml +304 -0
  4. data/config/locales/bs.yml +270 -0
  5. data/config/locales/ca.yml +253 -0
  6. data/config/locales/cs.rb +229 -0
  7. data/config/locales/cy.yml +221 -0
  8. data/config/locales/da.yml +235 -0
  9. data/config/locales/de.yml +233 -0
  10. data/config/locales/el.yml +227 -0
  11. data/config/locales/en.yml +222 -0
  12. data/config/locales/eo.yml +222 -0
  13. data/config/locales/es.yml +225 -0
  14. data/config/locales/et.yml +260 -0
  15. data/config/locales/eu.yml +224 -0
  16. data/config/locales/fa.yml +222 -0
  17. data/config/locales/fi.yml +225 -0
  18. data/config/locales/fr.yml +222 -0
  19. data/config/locales/gl.yml +236 -0
  20. data/config/locales/he.yml +227 -0
  21. data/config/locales/hi.yml +221 -0
  22. data/config/locales/hr.yml +159 -0
  23. data/config/locales/hu.yml +215 -0
  24. data/config/locales/id.yml +187 -0
  25. data/config/locales/is.yml +230 -0
  26. data/config/locales/it.yml +235 -0
  27. data/config/locales/ja.yml +228 -0
  28. data/config/locales/kn.yml +222 -0
  29. data/config/locales/ko.yml +228 -0
  30. data/config/locales/lo.yml +244 -0
  31. data/config/locales/lt.yml +184 -0
  32. data/config/locales/lv.yml +221 -0
  33. data/config/locales/mk.yml +158 -0
  34. data/config/locales/mn.yml +199 -0
  35. data/config/locales/nb.yml +220 -0
  36. data/config/locales/nl.yml +226 -0
  37. data/config/locales/nn.yml +139 -0
  38. data/config/locales/pl.yml +234 -0
  39. data/config/locales/pt.yml +230 -0
  40. data/config/locales/rm.yml +177 -0
  41. data/config/locales/ro.yml +211 -0
  42. data/config/locales/ru.yml +376 -0
  43. data/config/locales/sk.yml +236 -0
  44. data/config/locales/sl.yml +233 -0
  45. data/config/locales/sr.yml +159 -0
  46. data/config/locales/sv.yml +273 -0
  47. data/config/locales/sw.yml +222 -0
  48. data/config/locales/th.rb +199 -0
  49. data/config/locales/tr.yml +181 -0
  50. data/config/locales/uk.yml +351 -0
  51. data/config/locales/vi.yml +241 -0
  52. data/config/locales/zh.yml +250 -0
  53. data/lib/exvo_globalize/backend/chain.rb +20 -0
  54. data/lib/exvo_globalize/version.rb +1 -1
  55. data/spec/controllers/globalize_translations_controller_spec.rb +1 -3
  56. data/spec/exvo_globalize/globalize_store_spec.rb +5 -0
  57. metadata +56 -5
@@ -0,0 +1,250 @@
1
+ # Chinese (China) translations for Ruby on Rails
2
+ # by tsechingho (http://github.com/tsechingho)
3
+
4
+ zh:
5
+ date:
6
+ formats:
7
+ default: "%Y-%m-%d"
8
+ short: "%b%d日"
9
+ long: "%Y年%b%d日"
10
+ day_names:
11
+ - 星期日
12
+ - 星期一
13
+ - 星期二
14
+ - 星期三
15
+ - 星期四
16
+ - 星期五
17
+ - 星期六
18
+ abbr_day_names:
19
+ - 日
20
+ - 一
21
+ - 二
22
+ - 三
23
+ - 四
24
+ - 五
25
+ - 六
26
+ month_names:
27
+ - ~
28
+ - 一月
29
+ - 二月
30
+ - 三月
31
+ - 四月
32
+ - 五月
33
+ - 六月
34
+ - 七月
35
+ - 八月
36
+ - 九月
37
+ - 十月
38
+ - 十一月
39
+ - 十二月
40
+ abbr_month_names:
41
+ - ~
42
+ - 1月
43
+ - 2月
44
+ - 3月
45
+ - 4月
46
+ - 5月
47
+ - 6月
48
+ - 7月
49
+ - 8月
50
+ - 9月
51
+ - 10月
52
+ - 11月
53
+ - 12月
54
+ order:
55
+ - :year
56
+ - :month
57
+ - :day
58
+
59
+ time:
60
+ formats:
61
+ default: "%Y年%b%d日 %A %H:%M:%S %Z"
62
+ short: "%b%d日 %H:%M"
63
+ long: "%Y年%b%d日 %H:%M"
64
+ am: "上午"
65
+ pm: "下午"
66
+
67
+ datetime:
68
+ distance_in_words:
69
+ half_a_minute: "半分钟"
70
+ less_than_x_seconds:
71
+ one: "不到一秒"
72
+ other: "不到 %{count} 秒"
73
+ x_seconds:
74
+ one: "一秒"
75
+ other: "%{count} 秒"
76
+ less_than_x_minutes:
77
+ one: "不到一分钟"
78
+ other: "不到 %{count} 分钟"
79
+ x_minutes:
80
+ one: "一分钟"
81
+ other: "%{count} 分钟"
82
+ about_x_hours:
83
+ one: "大约一小时"
84
+ other: "大约 %{count} 小时"
85
+ x_days:
86
+ one: "一天"
87
+ other: "%{count} 天"
88
+ about_x_months:
89
+ one: "大约一个月"
90
+ other: "大约 %{count} 个月"
91
+ x_months:
92
+ one: "一个月"
93
+ other: "%{count} 个月"
94
+ about_x_years:
95
+ one: "大约一年"
96
+ other: "大约 %{count} 年"
97
+ over_x_years:
98
+ one: "一年多"
99
+ other: "%{count} 年多"
100
+ almost_x_years:
101
+ one: "接近一年"
102
+ other: "接近 %{count} 年"
103
+ prompts:
104
+ year: "年"
105
+ month: "月"
106
+ day: "日"
107
+ hour: "时"
108
+ minute: "分"
109
+ second: "秒"
110
+
111
+ number:
112
+ format:
113
+ separator: "."
114
+ delimiter: ","
115
+ precision: 3
116
+ significant: false
117
+ strip_insignificant_zeros: false
118
+ currency:
119
+ format:
120
+ format: "%u %n"
121
+ unit: "CN¥"
122
+ separator: "."
123
+ delimiter: ","
124
+ precision: 2
125
+ significant: false
126
+ strip_insignificant_zeros: false
127
+ percentage:
128
+ format:
129
+ delimiter: ""
130
+ precision:
131
+ format:
132
+ delimiter: ""
133
+ human:
134
+ format:
135
+ delimiter: ""
136
+ precision: 1
137
+ significant: false
138
+ strip_insignificant_zeros: false
139
+ storage_units:
140
+ format: "%n %u"
141
+ units:
142
+ byte:
143
+ one: "Byte"
144
+ other: "Bytes"
145
+ kb: "KB"
146
+ mb: "MB"
147
+ gb: "GB"
148
+ tb: "TB"
149
+ decimal_units:
150
+ format: "%n %u"
151
+ units:
152
+ # 10^-21 zepto, 10^-24 yocto
153
+ atto: "渺" # 10^-18
154
+ femto: "飞" # 10^-15 毫微微
155
+ pico: "漠" # 10^-12 微微
156
+ nano: "奈" # 10^-9 毫微
157
+ micro: "微" # 10^-6
158
+ mili: "毫" # 10^-3 milli
159
+ centi: "厘" # 10^-2
160
+ deci: "分" # 10^-1
161
+ unit: ""
162
+ ten:
163
+ one: "十"
164
+ other: "十" # 10^1
165
+ hundred: "百" # 10^2
166
+ thousand: "千" # 10^3 kilo
167
+ million: "百万" # 10^6 mega
168
+ billion: "十亿" # 10^9 giga
169
+ trillion: "兆" # 10^12 tera
170
+ quadrillion: "千兆" # 10^15 peta
171
+ # 10^18 exa, 10^21 zetta, 10^24 yotta
172
+
173
+ support:
174
+ array:
175
+ words_connector: ", "
176
+ two_words_connector: " 和 "
177
+ last_word_connector: ", 和 "
178
+ select:
179
+ prompt: "请选择"
180
+
181
+ activerecord:
182
+ errors:
183
+ template: # ~ 2.3.5 backward compatible
184
+ header:
185
+ one: "有 1 个错误发生导致「%{model}」无法被保存。"
186
+ other: "有 %{count} 个错误发生导致「%{model}」无法被保存。"
187
+ body: "如下字段出现错误:"
188
+ full_messages:
189
+ format: "%{attribute} %{message}"
190
+ messages:
191
+ inclusion: "不包含于列表中"
192
+ exclusion: "是保留关键字"
193
+ invalid: "是无效的"
194
+ confirmation: "与确认值不匹配"
195
+ accepted: "必须是可被接受的"
196
+ empty: "不能留空"
197
+ blank: "不能为空字符"
198
+ too_long: "过长(最长为 %{count} 个字符)"
199
+ too_short: "过短(最短为 %{count} 个字符)"
200
+ wrong_length: "长度非法(必须为 %{count} 个字符)"
201
+ not_a_number: "不是数字"
202
+ not_an_integer: "必须是整数"
203
+ greater_than: "必须大于 %{count}"
204
+ greater_than_or_equal_to: "必须大于或等于 %{count}"
205
+ equal_to: "必须等于 %{count}"
206
+ less_than: "必须小于 %{count}"
207
+ less_than_or_equal_to: "必须小于或等于 %{count}"
208
+ odd: "必须为单数"
209
+ even: "必须为双数"
210
+ taken: "已经被使用"
211
+ record_invalid: "校验失败: %{errors}"
212
+
213
+ activemodel:
214
+ errors:
215
+ template:
216
+ header:
217
+ one: "有 1 个错误发生导致「%{model}」无法被保存。"
218
+ other: "有 %{count} 个错误发生导致「%{model}」无法被保存。"
219
+ body: "如下字段出现错误:"
220
+
221
+ errors:
222
+ format: "%{attribute} %{message}"
223
+ messages:
224
+ inclusion: "不包含于列表中"
225
+ exclusion: "是保留关键字"
226
+ invalid: "是无效的"
227
+ confirmation: "与确认值不匹配"
228
+ accepted: "必须是可被接受的"
229
+ empty: "不能留空"
230
+ blank: "不能为空字符"
231
+ too_long: "过长(最长为 %{count} 个字符)"
232
+ too_short: "过短(最短为 %{count} 个字符)"
233
+ wrong_length: "长度非法(必须为 %{count} 个字符)"
234
+ not_a_number: "不是数字"
235
+ not_an_integer: "必须是整数"
236
+ greater_than: "必须大于 %{count}"
237
+ greater_than_or_equal_to: "必须大于或等于 %{count}"
238
+ equal_to: "必须等于 %{count}"
239
+ less_than: "必须小于 %{count}"
240
+ less_than_or_equal_to: "必须小于或等于 %{count}"
241
+ odd: "必须为单数"
242
+ even: "必须为双数"
243
+
244
+ helpers:
245
+ select:
246
+ prompt: "请选择"
247
+ submit:
248
+ create: "新增%{model}"
249
+ update: "更新%{model}"
250
+ submit: "储存%{model}"
@@ -10,6 +10,26 @@ module I18n
10
10
  backends.map { |backend| backend.available_translations }.reverse.inject(&:merge)
11
11
  end
12
12
 
13
+ # Return a hash only with Application translations
14
+ def available_app_translations
15
+ # save original load_path
16
+ load_path = I18n.load_path
17
+
18
+ # load only app translations (Simple I18n backend)
19
+ I18n.load_path = Dir.glob(File.join(Rails.root, 'config/locales', '**', '*.{yml,rb}'))
20
+ simple.reload!
21
+ simple.load_translations
22
+ translations = simple.available_translations
23
+
24
+ # restore original translations
25
+ I18n.load_path = load_path
26
+ simple.reload!
27
+ simple.load_translations
28
+
29
+ # return app's translations
30
+ translations
31
+ end
32
+
13
33
  # stores a whole Hash of flattened translations
14
34
  def store_flatten_translations(translations_hash)
15
35
  return false if translations_hash.blank?
@@ -1,3 +1,3 @@
1
1
  module ExvoGlobalize
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -5,13 +5,11 @@ describe GlobalizeTranslationsController do
5
5
 
6
6
  render_views
7
7
  let(:page) { Capybara::Node::Simple.new(@response.body) }
8
- let(:i18n_title) { Factory(:i18n_title) }
9
8
 
10
9
  context "JSON" do
11
10
 
12
11
  describe "GET :show" do
13
12
  let(:translations) do
14
- i18n_title # needed so there is some data in the database before a call to get :show
15
13
  get :show, :format => :json
16
14
  JSON.parse(response.body)
17
15
  end
@@ -25,7 +23,7 @@ describe GlobalizeTranslationsController do
25
23
  end
26
24
 
27
25
  it "returns a JSON with translations" do
28
- i18n_title.value.should eq(translations["en"]["title"])
26
+ translations["en"]["helpers"]["select"]["prompt"].should eq("Please select")
29
27
  end
30
28
  end
31
29
 
@@ -51,4 +51,9 @@ describe ExvoGlobalize do
51
51
  I18n.backend.simple.available_translations[:en][:title].should eq('YAML Title')
52
52
  end
53
53
 
54
+ it "excludes fixtures from app_translations and does so without breaking the I18n.load_path" do
55
+ I18n.backend.available_app_translations[:en].has_key?(:title).should be_false
56
+ I18n.backend.available_translations[:en].has_key?(:title).should be_true
57
+ end
58
+
54
59
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exvo_globalize
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Pawe\xC5\x82 Go\xC5\x9Bcicki"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-17 00:00:00 +02:00
18
+ date: 2011-08-19 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -277,7 +277,58 @@ files:
277
277
  - app/views/globalize_translations/_flash_messages.html.haml
278
278
  - app/views/globalize_translations/show.html.haml
279
279
  - app/views/layouts/exvo_globalize.html.haml
280
+ - config/locales/ar.yml
281
+ - config/locales/bg.yml
282
+ - config/locales/bs.yml
283
+ - config/locales/ca.yml
284
+ - config/locales/cs.rb
285
+ - config/locales/cy.yml
286
+ - config/locales/da.yml
287
+ - config/locales/de.yml
288
+ - config/locales/el.yml
289
+ - config/locales/en.yml
290
+ - config/locales/eo.yml
291
+ - config/locales/es.yml
292
+ - config/locales/et.yml
293
+ - config/locales/eu.yml
294
+ - config/locales/fa.yml
295
+ - config/locales/fi.yml
296
+ - config/locales/fr.yml
297
+ - config/locales/gl.yml
298
+ - config/locales/he.yml
299
+ - config/locales/hi.yml
300
+ - config/locales/hr.yml
301
+ - config/locales/hu.yml
302
+ - config/locales/id.yml
303
+ - config/locales/is.yml
304
+ - config/locales/it.yml
305
+ - config/locales/ja.yml
306
+ - config/locales/kn.yml
307
+ - config/locales/ko.yml
308
+ - config/locales/lo.yml
309
+ - config/locales/lt.yml
310
+ - config/locales/lv.yml
311
+ - config/locales/mk.yml
312
+ - config/locales/mn.yml
313
+ - config/locales/nb.yml
314
+ - config/locales/nl.yml
315
+ - config/locales/nn.yml
316
+ - config/locales/pl.yml
280
317
  - config/locales/plurals.rb
318
+ - config/locales/pt.yml
319
+ - config/locales/rm.yml
320
+ - config/locales/ro.yml
321
+ - config/locales/ru.yml
322
+ - config/locales/sk.yml
323
+ - config/locales/sl.yml
324
+ - config/locales/sr.yml
325
+ - config/locales/sv.yml
326
+ - config/locales/sw.yml
327
+ - config/locales/th.rb
328
+ - config/locales/tr.yml
329
+ - config/locales/uk.yml
330
+ - config/locales/vi.yml
331
+ - config/locales/zh.yml
281
332
  - config/routes.rb
282
333
  - exvo_globalize.gemspec
283
334
  - lib/exvo_globalize.rb