Skip to content

lang Query Parameter nor Content-Language Request Header Not Persisting in pygeoapi When Accessed from QGIS or HTML Interfaces #1855

Open
@Youssef-Harby

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

  1. Connect to a pygeoapi service using QGIS with the URL including the ?lang=ar-EG query parameter.
  2. Verify that the initial response is in Arabic (Content-Language: ar-EG).
  3. Navigate to a collection or item within QGIS (e.g., http://0.0.0.0:5001/collections, itemsand conformance 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.
    Screenshot 2024-11-20 at 2 28 12 AM

  • Screenshots of expected (I made the only supported language in pygeoapi config yaml is ar-EG).
    Screenshot 2024-11-20 at 2 29 28 AM

  • Excerpts from QGIS debug logs demonstrating this behavior:

qgis-pygeoapi-ar.json

Environment

  • OS: macOS 15.1
  • Python version: 3.10
  • pygeoapi version: 0.19.dev0

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions