bullet_train 1.0.32 → 1.0.33

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: 37dd5a03aac762597257a5f6e30f585b9996cccc4259b05b03fb3b2686fcab65
4
- data.tar.gz: 941fec675c8b5380e43824c636cb653f90d4bae14f2c938904924c236301313a
3
+ metadata.gz: ce20e3e5564170a8386b5b4da33db6eafcb419634e6c7e757a0ee63a7be1586c
4
+ data.tar.gz: f09ae527f9e3ce4b8305e16e9629eac576a6814e84d5d10139f6065c0ce6a30a
5
5
  SHA512:
6
- metadata.gz: 2dfd41ac5e331666e8de46561b40c2900931b0c870c99772b50b5a2e1ae6ae7726cc973f8bbac08c65c2098f04ca34f14aae51a07e7cb4944224072265fadba5
7
- data.tar.gz: 61620c1bc1f58b58e6c4b6490d8322c9dee3a9059389f74d1a68b7720ae6ff23233121ca4aaf95ce0e0d11dea8a0db63bbbf767c098e559440c175368c448ff7
6
+ metadata.gz: 664338b79a65f7982cd073537fe7242aabe604100253045f25ccaf21ebf611692e5dca42a20559daf2507e7b9e06fa4f56c59a46d441123e67934e265c79b377
7
+ data.tar.gz: 87c77a80931ca684069d400375cdc046f8e499e7a13b3706fb48881222e757e15a58f3b0f963ee6301adf025a046f0e73ca3f9d5d5f8c1f094288184f6a3f1cd
@@ -39,13 +39,15 @@ module Account::LocaleHelper
39
39
  # application are coming from where. To help with this, you can add `?debug=true` to any URL and we'll output
40
40
  # any rendered strings and their translation keys on the console.
41
41
  unless Rails.env.production?
42
- if params[:log_locales] || params[:show_locales]
43
- # Often times we're only receiving partial keys like `.section`, so this is a crazy hack to trick I18n.t into
44
- # telling us what the full key ended up being.
45
- begin
46
- super(key + "💣", options.except(:default))
47
- rescue I18n::MissingTranslationData => exception
48
- full_key = exception.message.rpartition(" ").last.gsub("💣", "")
42
+ if params.present?
43
+ if params[:log_locales] || params[:show_locales]
44
+ # Often times we're only receiving partial keys like `.section`, so this is a crazy hack to trick I18n.t into
45
+ # telling us what the full key ended up being.
46
+ begin
47
+ super(key + "💣", options.except(:default))
48
+ rescue I18n::MissingTranslationData => exception
49
+ full_key = exception.message.rpartition(" ").last.gsub("💣", "")
50
+ end
49
51
  end
50
52
  end
51
53
  end
@@ -58,16 +60,18 @@ module Account::LocaleHelper
58
60
  result = super(key, options)
59
61
 
60
62
  unless Rails.env.production?
61
- if params[:log_locales]
62
- if result == options[:default]
63
- puts "🌐 #{full_key}: Not found? Result matched default: \"#{result}\"".yellow
64
- else
65
- puts "🌐 #{full_key}: \"#{result}\"".green
63
+ if params.present?
64
+ if params[:log_locales]
65
+ if result == options[:default]
66
+ puts "🌐 #{full_key}: Not found? Result matched default: \"#{result}\"".yellow
67
+ else
68
+ puts "🌐 #{full_key}: \"#{result}\"".green
69
+ end
66
70
  end
67
- end
68
71
 
69
- if params[:show_locales]
70
- return full_key
72
+ if params[:show_locales]
73
+ return full_key
74
+ end
71
75
  end
72
76
  end
73
77
 
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.32"
2
+ VERSION = "1.0.33"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.32
4
+ version: 1.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-09 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails