Skip to content
Permalink
Browse files

Propagate culture from temper to page renderer.

  • Loading branch information...
waldez committed Aug 20, 2019
1 parent 7ed0080 commit 30ffe32c36e7531323df357afffca6835f3a8fa8
Showing with 4 additions and 4 deletions.
  1. +2 −2 libs/page_rendering/page_renderer.js
  2. +2 −2 libs/temper/temper.js
@@ -131,12 +131,12 @@ page_renderer.prototype.render_file_by_template_path_extend_context = function (

}

page_renderer.prototype.render_file_by_template_path_replace_context = function (context_path, context) {
page_renderer.prototype.render_file_by_template_path_replace_context = function (context_path, context, culture) {
const self = this
context = context || {}

const template_path = get_absolute_template_path_by_context_path(context_path)
const culture = enduro.config.cultures[0]
culture = culture || enduro.config.cultures[0]

return self.render_file_by_context(template_path, context, culture)
}
@@ -12,7 +12,7 @@ const page_renderer = require(enduro.enduro_path + '/libs/page_rendering/page_re
const abstractor = require(enduro.enduro_path + '/libs/abstractor/abstractor')

// Goes through the pages and renders them
temper.prototype.render = function (filename, context) {
temper.prototype.render = function (filename, context, culture) {

// use empty object if no context is provided
context = context || {}
@@ -21,7 +21,7 @@ temper.prototype.render = function (filename, context) {

return abstractor.abstract_context(context)
.then((context) => {
return page_renderer.render_file_by_template_path_replace_context(filename, context)
return page_renderer.render_file_by_template_path_replace_context(filename, context, culture)
})
}

0 comments on commit 30ffe32

Please sign in to comment.
You can’t perform that action at this time.