Sha256: 5fc02a361c40760f8f18544560935c88a03e172c4b23fdaf9ee21a68914a7791

Contents?: true

Size: 477 Bytes

Versions: 41

Compression:

Stored size: 477 Bytes

Contents

module Refinery
  module Helpers
    module TranslationHelper

      # Overrides Rails' core I18n.t() function to produce a more helpful error message.
      # The default one wreaks havoc with CSS and makes it hard to understand the problem.
      def t(key, options = {})
        if (val = super) =~ /class.+?translation_missing/
          val = val.to_s.gsub(/<span[^>]*>/, 'i18n: ').gsub('</span>', '').gsub(', ', '.')
        end

        val
      end

    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
refinerycms-core-1.0.11 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.10 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.9 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.8 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.7 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.5 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.4 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.3 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.1 lib/refinery/helpers/translation_helper.rb
refinerycms-core-1.0.0 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.22 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.21 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.20 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.19 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.18 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.17 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.16 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.15 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.14 lib/refinery/helpers/translation_helper.rb
refinerycms-core-0.9.9.13 lib/refinery/helpers/translation_helper.rb