From 68adbfeb2abcc127bbd7c7977aa73e6c180805ad Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Mon, 1 Jun 2015 11:32:11 -0700 Subject: [PATCH] Add to localized content. For #850 --- middleman-core/lib/middleman-more/core_extensions/i18n.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/middleman-core/lib/middleman-more/core_extensions/i18n.rb b/middleman-core/lib/middleman-more/core_extensions/i18n.rb index 4a149237..0bf6b792 100644 --- a/middleman-core/lib/middleman-more/core_extensions/i18n.rb +++ b/middleman-core/lib/middleman-more/core_extensions/i18n.rb @@ -27,6 +27,8 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension app.config.define_setting :locales_dir, 'locales', 'The directory holding your locale configurations' + ::Middleman::Sitemap::Resource.send :attr_accessor, :locale_root_path + app.send :include, LocaleHelpers end @@ -206,6 +208,11 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension def to_resource(app) p = ::Middleman::Sitemap::Resource.new(app.sitemap, path) p.proxy_to(source_path) + + templates_dir = app.extensions[:i18n].options[:templates_dir] + + p.locale_root_path = source_path.gsub(templates_dir, '') + p end end