module TranslationPanel
Public Class Methods
get_value(key)
click to toggle source
# File lib/translation_panel.rb, line 33 def get_value(key) I18n.translate! key, :fallback => "no" rescue "" end
kill!()
click to toggle source
# File lib/translation_panel.rb, line 12 def kill! Thread.current[:translations_list] = nil Thread.current[:collect_translation_data] = nil end
push(value)
click to toggle source
# File lib/translation_panel.rb, line 21 def push value Thread.current[:translations_list] << value end
show!()
click to toggle source
# File lib/translation_panel.rb, line 7 def show! Thread.current[:translations_list] = [] Thread.current[:collect_translation_data] = true end
show?()
click to toggle source
# File lib/translation_panel.rb, line 17 def show? Thread.current[:collect_translation_data] end
values()
click to toggle source
# File lib/translation_panel.rb, line 25 def values Thread.current[:collect_translation_data] = false Thread.current[:translations_list].uniq.map do |key| value = get_value(key) {:key => key, :value => value} if value.is_a?(String) end.compact end