Sha256: 3624eb2f176dabcad57f9a1c6f910955f92e896b1800f0fe46c4e9cf07616007
Contents?: true
Size: 785 Bytes
Versions: 28
Compression:
Stored size: 785 Bytes
Contents
# See the Pagy documentation: https://ddnexus.github.io/pagy/docs/extras/i18n # frozen_string_literal: true class Pagy # :nodoc: # Use ::I18n gem module I18nExtra # Frontend overriding for translation module FrontendOverride def pagy_t(key, **opts) ::I18n.t(key, **opts) end end Frontend.prepend I18nExtra::FrontendOverride # Calendar overriding for localization (see also the block in the calendar section of the config/pagy.rb initializer) module CalendarOverride def localize(time, opts) ::I18n.l(time, **opts) end end end Calendar.prepend I18nExtra::CalendarOverride if defined?(Calendar) # Add the pagy locales to the I18n.load_path ::I18n.load_path += Dir[Pagy.root.join('locales', '*.yml')] end
Version data entries
28 entries across 28 versions & 1 rubygems