Sha256: 4dc54bebcced3fb4ad07cca83a0e79a211936d171f43ab88eded7289bbb9e5cc

Contents?: true

Size: 523 Bytes

Versions: 26

Compression:

Stored size: 523 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Log
    module ValueTypes
      # This class presents the given value as a locale. Check
      # the `DefaultPresenter` for more info on how value
      # presenters work.
      class LocalePresenter < DefaultPresenter
        # Public: Presents the value as a locale.
        #
        # Returns an HTML-safe String.
        def present
          return unless value
          I18n.with_locale(value) { I18n.t("locale.name") }
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
decidim-core-0.18.1 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.17.2 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.18.0 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.17.1 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.16.1 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.17.0 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.16.0 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.15.2 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.15.1 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.15.0 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.14.4 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.14.3 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.14.2 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.14.1 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.13.1 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.12.2 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.13.0 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.12.1 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.13.0.pre1 app/presenters/decidim/log/value_types/locale_presenter.rb
decidim-core-0.12.0 app/presenters/decidim/log/value_types/locale_presenter.rb