tml 5.7.1 → 5.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tml/application.rb +9 -7
- data/lib/tml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00373acbdc8243802cb22ddd14c3d2434753edfa
|
4
|
+
data.tar.gz: 01f266fa7d349cefcb19463996367aa0e35788cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfa73f5c1ad8abf94af47684f4c136d60647b9dd1e98bf70e4b90fb0dc78330788ccf3336af75a5a446b44fa95aa12f1e8e7929eaa07f3e8b2cd93e2d10a223b
|
7
|
+
data.tar.gz: 49528f62dd636a3a57f7cac4a5a16a8b66000b50fd7d428e39258bb45fd853944e47a90f515ab1874c0a239d3b525a1f5a470cffdeaf6386f8c292ce73d9f151
|
data/lib/tml/application.rb
CHANGED
@@ -39,7 +39,7 @@ class Tml::Application < Tml::Base
|
|
39
39
|
# CDN_HOST = 'https://trex-snapshots.s3-us-west-1.amazonaws.com'
|
40
40
|
|
41
41
|
attributes :host, :cdn_host, :id, :key, :access_token, :name, :description, :threshold, :default_locale, :default_level
|
42
|
-
has_many :features, :languages, :languages_by_locale, :sources, :tokens, :css, :shortcuts, :translations, :extensions
|
42
|
+
has_many :features, :languages, :languages_by_locale, :sources, :sources_by_key, :tokens, :css, :shortcuts, :translations, :extensions
|
43
43
|
has_many :ignored_keys
|
44
44
|
|
45
45
|
# Returns application cache key
|
@@ -125,14 +125,15 @@ class Tml::Application < Tml::Base
|
|
125
125
|
end
|
126
126
|
|
127
127
|
if hash_value(extensions, :sources)
|
128
|
-
self.
|
128
|
+
self.sources_by_key ||= {}
|
129
129
|
hash_value(extensions, :sources).each do |source, data|
|
130
130
|
cache.store(Tml::Source.cache_key(source_locale, source), data) if cache
|
131
|
-
|
131
|
+
source_key = "#{source_locale}/#{source}"
|
132
|
+
self.sources_by_key[source_key] ||= Tml::Source.new(
|
132
133
|
application: self,
|
133
134
|
source: source
|
134
135
|
)
|
135
|
-
self.
|
136
|
+
self.sources_by_key[source].update_translations(source_locale, data)
|
136
137
|
end
|
137
138
|
end
|
138
139
|
end
|
@@ -193,8 +194,9 @@ class Tml::Application < Tml::Base
|
|
193
194
|
|
194
195
|
# Returns source by key
|
195
196
|
def source(key, locale)
|
196
|
-
self.
|
197
|
-
|
197
|
+
self.sources_by_key ||= {}
|
198
|
+
source_key = "#{locale}/#{key}"
|
199
|
+
self.sources_by_key[source_key] ||= Tml::Source.new(
|
198
200
|
:application => self,
|
199
201
|
:source => key
|
200
202
|
).fetch_translations(locale)
|
@@ -258,7 +260,7 @@ class Tml::Application < Tml::Base
|
|
258
260
|
|
259
261
|
# Reset translation cache
|
260
262
|
def reset_translation_cache
|
261
|
-
self.
|
263
|
+
self.sources_by_key = {}
|
262
264
|
self.translations = {}
|
263
265
|
@languages_by_locale = nil
|
264
266
|
@missing_keys_by_sources = nil
|
data/lib/tml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.7.
|
4
|
+
version: 5.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Berkovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|