lang
Query Parameter nor Content-Language
Request Header Not Persisting in pygeoapi When Accessed from QGIS or HTML Interfaces #1855
Description
Description
When connecting to a pygeoapi service from QGIS using the ?lang=ar-EG
query parameter, the initial request respects the specified language and returns responses in Arabic. However, subsequent requests, such as navigating to specific collections or items (e.g., ?f=json
requests), do not persist the lang
parameter. This causes the responses to default back to the base language (en-US
), leading to inconsistent behavior in language settings.
Steps to Reproduce
- Connect to a pygeoapi service using QGIS with the URL including the
?lang=ar-EG
query parameter. - Verify that the initial response is in Arabic (
Content-Language: ar-EG
). - Navigate to a collection or item within QGIS (e.g.,
http://0.0.0.0:5001/collections
,items
andconformance
endpoints).
Expected behavior
The lang
query parameter should persist across all navigation requests. If ?lang=ar-EG
and Content-Language: ar-EG
are specified in the initial request, subsequent navigations should continue to respect this parameter until it is explicitly changed.
Screenshots/Tracebacks
-
Screenshots showing the initial request with
?lang=ar-EG
returning an English collections not Arabic.
-
Screenshots of expected (I made the only supported language in pygeoapi config yaml is ar-EG).
-
Excerpts from QGIS debug logs demonstrating this behavior:
Environment
- OS: macOS 15.1
- Python version: 3.10
- pygeoapi version: 0.19.dev0