glib-web 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/glib/json/dynamic_text.rb +8 -6
- data/app/models/glib/text.rb +4 -3
- 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: 722e3662e1925d71fe99c6eec5897c0e59bf0f53
|
4
|
+
data.tar.gz: 6cb98608b96b0fc9a9a88c8ba44b7e15855f0465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 233399bbc9018a97adb6fa9316b566698e19e24607f0433fc684b58648af295778aaf5676f3af51edc9a4813410e6e82d1d6443a6d512d13e668cdf9a1c44f13
|
7
|
+
data.tar.gz: 437210e7dfb02b783d8593809c59e155b91f552be6785ef46d05b7cf6f73138e783ffffa0fc814c7dce31099159e0b6644e49ea3570854cf8102fbace060b532
|
@@ -7,12 +7,14 @@ module Glib::Json::DynamicText
|
|
7
7
|
crawl hash['body']&.[]('childViews')
|
8
8
|
crawl hash['footer']&.[]('childViews')
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
spec
|
10
|
+
if @__specs.keys.size > 0
|
11
|
+
translated_texts = retrieve_remote_texts(@__specs.keys)
|
12
|
+
|
13
|
+
# translated_texts = retrieve_example_texts(@__specs.keys)
|
14
|
+
translated_texts.each do |key, value|
|
15
|
+
@__specs[key].each do |spec|
|
16
|
+
spec.substitute_with(value)
|
17
|
+
end
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
data/app/models/glib/text.rb
CHANGED
@@ -12,9 +12,10 @@ module Glib
|
|
12
12
|
def self.get_content(key, default_value, options:)
|
13
13
|
scope_key = "#{options[:scope]}.#{options[:lang]}.#{key}"
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
content = $dt_redis.get(scope_key)
|
16
|
+
text = find_by(scope: options[:scope], lang: options[:lang], key: key)
|
17
|
+
|
18
|
+
if !(content && text)
|
18
19
|
if text = find_by(scope: options[:scope], lang: options[:lang], key: key)
|
19
20
|
update_content(scope_key, text.content)
|
20
21
|
content = text.content
|