lib/gettext/runtime/locale_path.rb in gettext-2.2.1 vs lib/gettext/runtime/locale_path.rb in gettext-2.3.0

- old
+ new

@@ -54,13 +54,15 @@ load_path = $LOAD_PATH.dup load_path.map!{|v| v.match(/(.*?)(\/lib)*?$/); $1} load_path.each {|path| default_path_rules += [ - "#{path}/data/locale/%{lang}/LC_MESSAGES/%{name}.mo", - "#{path}/data/locale/%{lang}/%{name}.mo", - "#{path}/locale/%{lang}/%{name}.mo"] + "#{path}/data/locale/%{lang}/LC_MESSAGES/%{name}.mo", + "#{path}/data/locale/%{lang}/%{name}.mo", + "#{path}/locale/%{lang}/LC_MESSAGES/%{name}.mo", + "#{path}/locale/%{lang}/%{name}.mo", + ] } # paths existed only. default_path_rules = default_path_rules.select{|path| Dir.glob(path % {:lang => "*", :name => "*"}).size > 0}.uniq default_path_rules @@ -83,10 +85,10 @@ end @locale_paths = {} path_rules.each do |rule| this_path_rules = rule % {:lang => "([^\/]+)", :name => name} - Dir.glob(rule %{:lang => "*", :name => name}).each do |path| + Dir.glob(rule % {:lang => "*", :name => name}).each do |path| if /#{this_path_rules}/ =~ path @locale_paths[$1] = path.untaint unless @locale_paths[$1] end end end