air18n 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ require 'air18n/priority'
9
9
  require 'air18n/reflection'
10
10
 
11
11
  module Air18n
12
- AIR18N_RESERVED_KEYS = [:routes_context, :suppress_ct, :default_is_low_priority, :disable_xss_check]
12
+ AIR18N_RESERVED_KEYS = [:routes_context, :suppress_ct, :default_is_low_priority, :disable_xss_check, :disable_bookkeeping]
13
13
 
14
14
  RTL_LOCALES = [ :he, :ar ]
15
15
 
@@ -78,6 +78,7 @@ module Air18n
78
78
  @phrase_screenshots.each do |key, routes|
79
79
  routes.delete(routes_context)
80
80
  end
81
+ nil
81
82
  end
82
83
 
83
84
  def guess_translation(text, orig_locale, other_locale)
@@ -156,7 +157,9 @@ module Air18n
156
157
  if locale == I18n.default_locale && default && result != default
157
158
  # If it doesn't, we need to update the 'phrases' table so that
158
159
  # the 'value' column reflects the latest English default text.
159
- LoggingHelper.info "Default English text for key '#{key}' changed! Old default '#{result}' != new default '#{default}'. Route context: #{options[:routes_context]}"
160
+ if result.present?
161
+ LoggingHelper.info "Default English text for key '#{key}' changed! Old default '#{result}' != new default '#{default}'. Route context: #{options[:routes_context]}"
162
+ end
160
163
  phrase = Phrase.find_or_create_by_key(key)
161
164
  if phrase
162
165
  if (overrides_previous_default && phrase.value != default) ||
@@ -293,9 +293,9 @@ module Air18n
293
293
  end
294
294
  end
295
295
 
296
- if key.is_a?(String)
296
+ if @priority.present? && key.is_a?(String) && options[:disable_bookkeeping].blank?
297
297
  # Handle bookkeeping of which translation keys are still used.
298
- @priority.key_used(key) if @priority
298
+ @priority.key_used(key)
299
299
  end
300
300
 
301
301
  result = result.html_safe if result && result.respond_to?(:html_safe)
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
data/make_gem CHANGED
@@ -1,5 +1,5 @@
1
1
  # Run this to push the new version of the gem to rubygems!
2
- v=0.0.8
2
+ v=0.0.9
3
3
  gem build air18n.gemspec
4
4
  gem push air18n-${v}.gem
5
5
 
@@ -51,6 +51,9 @@ describe Air18n do
51
51
  # Ignore non-string keys when computing priority.
52
52
  I18n.t(:'priority, key 2', :default => 'value 1')
53
53
  mock_priority.key_usage.should_not include(:'priority, key 2')
54
+
55
+ I18n.t('priority, key 3', :default => 'value 1', :disable_bookkeeping => true)
56
+ mock_priority.key_usage.should_not include('priority, key 3')
54
57
  end
55
58
  end
56
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: air18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2012-05-30 00:00:00.000000000 Z
16
+ date: 2012-06-22 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: i18n