OpenSlides / OpenSlides/openslides-backend

Improve translation in `organization.initial_import` action

Open
#2,764 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement translation
Dominant language
Python
Stars
9
Forks
40
Avg merge
1d 22h
Merged PRs (30d)
19

Description

When setting up a fresh instance of OpenSlides and calling the organization.initial_import action (using the manage tools intial-data command), the default initial data is taken from the backend and only contains english config and names. Though the action will translate some strings, it will use the default_language key from the initial data itself (see https://github.com/OpenSlides/openslides-backend/blob/2fae79474932c8ca9d0b55d3542e330b11079726/openslides_backend/action/actions/organization/initial_import.py#L93) which of course is en.

The user can provide custom data to use. But if they wanted to translate default strings they would have to pass a copy of the default data with the default_language set to a different value.

So I propose to expand the initial_import action to accept a new optional key language in the payload. This value should override the default_language in the data that is imported and therefore also set the translation language.

Debatable is, how the action should handle if custom data is passed (i.e. data != []) and language is set.
Options include:

  • Override default_language even in the custom data
  • Ignore language if custom data is passed
  • Reject request

Additionally the fields to be translated should be expanded. At the moment these are

organization/legal_notice  
organization/login_text  
organization/users_email_subject  
organization/users_email_body  
theme/name

but IMO should in the future also include

organization/name      
gender/name      

Consequently the translation database should be checked for these new translation strings, which I am sure @emanuelschuetze would be happy to do.
@rrenkert I am aware this issue is just too late to be considered for this sprint. You may decide how this should be prioritized. IMO this is not time critical.

If this is implemented the mange tool will also need to be adjusted in order to use this.
I can do that. However doing it in backend is step one.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with openslides_backend/action/actions/organization/initial_import.py and the referenced global/data/initial-data.json, then trace the organization.initial_import action and its manage-tools initial-data entry point. Resolve how language should interact with custom data, expand the listed translation fields, and verify that the backend and manage tool use the selected language for the default import.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, 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.