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:
Kevin Ngai
2023-01-11 23:05:14 -08:00
committed by GitHub
parent 2e1f181461
commit daca503b43
+3 -3
View File
@@ -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