tml 5.1.2 → 5.1.3

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: c4ae1644d633f0f8ead496d5ac732ccd9dcbc34c
4
- data.tar.gz: b92c379114a8878d85a27b997c098319cd756eca
3
+ metadata.gz: 0300e4226b97cf3ce5cd8fca0a4d59c27a13f2de
4
+ data.tar.gz: f774ba24f23e3a76e8820d43e3d8b7551c54f7da
5
5
  SHA512:
6
- metadata.gz: 9fd13088aa2fbc7f9f02a5c424e62c35111ec4f2edcba5cb2b8e2d02f1a9839e9d199b9545c20ae001ad82190b3546fe1e61e1e0d65ca241f3d7fdd6cb5d81a5
7
- data.tar.gz: e4b4cd7014d4c3fb5bc6a8b81f94532ce036054338912d802dce3c8e8c4c249238a1121d7d58e51e903e98531c2485513dd0e021c83247f17c79fb0f8c7ceb10
6
+ metadata.gz: 31ee76daca1aadeaa2a7ebd9f0fca81f8d61d72cced0419c70a91b65e5551e1bc66432748d15aeea17f541bbb6c2ebe95b12df438cff046e2a45455f512d31ca
7
+ data.tar.gz: a4dbb6d81dd70b481cf5a75210d64ad77582c994db9013bad378f59116326fdabc09c3677cd4af6ddbd5888a6428a0f71f841df2cf445b8504c4ebf2526b59cf
@@ -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("Failed to retrieve data: #{key}")
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 = '', options = {})
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
 
@@ -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=\"Tml.Utils.Effects.hide('tml_other_link_#{uniq_id}'); Tml.Utils.Effects.show('tml_other_elements_#{uniq_id}'); return false;\">"
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=\"Tml.Utils.Effects.show('tml_other_link_#{uniq_id}'); Tml.Utils.Effects.hide('tml_other_elements_#{uniq_id}'); return false;\"> "
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
@@ -30,5 +30,5 @@
30
30
  #++
31
31
 
32
32
  module Tml
33
- VERSION = '5.1.2'
33
+ VERSION = '5.1.3'
34
34
  end
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.2
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-05 00:00:00.000000000 Z
11
+ date: 2015-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday