beyond_canvas 0.13.0.pre → 0.13.1.pre

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
  SHA256:
3
- metadata.gz: 81a4312a7836c6b4e45b70a2516f1b8cf1a81c2a5a147b84794f4b81ca91fca9
4
- data.tar.gz: e6dfcf1d2ae33991106021e0d6118b6bf5048d34cdffd419226594ede89d7986
3
+ metadata.gz: b251444a9c8422914b644276a9092df58d0678f2b26afacf1460b2a9505ad833
4
+ data.tar.gz: c7fe8d4689dca6b5c23a967619e59f72a615e1a42f908b5fda345a7e0b8d4c72
5
5
  SHA512:
6
- metadata.gz: 3c90f578bd17802c1822b26412bf5c41c2342b948162ade9d23b4c8591aef7e2ce96a8712d3f56bec21fb8388d18e4478412e0f310a728682193bd9714267050
7
- data.tar.gz: 3af58493e12b49d298cbea416a668d1442d8c366ee8cea84df7a928f876f50625205118a51607dce44bd6061c459d9884bcdf5f49f3bb7c7261e6b9ee4bf85ef
6
+ metadata.gz: 31ed5d0a6dbce63e91ccfbc240e4bbb2a3b835bebe2f1735b9a3e4491b7e87cec02e7bbd03809838494a2dcdf66879f1ca17f60a4feb05431e695475e0b9776b
7
+ data.tar.gz: 2a9e47666a44a7d4c8782c9a6f9bca1b15d68a271302ef765155106d8039c95d855e4cff7095584f4c1dc827c2424dddd7fae7deec4befb28ba3be7950c1d937
@@ -15,6 +15,9 @@ module BeyondCanvas
15
15
  # browser compatible locale, sets the value to the cookie and set that locale as default locale.
16
16
  #
17
17
  def switch_locale(&action)
18
+ # NOTE: Check the HTTP_ACCEPT_LANGUAGE header to identify if the request comes from a browser or a server
19
+ return I18n.with_locale(I18n.default_locale, &action) if request.headers['HTTP_ACCEPT_LANGUAGE'].blank?
20
+
18
21
  unless valid_locale?(cookies[:locale])
19
22
  cookies[:locale] = { value: browser_compatible_locale, expires: 1.day.from_now }
20
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondCanvas
4
- VERSION = '0.13.0.pre'
4
+ VERSION = '0.13.1.pre'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0.pre
4
+ version: 0.13.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-16 00:00:00.000000000 Z
11
+ date: 2020-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: beyond_api