Altinn / Altinn/app-lib-dotnet

Frontend language change should inform the backend

Open
#16 2 comments 1 reaction 0 assignees View on GitHub
kind/feature-request org/ssb
Dominant language
C#
Stars
8
Forks
27
Avg merge
1h 21m
Merged PRs (30d)
7

Description

### Description

Language support was added in [this PR](/Altinn/app-template-dotnet/pull/85), by having an app return all the supported languages to the frontend for the language selector to work. However, when the app language is changed in frontend, the backend is not informed about it in any way, which makes it impossible for validation messages etc to be adjusted.

### Suggestion
- Add/set a cookie from frontend informing the backend about the language change. This should be validated against the available languages on the backend, and an internal API should expose it.
- Invoke `ProcessDataRead` again after changing the language, making it possible to manipulate the data model after language changes.

### Additional Information

[Discussion on slack](https://altinn.slack.com/archives/C02EVE4RU82/p1662126535410549)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the frontend language-change flow and the backend ProcessDataRead entry point. Determine how the selected language can reach the backend, how available languages are validated and exposed internally, and when ProcessDataRead runs again. Done means backend validation and other language-sensitive behavior reflect the frontend selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, backend-api-design, frontend, internationalization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.