zetkin / translators-interface

1 stars 0 forks source link

Backend - Add indentation config to Project model, and use in YAML locale file generation. #11

Closed richardolsson closed 3 years ago

richardolsson commented 3 years ago

Description

The different Zetkin projects do not use consistent indentation within YAML locale files. Some use 2 spaces, and some use 4. In order to keep the "git diff" as small as possible, we want to be able to configure the indentation used in a project so that when the new YAML files are generated they have the same indentation that was already used in the project.

Files that you will work with

Set up the environment

  1. Create the local dev environment following the instructions in the README. You will need a superuser to access Django Admin
  2. Go to the Django Admin at localhost:8000/admin and sign in with the superuser
  3. Pick a project from https://github.com/zetkin and find the locale files within it.
  4. Create Language objects in the Django Admin for each language in the project.

From here you can create a Project object. Once you make the changes, you should see the field for the indentation spaces used in the form for Project objects.

Validating your work

To check your work is correct, this is what is expected:

  1. Set up a project using the steps above. Set any value of indentation you wish.
  2. Click the checkbox for your project and from the actions dropdown select: "Export locale files"
  3. Open the downloaded files and check the indentation is correct.

Requirements

djbusstop commented 3 years ago

Implemented and released.