Skip to content

Commit

Permalink
FEATURE #3895 fixed
Browse files Browse the repository at this point in the history
git-svn-id: file:///svn/fedena2.1/branches/fedena2.1_i18n@4127 1b8ff446-76f8-11e0-a33c-ba5893e5f458
  • Loading branch information
foradian committed Jan 28, 2013
1 parent 88d4d56 commit ee88c1a
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions vendor/plugins/translator/lib/translator.rb
Expand Up @@ -163,18 +163,6 @@ def self.strict_mode(enable_strict = true)
end
end

#I18n.backend = I18n::Backend::ActiveRecord.new

# for translations that don't exist in the database, fallback to the Simple Backend which loads the default English Rails YAML files
# I18nSimpleBackend = I18n::Backend::Simple.new
# I18n.exception_handler = lambda do |exception, locale, key, options|
# case exception
# when I18n::MissingTranslationData
# I18nSimpleBackend.translate(:en, key, options || {})
# else
# puts exception
# end
# end
# Get if it is in strict mode
def self.strict_mode?
@@strict_mode
Expand Down Expand Up @@ -262,7 +250,6 @@ def strict_i18n_exception_handler(exception, locale, key, options)
module ActionView #:nodoc:
class Base
# Redefine the +translate+ method in ActionView (contributed by TranslationHelper) that is
# context-aware of what view (or partial) is being rendered.
# Initial scoping will be scoped to [:controller_name :view_name]
def translate_with_context(key, options={})
# default to an empty scope
Expand Down Expand Up @@ -328,8 +315,7 @@ def translate_with_context(key, options={})

module ActiveRecord #:nodoc:
class Base
# Add a +translate+ (or +t+) method to ActiveRecord that is context-aware of what model is being invoked.
# Initial scoping of [:model_name] where model name is like 'blog_post' (singular - *not* the table name)

def translate(key, options={})
Translator.translate_with_scope([self.class.name.underscore], key, options)
end
Expand All @@ -352,7 +338,7 @@ module ActionMailer #:nodoc:
class Base

# Add a +translate+ (or +t+) method to ActionMailer that is context-aware of what mailer and action
# is being invoked. Initial scoping of [:mailer_name :action_name] where mailer_name is like 'comment_mailer'

# and action_name is 'comment_notification' (note: no "deliver_" or "create_")
def translate(key, options={})
Translator.translate_with_scope([self.mailer_name, self.action_name], key, options)
Expand Down

0 comments on commit ee88c1a

Please sign in to comment.