singleton-ruby 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sgtn-client/api/translation.rb +16 -1
- data/lib/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: f0abd7a01826bb75e0b2d1c652f8245992a31000d1e6da052e3ddd444aa56554
|
4
|
+
data.tar.gz: 8c7424f2b42ea4d16556111541f275998a09892967581269ef15ad66557a183c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8cf069e94dd35cd61b6ba833c2b3b7253eb214343deaeb036de2c8cdb1608154123ef38eddd14b1d515f3dbf085fa6ca3a06e924e94a2a61392b6c3ff8e1fce
|
7
|
+
data.tar.gz: 61d39ee45bb285a598fd67358be529541b32a79f55ec3c66e9e25e6dc730b8ceb89c9f0fbef1347233e7728abfd627afcb61c733dc0e7c572478788ee28de118
|
@@ -36,7 +36,15 @@ module SgtnClient
|
|
36
36
|
|
37
37
|
def self.getString_f(component, key, args, locale)
|
38
38
|
s = getString(component, key, locale)
|
39
|
-
|
39
|
+
if is_json?(args)
|
40
|
+
jsonstr = MultiJson.load(args)
|
41
|
+
jsonstr.each do |source, arg|
|
42
|
+
s.gsub! "{#{source}}", arg
|
43
|
+
end
|
44
|
+
elsif args.is_a?(Array)
|
45
|
+
s = sprintf s % args
|
46
|
+
end
|
47
|
+
return s
|
40
48
|
end
|
41
49
|
|
42
50
|
def self.getStrings(component, locale)
|
@@ -105,6 +113,13 @@ module SgtnClient
|
|
105
113
|
return obj
|
106
114
|
end
|
107
115
|
|
116
|
+
def self.is_json?(value)
|
117
|
+
result = MultiJson.load(value)
|
118
|
+
result.is_a?(Hash) || result.is_a?(Array)
|
119
|
+
rescue => exception
|
120
|
+
false
|
121
|
+
end
|
122
|
+
|
108
123
|
end
|
109
124
|
|
110
125
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: singleton-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware G11n Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08
|
11
|
+
date: 2021-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|