Sha256: 63e5f2db1824bc40b1c493e6b95c11c8cce82a2c1a51d61ecf5e692f38bd07dc

Contents?: true

Size: 1.65 KB

Versions: 7

Compression:

Stored size: 1.65 KB

Contents

#--
# Copyright (c) 2010-2011 Michael Berkovich
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

module Tr8n::BaseHelper

  # for admin translations
  def tra(label, desc = "", tokens = {}, options = {})
    if Tr8n::Config.enable_admin_translations?
      if Tr8n::Config.enable_admin_inline_mode?
        tr(label, desc, tokens, options)
      else
        trl(label, desc, tokens, options)
      end
    else
      Tr8n::Config.default_language.translate(label, desc, tokens, options)
    end
  end
  
  # for admin translations
  def trla(label, desc = "", tokens = {}, options = {})
    tra(label, desc, tokens, options.merge(:skip_decorations => true))
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tr8n-3.1.8 app/helpers/tr8n/base_helper.rb
tr8n-3.1.7 app/helpers/tr8n/base_helper.rb
tr8n-3.1.6 app/helpers/tr8n/base_helper.rb
tr8n-3.1.5 app/helpers/tr8n/base_helper.rb
tr8n-3.1.4 app/helpers/tr8n/base_helper.rb
tr8n-3.1.3 app/helpers/tr8n/base_helper.rb
tr8n-3.1.2 app/helpers/tr8n/base_helper.rb