Skip to content

WIP: Internationalization and localization #892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

matthiasschaub
Copy link
Collaborator

@matthiasschaub matthiasschaub commented Mar 8, 2025

Description

This PR uses FastAPI-I18N to configure gettextfor each request based on the accept-language header.

It also uses babel to work with message catalogs.

Currently, indicator metadata and result string templates are translated.

Corresponding issue

Closes #

New or changed dependencies

  • babel
  • fastapi-i18n

Checklist

  • I have ensured my branch is mergeable with main (e.g. through git rebase main if necessary)
  • My code follows the style guide and was checked with pre-commit before committing
  • I have commented my code
  • I have added sufficient unit and integration tests
  • I have added new Hurl regression tests and checked all existing tests
  • I have updated the CHANGELOG.md

Todos

  • Add unit tests for successful translation of result string templates.
  • Add integration tests (API) which tests the fallback to Englishh if no accept-language header is set, accept-header is set but does not exist and fastapi-i18n is not configured properly.
  • Update environment var mock to not use absolute path.
  • Translate figure

call translate on input parameters before indicator metadata and
indicator result template models are initialized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant