Sha256: ca7a46d32a6e2eba725559ec43e2d6d7ed661f8b45c722fae5fc9699a71fa7c9

Contents?: true

Size: 454 Bytes

Versions: 2

Compression:

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

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

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pagy-4.1.0 lib/pagy/extras/i18n.rb
pagy-4.0.0 lib/pagy/extras/i18n.rb