Skip to content

Commit

Permalink
removed warning for locales zh-cn and zh-hk, and properly renamed as …
Browse files Browse the repository at this point in the history
…zh-CN and zh-HK
  • Loading branch information
ddnexus committed Apr 25, 2019
1 parent 2548557 commit ec7d754
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lib/locales/utils/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,10 @@
end
end

normalized_locales = {'zh-cn'=>'zh-CN', 'zh-hk'=>'zh-HK'}

# loader proc
lambda do |i18n, *args|
i18n.clear
args.each do |arg|
if normalized_locales.key?(arg[:locale])
right_locale = normalized_locales[arg[:locale]]
Warning.warn("\n*** WARNING *** [Pagy::I18n.load] The '#{arg[:locale]}' locale is incorrect and deprecated, please use '#{right_locale}'\n\n")
arg[:locale] = right_locale
end
arg[:filepath] ||= Pagy.root.join('locales', "#{arg[:locale]}.yml")
arg[:pluralize] ||= p11n[arg[:locale]]
hash = YAML.load(File.read(arg[:filepath], encoding: 'UTF-8')) #rubocop:disable Security/YAMLLoad
Expand Down

0 comments on commit ec7d754

Please sign in to comment.