Sha256: c972cebad1e227307cbc224102757e6015c4f74175f450b627326e36e1b9ad4e

Contents?: true

Size: 887 Bytes

Versions: 21

Compression:

Stored size: 887 Bytes

Contents

module TranslationCenter
  module ApplicationHelper

    # get the current user the language translating from
    def from_lang
      session[:lang_from]
    end

    # get the current user the language translating to
    def to_lang
      session[:lang_to]
    end

    # returns the display name of the language
    def language_name(lang)
      TranslationCenter::CONFIG['lang'][lang.to_s]
    end

    # returns the current status filter for translation keys
    def current_filter
      session[:current_filter]
    end

    # returns true if the current filter is equal to the passed filter
    def current_filter_is?(filter)
      session[:current_filter] == filter
    end

    # returns true if the current user can admin translations
    def translation_admin?
      current_user.respond_to?(:can_admin_translations?) && current_user.can_admin_translations?
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
translation_center-1.2.0 app/helpers/translation_center/application_helper.rb
translation_center-1.1.0 app/helpers/translation_center/application_helper.rb
translation_center-1.0.4 app/helpers/translation_center/application_helper.rb
translation_center-1.0.3 app/helpers/translation_center/application_helper.rb
translation_center-1.0.2 app/helpers/translation_center/application_helper.rb
translation_center-1.0.1 app/helpers/translation_center/application_helper.rb
translation_center-1.0.0 app/helpers/translation_center/application_helper.rb
translation_center-0.0.14 app/helpers/translation_center/application_helper.rb
translation_center-0.0.13 app/helpers/translation_center/application_helper.rb
translation_center-0.0.12 app/helpers/translation_center/application_helper.rb
translation_center-0.0.11 app/helpers/translation_center/application_helper.rb
translation_center-0.0.10 app/helpers/translation_center/application_helper.rb
translation_center-0.0.9 app/helpers/translation_center/application_helper.rb
translation_center-0.0.8 app/helpers/translation_center/application_helper.rb
translation_center-0.0.7 app/helpers/translation_center/application_helper.rb
translation_center-0.0.6 app/helpers/translation_center/application_helper.rb
translation_center-0.0.5 app/helpers/translation_center/application_helper.rb
translation_center-0.0.4 app/helpers/translation_center/application_helper.rb
translation_center-0.0.3 app/helpers/translation_center/application_helper.rb
translation_center-0.0.2 app/helpers/translation_center/application_helper.rb