From 56ba1638b24434e468c961283382900be48131a8 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Mon, 30 Aug 2010 22:58:56 +1200 Subject: [PATCH] Sometimes we don't need to change the translation, like when the key exists. --- vendor/refinerycms/core/lib/refinery/application_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vendor/refinerycms/core/lib/refinery/application_helper.rb b/vendor/refinerycms/core/lib/refinery/application_helper.rb index 9e7b9f00dc..bd13c5f9df 100644 --- a/vendor/refinerycms/core/lib/refinery/application_helper.rb +++ b/vendor/refinerycms/core/lib/refinery/application_helper.rb @@ -4,7 +4,11 @@ module ApplicationHelper include Refinery::HtmlTruncationHelper def t(key, options = {}) - super.to_s.gsub(/]*>/, 'i18n: ').gsub('', '').gsub(', ', '.') + if (val = super) =~ /class.+?translation_missing/ + val = val.to_s.gsub(/]*>/, 'i18n: ').gsub('', '').gsub(', ', '.') + end + + val end # This is used to display the title of the current object (normally a page) in the browser's titlebar.