lit 0.4.0.pre.alpha → 0.4.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lit.rb +6 -0
- data/lib/lit/i18n_backend.rb +1 -1
- data/lib/lit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4df32a49da08696b7996f469dbd9041655750f22
|
4
|
+
data.tar.gz: e642cef48888929647b2782be05bb96339eb8788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c002db4e8d5262e15c4d62a55cbccb44a44c6580dd31a4d1feefdb3eec72b182894d6e72d8d13659cbf0e8e679bea203a1a8344818b841351590b40207e1b100
|
7
|
+
data.tar.gz: 133089d93bc0f5da416480e4fe59a9f27a2779bbab8c859691d0e18644fb2e81fbf24e2341fa0e8c553cb9e056c7ea71afd50ea44b203d40cc533af7b2f7df56
|
data/lib/lit.rb
CHANGED
@@ -8,6 +8,8 @@ module Lit
|
|
8
8
|
mattr_accessor :redis_url
|
9
9
|
mattr_accessor :storage_options
|
10
10
|
mattr_accessor :humanize_key
|
11
|
+
mattr_accessor :humanize_key_ignored_keys
|
12
|
+
mattr_accessor :humanize_key_ignored
|
11
13
|
mattr_accessor :ignored_keys
|
12
14
|
mattr_accessor :ignore_yaml_on_startup
|
13
15
|
mattr_accessor :api_enabled
|
@@ -25,6 +27,10 @@ module Lit
|
|
25
27
|
if loader.nil? && @@table_exists
|
26
28
|
self.loader ||= Loader.new
|
27
29
|
Lit.humanize_key = false if Lit.humanize_key.nil?
|
30
|
+
Lit.humanize_key_ignored_keys = [] if Lit.humanize_key_ignored_keys.nil?
|
31
|
+
Lit.humanize_key_ignored = %w[i18n date datetime number time support ]
|
32
|
+
Lit.humanize_key_ignored |= Lit.humanize_key_ignored_keys
|
33
|
+
Lit.humanize_key_ignored = %r{(#{Lit.humanize_key_ignored.join('|')}).*}
|
28
34
|
if Lit.ignored_keys.is_a?(String)
|
29
35
|
keys = Lit.ignored_keys.split(',').map(&:strip)
|
30
36
|
Lit.ignored_keys = keys
|
data/lib/lit/i18n_backend.rb
CHANGED
@@ -108,7 +108,7 @@ module Lit
|
|
108
108
|
# it anyway if we return nil, but then it will wrap it also in
|
109
109
|
# translation_missing span.
|
110
110
|
# Humanizing key should be last resort
|
111
|
-
if content.nil? && Lit.humanize_key
|
111
|
+
if content.nil? && Lit.humanize_key && key.match(Lit.humanize_key_ignored).nil?
|
112
112
|
content = key.to_s.split('.').last.humanize
|
113
113
|
if content.present?
|
114
114
|
@cache[key_with_locale] = content
|
data/lib/lit/version.rb
CHANGED