module Pagy::I18n

def translate(locale, key, **opts)

Translate and pluralize the key with the locale DATA
def translate(locale, key, **opts)
  data, pluralize = DATA[locale]
  translation = data[key] || (opts[:count] && data[key += ".#{pluralize.call(opts[:count])}"]) \
                  or return %([translation missing: "#{key}"])
  translation.gsub(/%{[^}]+?}/) { |match| opts[:"#{match[2..-2]}"] || match }
end