rails-asset-localization 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/app/assets/javascripts/i18n/translations.coffee.erb +2 -0
- data/app/controllers/rails_asset_localization/locales_controller.rb +2 -1
- data/config/initializers/sprockets.rb +7 -0
- data/config/routes.rb +3 -3
- data/lib/rails_asset_localization/locales_exporter.rb +3 -0
- data/lib/rails_asset_localization/version.rb +1 -1
- data/test/dummy/config/application.rb +0 -1
- data/test/dummy/config/locales/de.yml +2 -0
- data/test/dummy/config/locales/en.yml +1 -4
- data/test/dummy/config/routes.rb +1 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/log/test.log +323 -0
- data/test/locales_controller_test.rb +19 -0
- data/test/rails-localization-engine_test.rb +2 -2
- metadata +36 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba52b55a831d891d709aa9238c0d322868deeb17
|
4
|
+
data.tar.gz: e520fdf6b7137c872e8e4534875e0134e941e8ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c14e62612a36a7bc0d678a4cbbe72c31f564dfeca11fd65c2dbcab2bbab1741f886c24fd105bf3b90fed487f6ea3f16b306b6719e7d80b28ac4002dec8ecd692
|
7
|
+
data.tar.gz: 8174d231aaefe0e6a7562b7f5b7b6b8cab827a5307b1035a2afe840bb790e6c5dbd7cbe5df51bc26b23b4d890bf88ea0e1b46fb72b6d44e4db3292f3a0537781
|
data/README.md
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
# RailsAssetLocalization
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rails-asset-localization.png)](http://badge.fury.io/rb/rails-asset-localization)
|
4
|
+
|
3
5
|
A Rails Engine that allows you to use i18next with the asset pipeline. Locales are served dynamically to allow easy integration with services like [CopyCopter][1].
|
4
6
|
|
5
7
|
## Basic Setup
|
6
8
|
|
7
9
|
Add this to your `Gemfile`:
|
8
10
|
|
9
|
-
|
11
|
+
``` ruby
|
12
|
+
gem 'rails-asset-localization', git: 'git@github.com:nicolai86/rails-asset-localization.git', branch: :master
|
13
|
+
```
|
14
|
+
|
15
|
+
and this to your `routes`:
|
16
|
+
|
17
|
+
``` ruby
|
18
|
+
mount RailsAssetLocalization::Engine => "/locales"
|
19
|
+
```
|
10
20
|
|
11
21
|
Your locales are now available under `/locales/:locale`
|
12
22
|
|
@@ -7,7 +7,8 @@ module RailsAssetLocalization
|
|
7
7
|
locale = $1 if locale =~ /(\w+)\-(\w+)/
|
8
8
|
|
9
9
|
locales_exporter = ::RailsAssetLocalization::LocalesExporter.new
|
10
|
-
|
10
|
+
locales = (locales_exporter.translations[locale.to_sym] || {})
|
11
|
+
respond_with locales
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
data/config/routes.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
match '
|
3
|
-
end
|
1
|
+
RailsAssetLocalization::Engine.routes.draw do
|
2
|
+
match '/:locale', to: 'rails_asset_localization/locales#locale', via: :get, as: :locales
|
3
|
+
end
|
data/test/dummy/config/routes.rb
CHANGED
File without changes
|
File without changes
|
@@ -0,0 +1,323 @@
|
|
1
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2
|
+
---------------------------------------
|
3
|
+
RailsLocalizationEngineTest: test_truth
|
4
|
+
---------------------------------------
|
5
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
6
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
7
|
+
---------------------------------------
|
8
|
+
RailsLocalizationEngineTest: test_truth
|
9
|
+
---------------------------------------
|
10
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
11
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
12
|
+
---------------------------------------------------
|
13
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
14
|
+
---------------------------------------------------
|
15
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
16
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
17
|
+
---------------------------------------------------
|
18
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
19
|
+
---------------------------------------------------
|
20
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
21
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
22
|
+
------------------------------------------------------------
|
23
|
+
RailsLocalizationEngineTest: test_returns_assets_via_request
|
24
|
+
------------------------------------------------------------
|
25
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
26
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
27
|
+
------------------------------------------------------
|
28
|
+
LocalesControllerTest: test_returns_assets_via_request
|
29
|
+
------------------------------------------------------
|
30
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
31
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
32
|
+
---------------------------------------------------
|
33
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
34
|
+
---------------------------------------------------
|
35
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
36
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
37
|
+
------------------------------------------------------
|
38
|
+
LocalesControllerTest: test_returns_assets_via_request
|
39
|
+
------------------------------------------------------
|
40
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
41
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
42
|
+
---------------------------------------------------
|
43
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
44
|
+
---------------------------------------------------
|
45
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
46
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
47
|
+
------------------------------------------------------
|
48
|
+
LocalesControllerTest: test_returns_assets_via_request
|
49
|
+
------------------------------------------------------
|
50
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
51
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
52
|
+
---------------------------------------------------
|
53
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
54
|
+
---------------------------------------------------
|
55
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
56
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
57
|
+
------------------------------------------------------
|
58
|
+
LocalesControllerTest: test_returns_assets_via_request
|
59
|
+
------------------------------------------------------
|
60
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
61
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
62
|
+
---------------------------------------------------
|
63
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
64
|
+
---------------------------------------------------
|
65
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
66
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
67
|
+
------------------------------------------------------
|
68
|
+
LocalesControllerTest: test_returns_assets_via_request
|
69
|
+
------------------------------------------------------
|
70
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
71
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
72
|
+
---------------------------------------------------
|
73
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
74
|
+
---------------------------------------------------
|
75
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
76
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
77
|
+
------------------------------------------------------
|
78
|
+
LocalesControllerTest: test_returns_assets_via_request
|
79
|
+
------------------------------------------------------
|
80
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
81
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
82
|
+
---------------------------------------------------
|
83
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
84
|
+
---------------------------------------------------
|
85
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
86
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
87
|
+
------------------------------------------------------
|
88
|
+
LocalesControllerTest: test_returns_assets_via_request
|
89
|
+
------------------------------------------------------
|
90
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
91
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
92
|
+
---------------------------------------------------
|
93
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
94
|
+
---------------------------------------------------
|
95
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
96
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
97
|
+
------------------------------------------------------
|
98
|
+
LocalesControllerTest: test_returns_assets_via_request
|
99
|
+
------------------------------------------------------
|
100
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
101
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
102
|
+
---------------------------------------------------
|
103
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
104
|
+
---------------------------------------------------
|
105
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
106
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
107
|
+
------------------------------------------------------
|
108
|
+
LocalesControllerTest: test_returns_assets_via_request
|
109
|
+
------------------------------------------------------
|
110
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
111
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
112
|
+
---------------------------------------------------
|
113
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
114
|
+
---------------------------------------------------
|
115
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
116
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
117
|
+
------------------------------------------------------
|
118
|
+
LocalesControllerTest: test_returns_assets_via_request
|
119
|
+
------------------------------------------------------
|
120
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
121
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
122
|
+
---------------------------------------------------
|
123
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
124
|
+
---------------------------------------------------
|
125
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
126
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
127
|
+
------------------------------------------------------
|
128
|
+
LocalesControllerTest: test_returns_assets_via_request
|
129
|
+
------------------------------------------------------
|
130
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:20:13 +0100
|
131
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
132
|
+
Parameters: {"locale"=>"de"}
|
133
|
+
Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
134
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
135
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
136
|
+
---------------------------------------------------
|
137
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
138
|
+
---------------------------------------------------
|
139
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
140
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
141
|
+
------------------------------------------------------
|
142
|
+
LocalesControllerTest: test_returns_assets_via_request
|
143
|
+
------------------------------------------------------
|
144
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:20:36 +0100
|
145
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
146
|
+
Parameters: {"locale"=>"de"}
|
147
|
+
Completed 200 OK in 4ms (Views: 0.0ms | ActiveRecord: 0.0ms)
|
148
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
149
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
150
|
+
---------------------------------------------------
|
151
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
152
|
+
---------------------------------------------------
|
153
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
154
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
155
|
+
------------------------------------------------------
|
156
|
+
LocalesControllerTest: test_returns_assets_via_request
|
157
|
+
------------------------------------------------------
|
158
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:21:02 +0100
|
159
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
160
|
+
Parameters: {"locale"=>"de"}
|
161
|
+
Completed 200 OK in 5ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
162
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
163
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
164
|
+
---------------------------------------------------
|
165
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
166
|
+
---------------------------------------------------
|
167
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
168
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
169
|
+
------------------------------------------------------
|
170
|
+
LocalesControllerTest: test_returns_assets_via_request
|
171
|
+
------------------------------------------------------
|
172
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:21:48 +0100
|
173
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
174
|
+
Parameters: {"locale"=>"de"}
|
175
|
+
Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
176
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
177
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
178
|
+
---------------------------------------------------
|
179
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
180
|
+
---------------------------------------------------
|
181
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
182
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
183
|
+
------------------------------------------------------
|
184
|
+
LocalesControllerTest: test_returns_assets_via_request
|
185
|
+
------------------------------------------------------
|
186
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:21:55 +0100
|
187
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
188
|
+
Parameters: {"locale"=>"de"}
|
189
|
+
Completed 200 OK in 3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
190
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
191
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
192
|
+
---------------------------------------------------
|
193
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
194
|
+
---------------------------------------------------
|
195
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
196
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
197
|
+
------------------------------------------------------
|
198
|
+
LocalesControllerTest: test_returns_assets_via_request
|
199
|
+
------------------------------------------------------
|
200
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:22:30 +0100
|
201
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
202
|
+
Parameters: {"locale"=>"de"}
|
203
|
+
Completed 200 OK in 3ms (Views: 0.0ms | ActiveRecord: 0.0ms)
|
204
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
205
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
206
|
+
---------------------------------------------------
|
207
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
208
|
+
---------------------------------------------------
|
209
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
210
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
211
|
+
------------------------------------------------------
|
212
|
+
LocalesControllerTest: test_returns_assets_via_request
|
213
|
+
------------------------------------------------------
|
214
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:22:52 +0100
|
215
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
216
|
+
Parameters: {"locale"=>"de"}
|
217
|
+
Completed 200 OK in 4ms (Views: 0.0ms | ActiveRecord: 0.0ms)
|
218
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
219
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
220
|
+
---------------------------------------------------
|
221
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
222
|
+
---------------------------------------------------
|
223
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
224
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
225
|
+
------------------------------------------------------
|
226
|
+
LocalesControllerTest: test_returns_assets_via_request
|
227
|
+
------------------------------------------------------
|
228
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:23:29 +0100
|
229
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
230
|
+
Parameters: {"locale"=>"de"}
|
231
|
+
Completed 200 OK in 3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
232
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
233
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
234
|
+
---------------------------------------------------
|
235
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
236
|
+
---------------------------------------------------
|
237
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
238
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
239
|
+
------------------------------------------------------
|
240
|
+
LocalesControllerTest: test_returns_assets_via_request
|
241
|
+
------------------------------------------------------
|
242
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:23:50 +0100
|
243
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
244
|
+
Parameters: {"locale"=>"de"}
|
245
|
+
Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
246
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
247
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
248
|
+
---------------------------------------------------
|
249
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
250
|
+
---------------------------------------------------
|
251
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
252
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
253
|
+
------------------------------------------------------
|
254
|
+
LocalesControllerTest: test_returns_assets_via_request
|
255
|
+
------------------------------------------------------
|
256
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:24:51 +0100
|
257
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
258
|
+
Parameters: {"locale"=>"de"}
|
259
|
+
Completed 200 OK in 3ms (Views: 0.3ms | ActiveRecord: 0.0ms)
|
260
|
+
Started GET "/locales/en.json" for 127.0.0.1 at 2013-11-08 20:24:51 +0100
|
261
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
262
|
+
Parameters: {"locale"=>"en"}
|
263
|
+
Completed 200 OK in 5ms (Views: 2.0ms | ActiveRecord: 0.0ms)
|
264
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
265
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
266
|
+
---------------------------------------------------
|
267
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
268
|
+
---------------------------------------------------
|
269
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
270
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
271
|
+
------------------------------------------------------
|
272
|
+
LocalesControllerTest: test_returns_assets_via_request
|
273
|
+
------------------------------------------------------
|
274
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:24:57 +0100
|
275
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
276
|
+
Parameters: {"locale"=>"de"}
|
277
|
+
Completed 200 OK in 8ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
278
|
+
Started GET "/locales/en.json" for 127.0.0.1 at 2013-11-08 20:24:57 +0100
|
279
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
280
|
+
Parameters: {"locale"=>"en"}
|
281
|
+
Completed 200 OK in 5ms (Views: 2.3ms | ActiveRecord: 0.0ms)
|
282
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
283
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
284
|
+
---------------------------------------------------
|
285
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
286
|
+
---------------------------------------------------
|
287
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
288
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
289
|
+
------------------------------------------------------
|
290
|
+
LocalesControllerTest: test_returns_assets_via_request
|
291
|
+
------------------------------------------------------
|
292
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:25:00 +0100
|
293
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
294
|
+
Parameters: {"locale"=>"de"}
|
295
|
+
Completed 200 OK in 3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
296
|
+
Started GET "/locales/en.json" for 127.0.0.1 at 2013-11-08 20:25:00 +0100
|
297
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
298
|
+
Parameters: {"locale"=>"en"}
|
299
|
+
Completed 200 OK in 5ms (Views: 2.1ms | ActiveRecord: 0.0ms)
|
300
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
301
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
302
|
+
---------------------------------------------------
|
303
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
304
|
+
---------------------------------------------------
|
305
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
306
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
307
|
+
------------------------------------------------------
|
308
|
+
LocalesControllerTest: test_returns_assets_via_request
|
309
|
+
------------------------------------------------------
|
310
|
+
Started GET "/locales/de.json" for 127.0.0.1 at 2013-11-08 20:28:03 +0100
|
311
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
312
|
+
Parameters: {"locale"=>"de"}
|
313
|
+
Completed 200 OK in 3ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
314
|
+
Started GET "/locales/en.json" for 127.0.0.1 at 2013-11-08 20:28:03 +0100
|
315
|
+
Processing by RailsAssetLocalization::LocalesController#locale as JSON
|
316
|
+
Parameters: {"locale"=>"en"}
|
317
|
+
Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.0ms)
|
318
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
319
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
320
|
+
---------------------------------------------------
|
321
|
+
RailsLocalizationEngineTest: test_module_is_defined
|
322
|
+
---------------------------------------------------
|
323
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class LocalesControllerTest < ActionDispatch::IntegrationTest
|
4
|
+
test "returns assets via request" do
|
5
|
+
get "/locales/de.json"
|
6
|
+
assert_response :success
|
7
|
+
|
8
|
+
locales = JSON.parse response.body
|
9
|
+
assert_equal %w(hello), locales.keys
|
10
|
+
assert_equal "Hallo Welt", locales["hello"]
|
11
|
+
|
12
|
+
get "/locales/en.json"
|
13
|
+
assert_response :success
|
14
|
+
|
15
|
+
locales = JSON.parse response.body
|
16
|
+
assert locales.keys.include?("hello")
|
17
|
+
assert_equal "Hello world", locales["hello"]
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-asset-localization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Randschau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>'
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.12
|
20
|
+
- - <
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - '>'
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 3.2.12
|
30
|
+
- - <
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: sqlite3
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
27
47
|
description: I18next and dynamic localization for your Rails 3.2 asset pipeline
|
28
48
|
email:
|
29
49
|
- nicolai86@me.com
|
@@ -33,6 +53,7 @@ extra_rdoc_files: []
|
|
33
53
|
files:
|
34
54
|
- app/assets/javascripts/i18n/translations.coffee.erb
|
35
55
|
- app/controllers/rails_asset_localization/locales_controller.rb
|
56
|
+
- config/initializers/sprockets.rb
|
36
57
|
- config/routes.rb
|
37
58
|
- lib/rails-asset-localization.rb
|
38
59
|
- lib/rails_asset_localization/engine.rb
|
@@ -62,15 +83,20 @@ files:
|
|
62
83
|
- test/dummy/config/initializers/secret_token.rb
|
63
84
|
- test/dummy/config/initializers/session_store.rb
|
64
85
|
- test/dummy/config/initializers/wrap_parameters.rb
|
86
|
+
- test/dummy/config/locales/de.yml
|
65
87
|
- test/dummy/config/locales/en.yml
|
66
88
|
- test/dummy/config/routes.rb
|
67
89
|
- test/dummy/config.ru
|
90
|
+
- test/dummy/db/test.sqlite3
|
91
|
+
- test/dummy/log/development.log
|
92
|
+
- test/dummy/log/test.log
|
68
93
|
- test/dummy/public/404.html
|
69
94
|
- test/dummy/public/422.html
|
70
95
|
- test/dummy/public/500.html
|
71
96
|
- test/dummy/public/favicon.ico
|
72
97
|
- test/dummy/Rakefile
|
73
98
|
- test/dummy/script/rails
|
99
|
+
- test/locales_controller_test.rb
|
74
100
|
- test/rails-localization-engine_test.rb
|
75
101
|
- test/test_helper.rb
|
76
102
|
homepage: http://nicolai86.eu
|
@@ -93,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
119
|
version: '0'
|
94
120
|
requirements: []
|
95
121
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.1.10
|
97
123
|
signing_key:
|
98
124
|
specification_version: 4
|
99
125
|
summary: I18next and dynamic localization for your Rails app
|
@@ -116,15 +142,19 @@ test_files:
|
|
116
142
|
- test/dummy/config/initializers/secret_token.rb
|
117
143
|
- test/dummy/config/initializers/session_store.rb
|
118
144
|
- test/dummy/config/initializers/wrap_parameters.rb
|
145
|
+
- test/dummy/config/locales/de.yml
|
119
146
|
- test/dummy/config/locales/en.yml
|
120
147
|
- test/dummy/config/routes.rb
|
121
148
|
- test/dummy/config.ru
|
149
|
+
- test/dummy/db/test.sqlite3
|
150
|
+
- test/dummy/log/development.log
|
151
|
+
- test/dummy/log/test.log
|
122
152
|
- test/dummy/public/404.html
|
123
153
|
- test/dummy/public/422.html
|
124
154
|
- test/dummy/public/500.html
|
125
155
|
- test/dummy/public/favicon.ico
|
126
156
|
- test/dummy/Rakefile
|
127
157
|
- test/dummy/script/rails
|
158
|
+
- test/locales_controller_test.rb
|
128
159
|
- test/rails-localization-engine_test.rb
|
129
160
|
- test/test_helper.rb
|
130
|
-
has_rdoc:
|