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 +4 -4
- data/app/helpers/account/locale_helper.rb +19 -15
- data/lib/bullet_train/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce20e3e5564170a8386b5b4da33db6eafcb419634e6c7e757a0ee63a7be1586c
|
4
|
+
data.tar.gz: f09ae527f9e3ce4b8305e16e9629eac576a6814e84d5d10139f6065c0ce6a30a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
62
|
-
if
|
63
|
-
|
64
|
-
|
65
|
-
|
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
|
-
|
70
|
-
|
72
|
+
if params[:show_locales]
|
73
|
+
return full_key
|
74
|
+
end
|
71
75
|
end
|
72
76
|
end
|
73
77
|
|
data/lib/bullet_train/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|