translation_center 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -126,7 +126,7 @@ module TranslationCenter
126
126
  all_count = keys_count
127
127
  I18n.available_locales.each do |locale|
128
128
  stats[locale] = {}
129
- stats[locale]['name'] = TranslationCenter::CONFIG['lang'][locale.to_s]
129
+ stats[locale]['name'] = TranslationCenter::CONFIG['lang'][locale.to_s]['name']
130
130
 
131
131
  translated = translated_count(locale)
132
132
  pending = pending_count(locale)
@@ -24,7 +24,7 @@
24
24
  %td
25
25
  = change.auditable.lang
26
26
  %td
27
- = change.user.try TranslationCenter::CONFIG['identifier_type']
27
+ = change.auditable.user.try TranslationCenter::CONFIG['identifier_type']
28
28
  %td
29
29
  %ul
30
30
  - change.audited_changes.each do |change, value|
@@ -29,7 +29,7 @@ development:
29
29
  inspector: 'missing' # default missing
30
30
 
31
31
  # I18n.translate source
32
- i18n_source: 'db' # can be db or yaml; default is yaml
32
+ i18n_source: 'yaml' # can be db or yaml; default is yaml
33
33
 
34
34
  # when a new key is added to db, the value of the key is added as the default translation in English
35
35
  save_default_translation: true
@@ -74,7 +74,7 @@ module TranslationCenter
74
74
  if TranslationCenter::CONFIG['i18n_source'] == 'db' && options.delete(:yaml).blank?
75
75
  val = translation_key.accepted_translation_in(locale).try(:value) || options[:default]
76
76
  # replace variables in a translation with passed values
77
- options.each_pair{ |key, value| val.gsub!("%{#{key.to_s}}", value.to_s) }
77
+ options.each_pair{ |key, value| val.gsub!("%{#{key.to_s}}", value.to_s) } if val.is_a?(String)
78
78
  throw(:exception, I18n::MissingTranslation.new(locale, complete_key, options)) unless val
79
79
  wrap_span(val, translation_key)
80
80
  else
@@ -1,3 +1,3 @@
1
1
  module TranslationCenter
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end