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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 919e24aa78e80169bcf2f2b032b8145c01bd385c
4
- data.tar.gz: 4230c28a6afcf2d6e4f72e38b5fbc6c8ac0cad13
3
+ metadata.gz: 722e3662e1925d71fe99c6eec5897c0e59bf0f53
4
+ data.tar.gz: 6cb98608b96b0fc9a9a88c8ba44b7e15855f0465
5
5
  SHA512:
6
- metadata.gz: d24491fd6b6c200bce6d845a6af29c0ca4a43175dc120ca6ac35df385a5f0c9a64698d72d95c7ce760be3a0ee731887442973f7784245dda957ccc5b977d6757
7
- data.tar.gz: 223bbe0bc42013949637b2cd0afe679bf1f80582310eb9f1a0850b13603dff401b451a165d195c8ffd92258da983946bf5715e36944c1f7187a4eb6d471cf93f
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
- translated_texts = retrieve_remote_texts(@__specs.keys)
11
-
12
- # translated_texts = retrieve_example_texts(@__specs.keys)
13
- translated_texts.each do |key, value|
14
- @__specs[key].each do |spec|
15
- spec.substitute_with(value)
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
@@ -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
- if content = $dt_redis.get(scope_key)
16
- text = find_by(scope: options[:scope], lang: options[:lang], key: key)
17
- else
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''