Merge pull request #756 from bhollis/yaml
l18n: Should load both locales/*.yml and locales/*.yaml files
This commit is contained in:
commit
7f7ce07910
1 changed files with 3 additions and 3 deletions
|
@ -26,9 +26,9 @@ module Middleman
|
|||
|
||||
def initialize(app, options={})
|
||||
@app = app
|
||||
@locales_glob = File.join(app.locales_dir, "**", "*.{rb,yml}")
|
||||
@locales_glob = File.join(app.locales_dir, "**", "*.{rb,yml,yaml}")
|
||||
|
||||
regex = @locales_glob.sub(/\./, '\.').sub(File.join("**", "*"), ".*").sub(/\//, '\/').sub("{rb,yml}", "rb|yml")
|
||||
regex = @locales_glob.sub(/\./, '\.').sub(File.join("**", "*"), ".*").sub(/\//, '\/').sub("{rb,yml,yaml}", "rb|ya?ml")
|
||||
@locales_regex = %r{^#{regex}}
|
||||
|
||||
@maps = {}
|
||||
|
@ -81,7 +81,7 @@ module Middleman
|
|||
def langs
|
||||
@options[:langs] || begin
|
||||
Dir[File.join(@app.root, @locales_glob)].map { |file|
|
||||
File.basename(file).sub(/\.yml$/, "").sub(/\.rb$/, "")
|
||||
File.basename(file).sub(/\.ya?ml$/, "").sub(/\.rb$/, "")
|
||||
}.sort.map(&:to_sym)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue