Add to localized content. For #850

v3-stable
Thomas Reynolds 2015-06-01 11:32:11 -07:00
parent 7eedf6b28f
commit 68adbfeb2a
1 changed files with 7 additions and 0 deletions

View File

@ -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