Sha256: 09d0630b6106bdc20bb8d8349e8d31af9d12afaffe13b3b8f35ec0e007271b4a

Contents?: true

Size: 648 Bytes

Versions: 1

Compression:

Stored size: 648 Bytes

Contents

module I18nViz
  module ViewHelpers

    def translate(key, options = {}) # TODO: alias
      if display_i18n_viz? && options[:i18n_viz] != false
        "#{super(key, options)}--#{key}--"
      else
        super(key, options)
      end
    end
    alias :t :translate
    
    def i18n_viz_include_tag # TODO: doesn't work yet
      return unless display_i18n_viz?
      
      stylesheet_link_tag("i18n_viz")
      javascript_tag "var i18n_viz_key_url = '#{I18nViz.key_url}';"
      javascript_include_tag "i18n_viz"
    end

    def display_i18n_viz?
      I18nViz.enabled? && defined?(params) && defined?(params[:i18n_viz])
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
i18n_viz-0.0.1 lib/i18n_viz/view_helpers.rb