Skip to content

🌐(i18n) make the default language configurable - #1968

Open
Jachimoo wants to merge 1 commit into
suitenumerique:mainfrom
Jachimoo:make-default-language-configurable
Open

Jachimoo wants to merge 1 commit into
suitenumerique:mainfrom
Jachimoo:make-default-language-configurable

Conversation

@Jachimoo

Copy link
Copy Markdown

Description

The fallback language was hardcoded to French, so self-hosters outside France had to patch the code to serve another default language. This change reads the fallback from the VITE_DEFAULT_LANGUAGE build-time variable instead, keeps French as the default, and silently ignores unsupported values.

What it does

  • src/frontend/src/i18n/init.ts: extract the supported languages into a shared supportedLngs constant, read the fallback from VITE_DEFAULT_LANGUAGE and validate it against that list
  • src/frontend/Dockerfile: forward the new build argument to the frontend build
  • src/frontend/src/vite-env.d.ts: type the new variable
  • docs/self-hosting/configuration/theming.md: document the setting alongside the other build-time variables

How to test

docker build \
  -f src/frontend/Dockerfile \
  --target frontend-production \
  --build-arg VITE_DEFAULT_LANGUAGE="en" \
  -t meet-frontend:test .

Then open the app in a browser whose language is not supported (e.g. it-IT): the UI falls back to English instead of French.

Checks run locally

  • npm run lint (eslint) — pass
  • npm run check (prettier) — pass
  • npm test (vitest, 41 tests) — pass
  • npx tsc -b (typecheck) — pass

The fallback language was hardcoded to French, so changing it required a
code change. Read it from the VITE_DEFAULT_LANGUAGE build variable
instead, keep French as the default, and ignore unsupported values. The
Dockerfile forwards the variable to the frontend build, and the new
setting is documented alongside the other build-time variables.
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

2 participants