lalala 4.0.0.dev.134 → 4.0.0.dev.135

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ff12f23f11e3f4a30243125978c3afed923dcfb
4
- data.tar.gz: 32268b08b966ad0084f3c64daa9186106cb285d7
3
+ metadata.gz: 243cacf07c63af7e7b293d9ac4d341903e4e635a
4
+ data.tar.gz: 127e4de1d99878c5400a7117c6f9973ba39f40bd
5
5
  SHA512:
6
- metadata.gz: 01a1a6daa3a96804b2ad33fa4a7a7fe986db1af15b196c4b990e1e8cdc9c0c0d4877a6d43ee8bc37a0c7851d567923877bfab89f5c996643116bb73240046456
7
- data.tar.gz: f0b36b20bfb665ae6087a5a66795ddadb0c3c5b15beb796df5dce3f8dc0f3e0ede1864c014d58833d125e05a0add4982e91a502cbf629426d8565a1b2f6912e3
6
+ metadata.gz: 4f1363d1cefdeb22512b2c470cba48175aeee45f24f31be73f4daa844fcb42528a9049919159e6cf280f7cdcf198b05ac914692da4fead81047a5c0e7b910ae0
7
+ data.tar.gz: 53678295db3e381c351b1e0b84bb44ac5eec4b96a60ff9a39c4fa409a5be65bc9ad0ebf9138f0926b1b343a67fbd4fb4000e778025b6896246b047ba1dad02c9
@@ -249,6 +249,7 @@ private
249
249
  # update translated attributes
250
250
  begin
251
251
  _locale = I18n.locale
252
+
252
253
  I18n.available_locales.each do |locale|
253
254
  I18n.locale = locale
254
255
 
@@ -277,17 +278,24 @@ private
277
278
  end
278
279
 
279
280
  def set_path_component
280
- r = self.route
281
- case r
282
- when NilClass
283
- self.path_component = self.class.default_route.call(self)
284
- when Proc
285
- self.path_component = r.call(self)
286
- when String
287
- self.path_component = r
288
- else
289
- raise "Unexpected path_component value: #{r.inspect}"
281
+ _locale = I18n.locale
282
+ I18n.available_locales.each do |locale|
283
+
284
+ r = self.route
285
+ case r
286
+ when NilClass
287
+ self.path_component = self.class.default_route.call(self)
288
+ when Proc
289
+ self.path_component = r.call(self)
290
+ when String
291
+ self.path_component = r
292
+ else
293
+ raise "Unexpected path_component value: #{r.inspect}"
294
+ end
295
+
290
296
  end
297
+ ensure
298
+ I18n.locale = _locale
291
299
  end
292
300
 
293
301
  end
@@ -12,6 +12,10 @@ class Lalala::ExtI18n::NegotiationAdapter
12
12
  nil
13
13
  end
14
14
 
15
+ def locale_for_ignored
16
+ default_locale
17
+ end
18
+
15
19
  def locales_for_hostname(hostname)
16
20
  available_locales
17
21
  end
@@ -19,7 +19,11 @@ protected
19
19
  _locale = I18n.locale
20
20
 
21
21
  if @adapter.ignored?(env)
22
- return @app.call(env)
22
+ I18n.locale = locale_for_ignored.to_sym
23
+ @env['rack.locale'] = I18n.locale
24
+ status, headers, body = @app.call(env)
25
+ headers['Content-Language'] = I18n.locale.to_s
26
+ return [status, headers, body]
23
27
  end
24
28
 
25
29
  return determine_routing_path
@@ -72,7 +76,7 @@ private
72
76
  case action
73
77
 
74
78
  when :call
75
- I18n.locale = new_env['rack.locale']
79
+ I18n.locale = new_env['rack.locale'].to_sym
76
80
 
77
81
  status, headers, body = @app.call(new_env)
78
82
  headers['Content-Language'] = I18n.locale.to_s
@@ -194,6 +198,10 @@ private
194
198
  @_locales_for_hostname_set ||= locales_for_hostname.map(&:to_s)
195
199
  end
196
200
 
201
+ def locale_for_ignored
202
+ @_locale_for_ignored ||= @adapter.locale_for_ignored
203
+ end
204
+
197
205
  def hostname
198
206
  @_hostname ||= @env['HTTP_HOST'].split(':').first
199
207
  end
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "134"
3
+ BUILD = "135"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lalala
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.dev.134
4
+ version: 4.0.0.dev.135
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke