Skip to content

Commit

Permalink
Propagate culture from temper to page renderer.
Browse files Browse the repository at this point in the history
  • Loading branch information
waldez committed Aug 20, 2019
1 parent 7ed0080 commit 30ffe32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libs/page_rendering/page_renderer.js
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions libs/temper/temper.js
Expand Up @@ -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 || {}
Expand All @@ -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)
})
}

Expand Down

0 comments on commit 30ffe32

Please sign in to comment.