Module: TranslationCenter::CenterHelper

Defined in:
app/helpers/translation_center/center_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_change(attribute, value) ⇒ Object

returns a human readable view of the changes



5
6
7
8
9
10
11
12
13
# File 'app/helpers/translation_center/center_helper.rb', line 5

def format_change(attribute, value)
  # if value is an array then changed value
  if value.is_a? Array 
    "<span class=\"label label-info\">#{attribute}</span> changed from <span class=\"label label-important\">#{value[0]}</span> to <span class=\"label label-success\">#{value[1]}</span>".html_safe
  # else value is new
  else
    "<span class=\"label label-info\">#{attribute}</span> has new value <span class=\"label label-success\">#{value}</span>".html_safe
  end
end

#translator_identifier_placeholderObject



15
16
17
# File 'app/helpers/translation_center/center_helper.rb', line 15

def translator_identifier_placeholder
  "#{TranslationCenter::CONFIG['translator_type']} #{TranslationCenter::CONFIG['identifier_type']}".upcase
end