Sha256: d5377e3ad76cd84aad9225b183b3dbb59cb8670b3b44dabf055107e10285e4b3

Contents?: true

Size: 470 Bytes

Versions: 8

Compression:

Stored size: 470 Bytes

Contents

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

class Pagy
  # Use ::I18n gem
  module Frontend

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

    # unload the pagy default constant for efficiency
    Pagy::I18n.clear.instance_eval do
      undef :load
      undef :t
    end

    module UseI18nGem
      def pagy_t(key, **opts) = ::I18n.t(key, **opts)
    end
    prepend UseI18nGem

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pagy-4.7.1 lib/pagy/extras/i18n.rb
pagy-4.7.0 lib/pagy/extras/i18n.rb
pagy-4.6.0 lib/pagy/extras/i18n.rb
pagy-4.5.1 lib/pagy/extras/i18n.rb
pagy-4.5.0 lib/pagy/extras/i18n.rb
pagy-4.4.0 lib/pagy/extras/i18n.rb
pagy-4.3.0 lib/pagy/extras/i18n.rb
pagy-4.2.0 lib/pagy/extras/i18n.rb