tml 5.1.2 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tml/api/client.rb +1 -1
- data/lib/tml/cache_adapters/memcache.rb +1 -2
- data/lib/tml/ext/array.rb +2 -2
- data/lib/tml/source.rb +1 -3
- data/lib/tml/tokens/data.rb +2 -2
- 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: 0300e4226b97cf3ce5cd8fca0a4d59c27a13f2de
|
4
|
+
data.tar.gz: f774ba24f23e3a76e8820d43e3d8b7551c54f7da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31ee76daca1aadeaa2a7ebd9f0fca81f8d61d72cced0419c70a91b65e5551e1bc66432748d15aeea17f541bbb6c2ebe95b12df438cff046e2a45455f512d31ca
|
7
|
+
data.tar.gz: a4dbb6d81dd70b481cf5a75210d64ad77582c994db9013bad378f59116326fdabc09c3677cd4af6ddbd5888a6428a0f71f841df2cf445b8504c4ebf2526b59cf
|
data/lib/tml/api/client.rb
CHANGED
@@ -133,7 +133,7 @@ class Tml::Api::Client < Tml::Base
|
|
133
133
|
return false if opts[:cache_key].nil?
|
134
134
|
return false unless Tml.cache.enabled?
|
135
135
|
return false if Tml.session.inline_mode?
|
136
|
-
return false if Tml.session.block_option(:live)
|
136
|
+
return false if Tml.session.block_option(:live) and opts[:cache_key].index('sources')
|
137
137
|
true
|
138
138
|
end
|
139
139
|
|
@@ -65,7 +65,7 @@ class Tml::CacheAdapters::Memcache < Tml::Cache
|
|
65
65
|
|
66
66
|
data
|
67
67
|
rescue Exception => ex
|
68
|
-
warn("
|
68
|
+
warn("#{ex.message}: #{key}")
|
69
69
|
return nil unless block_given?
|
70
70
|
yield
|
71
71
|
end
|
@@ -76,7 +76,6 @@ class Tml::CacheAdapters::Memcache < Tml::Cache
|
|
76
76
|
@cache.set(versioned_key(key, opts), strip_extensions(data), ttl)
|
77
77
|
data
|
78
78
|
rescue Exception => ex
|
79
|
-
pp ex
|
80
79
|
warn("Failed to store data: #{key}")
|
81
80
|
data
|
82
81
|
end
|
data/lib/tml/ext/array.rb
CHANGED
@@ -67,7 +67,7 @@ class Array
|
|
67
67
|
end
|
68
68
|
|
69
69
|
# creates a sentence with tr "and" joiner
|
70
|
-
def translate_sentence(description =
|
70
|
+
def translate_sentence(description = nil, options = {})
|
71
71
|
return '' if empty?
|
72
72
|
return first if size == 1
|
73
73
|
|
@@ -77,7 +77,7 @@ class Array
|
|
77
77
|
options[:joiner] ||= 'and'
|
78
78
|
|
79
79
|
result = elements[0..-2].join(options[:separator])
|
80
|
-
result << ' ' << options[:joiner].translate('List elements joiner', {}, options) << ' '
|
80
|
+
result << ' ' << options[:joiner].translate(description || 'List elements joiner', {}, options) << ' '
|
81
81
|
result << elements.last
|
82
82
|
|
83
83
|
result.tml_translated
|
data/lib/tml/source.rb
CHANGED
@@ -91,9 +91,7 @@ class Tml::Source < Tml::Base
|
|
91
91
|
"sources/#{self.key}/translations",
|
92
92
|
{:locale => locale, :per_page => 10000},
|
93
93
|
{:cache_key => Tml::Source.cache_key(locale, self.source)}
|
94
|
-
)
|
95
|
-
|
96
|
-
return self unless results
|
94
|
+
) || []
|
97
95
|
|
98
96
|
update_translations(locale, results)
|
99
97
|
|
data/lib/tml/tokens/data.rb
CHANGED
@@ -214,7 +214,7 @@ module Tml
|
|
214
214
|
uniq_id = Tml::TranslationKey.generate_key(label, values.join(","))
|
215
215
|
result << "<span id=\"tml_other_link_#{uniq_id}\"> #{joiner} "
|
216
216
|
|
217
|
-
result << "<a href='#' onClick=\"
|
217
|
+
result << "<a href='#' onClick=\"document.getElementById('tml_other_link_#{uniq_id}').style.display='none'; document.getElementById('tml_other_elements_#{uniq_id}').style.display='inline'; return false;\">"
|
218
218
|
if list_options[:remainder] and list_options[:remainder].is_a?(Proc)
|
219
219
|
result << list_options[:remainder].call(remaining_ary)
|
220
220
|
else
|
@@ -229,7 +229,7 @@ module Tml
|
|
229
229
|
result << remaining_ary.last
|
230
230
|
|
231
231
|
if list_options[:collapsable]
|
232
|
-
result << "<a href='#' style='font-size:smaller;white-space:nowrap' onClick=\"
|
232
|
+
result << "<a href='#' style='font-size:smaller;white-space:nowrap' onClick=\"document.getElementById('tml_other_link_#{uniq_id}').style.display='inline'; document.getElementById('tml_other_elements_#{uniq_id}').style.display='none'; return false;\"> "
|
233
233
|
result << language.translate(list_options[:less], list_options[:description], {}, options)
|
234
234
|
result << "</a>"
|
235
235
|
end
|
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.1.
|
4
|
+
version: 5.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Berkovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|