Sha256: 5da5e5e714c0b7ef093bb972a7d5d9006fb9fd28c678351cef36c28d804908f5

Contents?: true

Size: 499 Bytes

Versions: 8

Compression:

Stored size: 499 Bytes

Contents

# See the Pagy documentation: https://ddnexus.github.io/pagy/extras/i18n
# encoding: utf-8
# frozen_string_literal: true

class Pagy
  # Use ::I18n gem
  module Frontend

    ::I18n.load_path += Dir[Pagy.root.join('locales', '*.yml')]

    Pagy::I18n.clear.instance_eval { undef :load; undef :t } # unload the pagy default constant for efficiency

    # no :pagy_without_i18n alias with the i18n gem
    def pagy_t_with_i18n(*args) ::I18n.t(*args) end
    alias :pagy_t :pagy_t_with_i18n

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pagy-2.1.5 lib/pagy/extras/i18n.rb
pagy-2.1.4 lib/pagy/extras/i18n.rb
pagy-2.1.3 lib/pagy/extras/i18n.rb
pagy-2.1.2 lib/pagy/extras/i18n.rb
pagy-2.1.1 lib/pagy/extras/i18n.rb
pagy-2.1.0 lib/pagy/extras/i18n.rb
pagy-2.0.1 lib/pagy/extras/i18n.rb
pagy-2.0.0 lib/pagy/extras/i18n.rb