lalala 4.1.0.dev.386 → 4.1.0.dev.387

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a157893f622e947588570da112634c9800039dc
4
- data.tar.gz: afd7f1fe2d2e099ad9c8b359699b54711085ec68
3
+ metadata.gz: e37a0475df835fc6ed0e38b1d7018ff2e452a2a0
4
+ data.tar.gz: 4b094e5fbb5023efb596a11d20b5ca0294ff70bd
5
5
  SHA512:
6
- metadata.gz: e5fc509c46f05fd391877b5b8a1a43f272bb20448beeff774ea44cdf25e7e85dcbf42401780ec922cb53386fd3e9667a59c50c7211e904165861e6e8b720c0ce
7
- data.tar.gz: 9820a188fcb721e1b77d7b55b208d0530e9e3ce4009062597da3da692b604e06671a46e029d1859109885086da20426619f65fae33099aa3ab4a67e97866b76f
6
+ metadata.gz: d6db6f49bda2370c06827328c846d9db2df395a5880457f7b290d3f946ef88c66c47197321eaea91144d9a10a9811a03f0053d3547f1d0cb6bc9cfcf84c4230a
7
+ data.tar.gz: daae32cd944e668193fe7544643d9a88a89174a755e4b1b583b778393d0171ee21e48458b78432e4549ee0fbf06da9268529f47d95f8d20fff64df0723023173
data/lib/lalala/engine.rb CHANGED
@@ -12,6 +12,7 @@ module Lalala
12
12
  config.lalala = ActiveSupport::OrderedOptions.new
13
13
  config.lalala.i18n = ActiveSupport::OrderedOptions.new
14
14
  config.lalala.i18n.adapter = nil
15
+ config.lalala.i18n.allow_accept_language = true
15
16
 
16
17
  initializer "lalala.migrations" do |app|
17
18
  app.class.configure do
@@ -28,4 +28,8 @@ class Lalala::ExtI18n::NegotiationAdapter
28
28
  %r{^/(lalala|assets)(/|$)} === env['PATH_INFO']
29
29
  end
30
30
 
31
+ def allow_accept_language
32
+ !!Rails.configuration.lalala.i18n.allow_accept_language
33
+ end
34
+
31
35
  end
@@ -18,4 +18,8 @@ class Lalala::ExtI18n::TestNegotiationAdapter < Lalala::ExtI18n::NegotiationAdap
18
18
  @domain_locales[hostname]
19
19
  end
20
20
 
21
+ def allow_accept_language
22
+ true
23
+ end
24
+
21
25
  end
@@ -63,13 +63,15 @@ private
63
63
  return action(true)
64
64
  end
65
65
 
66
- Rails.logger.debug "[I18n]: try Accept-Language..."
67
- if m = accept_language_is_available?
68
- @env['rack.locale'] = m[0]
69
- @env['SCRIPT_NAME'] = m[1]
70
- @env['lalala.cannonical_url'] = m[2]
71
- @env['lalala.locale.source'] = 'header'
72
- return action(false)
66
+ if @adapter.allow_accept_language
67
+ Rails.logger.debug "[I18n]: try Accept-Language..."
68
+ if m = accept_language_is_available?
69
+ @env['rack.locale'] = m[0]
70
+ @env['SCRIPT_NAME'] = m[1]
71
+ @env['lalala.cannonical_url'] = m[2]
72
+ @env['lalala.locale.source'] = 'header'
73
+ return action(false)
74
+ end
73
75
  end
74
76
 
75
77
  @env['rack.locale'] = default_locale_for_hostname.to_sym
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.1.0"
3
- BUILD = "386"
3
+ BUILD = "387"
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.1.0.dev.386
4
+ version: 4.1.0.dev.387
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2015-01-21 00:00:00.000000000 Z
16
+ date: 2015-02-10 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activeadmin