flame-r18n 2.0.0 → 2.1.1

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: 2061beaf8e72a910714e93a68e08e7361cde88a4
4
- data.tar.gz: 44068fc8d3ee0ccd7719060605f0212bf2a1de92
3
+ metadata.gz: 9b7d001944f9fef5e69d11ad22da551cb97eeadc
4
+ data.tar.gz: 3bcd0bf0b1c0ca1efe7f3ec1c654c0370b9922cd
5
5
  SHA512:
6
- metadata.gz: ef3a05d013d66162ad43da9315397ba57e95c46305ef72fc2537309cb9eb2c99988ca28e2271b890ecb9031170f4e3657e5d32af9efacbbd49d521eb4a9bdd3c
7
- data.tar.gz: b5f1e2e753fad2f3476de0985d1d15dcec077319b086a7d7987068b4ea9208629e4ba382b54196885608074a29064d662e18f04c10153a7158ff92eda55c991c
6
+ metadata.gz: ef0821ee8537a20fdb64165d1b7b3ca8c6a9e7e5297c3c7394f069286a0313cc86ed4cd55843b549f57461f5a26c74c21146dcec329080b582871df631cbe328
7
+ data.tar.gz: 176715bf76a7a9fdcc9019770f244a9e208137f91794fbd37e271952a0eb7fc0dea157b23e37fa25dc5ea3aa9f62f1f1c079005315259af7b21e25c41254237c
@@ -34,7 +34,15 @@ module Flame
34
34
  end
35
35
 
36
36
  def preferred_locale
37
- params[:locale] || session[:locale]
37
+ locale_param || session[:locale]
38
+ end
39
+
40
+ def locale_param
41
+ params[:locale] if available_locale_codes.include?(params[:locale])
42
+ end
43
+
44
+ def available_locale_codes
45
+ ::R18n.available_locales.map(&:code)
38
46
  end
39
47
 
40
48
  def load_r18n
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flame-r18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2017-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flame