Sha256: dc20028304582fc9877e404b6b776751b94ef3eddcd021839044895c90493504
Contents?: true
Size: 513 Bytes
Versions: 41
Compression:
Stored size: 513 Bytes
Contents
# frozen_string_literal: true module I18n::Tasks module LocaleList module_function # @return locales converted to strings, with base locale first, the rest sorted alphabetically def normalize_locale_list(locales, base_locale, include_base = false) locales = Array(locales).map(&:to_s).sort if locales.include?(base_locale) [base_locale] + (locales - [base_locale]) elsif include_base [base_locale] + locales else locales end end end end
Version data entries
41 entries across 41 versions & 3 rubygems