Sha256: 0c273b59d81c4f00ad133db48905a373488cffa861f0d3e298eac7cd7331307d

Contents?: true

Size: 500 Bytes

Versions: 16

Compression:

Stored size: 500 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

    alias_method :pagy_without_i18n, :pagy_t
    def pagy_t_with_i18n(*args) ::I18n.t(*args) end
    alias_method :pagy_t, :pagy_t_with_i18n

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
pagy-3.8.0 lib/pagy/extras/i18n.rb
pagy-3.7.5 lib/pagy/extras/i18n.rb
pagy-3.7.4 lib/pagy/extras/i18n.rb
pagy-3.7.3 lib/pagy/extras/i18n.rb
pagy-3.7.2 lib/pagy/extras/i18n.rb
pagy-3.7.1 lib/pagy/extras/i18n.rb
pagy-3.7.0 lib/pagy/extras/i18n.rb
pagy-3.6.0 lib/pagy/extras/i18n.rb
pagy-3.5.1 lib/pagy/extras/i18n.rb
pagy-3.5.0 lib/pagy/extras/i18n.rb
pagy-3.4.1 lib/pagy/extras/i18n.rb
pagy-3.4.0 lib/pagy/extras/i18n.rb
pagy-3.3.2 lib/pagy/extras/i18n.rb
pagy-3.3.1 lib/pagy/extras/i18n.rb
pagy-3.3.0 lib/pagy/extras/i18n.rb
pagy-3.2.1 lib/pagy/extras/i18n.rb