Skip to content

Add translation management #445

@ValentinFutterer

Description

@ValentinFutterer

Description
For more context see damap-org/damap-frontend#497, damap-org/damap-frontend#498, damap-org/damap-frontend#499, damap-org/damap-frontend#500

We need the backend to store and manage translations now, since the json files in the frontend code are not very userfriendly to change / impossible in the cloud version. Storing whole json files is too unwieldy and would make migrations very difficult to manage, so we decided to store the translation in the db like this:
key | default | custom | language | active

Proposed solution

  • Create a new table with the above columns
  • Prefill it with the new keys and old default values from Custom translations management: Translation file restructuring damap-frontend#497
  • Add GET endpoint to get all active translations
  • Add POST endpoint to create a new language (Admin only, should basically copy the english rows, replace the language column and keep the custom empty, default stays english)
  • Add PATCH endpoint to change custom values and active boolean (Admin only, default should never change)
  • Add DELETE endpoint to completely remove one language (except english, Admin only)

Alternative solution
Store translations as a json blob

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions