From daca503b43517cf76aeda464246efe156db52c76 Mon Sep 17 00:00:00 2001 From: Kevin Ngai Date: Wed, 11 Jan 2023 23:05:14 -0800 Subject: [PATCH] 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 --- pygeoapi/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygeoapi/api.py b/pygeoapi/api.py index de3b9a2..0624094 100644 --- a/pygeoapi/api.py +++ b/pygeoapi/api.py @@ -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