lalala 4.0.0.dev.385 → 4.0.0.dev.388

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: 8fd0d8f163ccb5d5eb43c15cd9274c26a1b61d7b
4
- data.tar.gz: d401a1661fdd239e9de28acaf40045cf7a9a6ac4
3
+ metadata.gz: 8d455d04941fbba81dee21d7cea88fbfe64c77f9
4
+ data.tar.gz: 863c022c791fd66ea4d40a99aae9752db8c5d9f7
5
5
  SHA512:
6
- metadata.gz: e1b636bc5bb47e0da5857c5f8dafc8acde35ac47d6cf72d971e82f920fab7ee434364d24cd74a156908f605809f43d5a1203510afaed1b0d82e8d7c9d242895b
7
- data.tar.gz: 207a29236ad8dca0d56a5c5d9558ff9f40c9f91f2f196ab3a3b1505e8f9ca3ad64273d1f31bad29e5bc556a5115bfa4dbf02f60ee053a4e09d8027612f780f67
6
+ metadata.gz: 3502c6efdf7bf4d5d5b8f4d1243a4d4645842d6e0cfd110683a4c3cbed0ec56fd7610dff75e103ff1449b567f43ee9747aab3e83c89ab7d81248423794511a39
7
+ data.tar.gz: 529bbac1b78081af35a7bcf526a1d2347094d502fc7e50c727eb18d42e41e850f7e69184c2b8aaf80665770a93fbab96168a9bc4b6659c2453cb69b508900dee
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.0.0"
3
- BUILD = "385"
3
+ BUILD = "388"
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.385
4
+ version: 4.0.0.dev.388
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