Fix calls of render_j2_template() to pass in request.locale as the param (not SYSTEM_LOCALE) in order to apply proper translations for /jobs/**/*.html pages and /collection/tiles/index.html templates (#1094)
Co-authored-by: Kevin Ngai <afswken@geomet-dev-03.cmc.ec.gc.ca>
This commit is contained in:
+3
-3
@@ -2612,7 +2612,7 @@ class API:
|
||||
|
||||
content = render_j2_template(self.config,
|
||||
'collections/tiles/index.html', tiles,
|
||||
SYSTEM_LOCALE)
|
||||
request.locale)
|
||||
|
||||
return headers, HTTPStatus.OK, content
|
||||
|
||||
@@ -3281,7 +3281,7 @@ class API:
|
||||
'now': datetime.now(timezone.utc).strftime(DATETIME_FORMAT)
|
||||
}
|
||||
response = render_j2_template(self.config, j2_template, data,
|
||||
SYSTEM_LOCALE)
|
||||
request.locale)
|
||||
return headers, HTTPStatus.OK, response
|
||||
|
||||
return headers, HTTPStatus.OK, to_json(serialized_jobs,
|
||||
@@ -3462,7 +3462,7 @@ class API:
|
||||
}
|
||||
content = render_j2_template(
|
||||
self.config, 'jobs/results/index.html',
|
||||
data, SYSTEM_LOCALE)
|
||||
data, request.locale)
|
||||
|
||||
return headers, HTTPStatus.OK, content
|
||||
|
||||
|
||||
Reference in New Issue
Block a user