From 7e0ae0e59ca5b5603a28183cb9edcc89e190c8a3 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sat, 9 Feb 2013 10:15:25 -0800 Subject: [PATCH] Support .yaml files for i18n --- middleman-more/lib/middleman-more/core_extensions/i18n.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/middleman-more/lib/middleman-more/core_extensions/i18n.rb b/middleman-more/lib/middleman-more/core_extensions/i18n.rb index 534f4ad8..26b2f8a0 100644 --- a/middleman-more/lib/middleman-more/core_extensions/i18n.rb +++ b/middleman-more/lib/middleman-more/core_extensions/i18n.rb @@ -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