OpenSlides / OpenSlides/openslides-client
Improve translation mapping for enum like types
@bastianjoel is already working on this.
Since Apr 24, 2026.
- Dominant language
- TypeScript
- Stars
- 35
- Forks
- 52
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 52
Description
We currently do not have a consistent way to handle translation of things like enums. These usually come from the database as strings and need to be mapped to a human readable word.
One way we currently deal with this is by defining constant objects that can be used throughout the application. When we want to use them in a component we either have to add those as a public attribute or add them to the view model as <field>Verbose.
https://github.com/OpenSlides/openslides-client/blob/b5da8307ad7f9075a383c73b2a3bfe5d059576f1/client/src/app/site/pages/meetings/pages/polls/view-models/view-poll.ts#L76
Neither of those options is ideal as this always requires searching for those types and potentially overseeing them. Also both ways are quite verbose.
To improve the situation a central file that contains keyed translations should be created.
This file should contain key value pairs of enums/models and everything else that should be mapped from database strings.
This should be implemented with the missing translation handler. Keyed translations should get a prefix like ..
#5534 will implement this. This issue is for documentation and to keep track of adoption.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.