Skip to content

Conversation

@mvidner
Copy link
Contributor

@mvidner mvidner commented Aug 8, 2025

Problem

Agama questions have two attributes to define the possible answers:

  • options: possible options the user can choose from.
  • default_option: default option. This option is used by the web UI to decide which button to set as the default.

The problem is that, if you try to load an answers file, you need to make sure that Agama and your profile are in the same language. So instead of using translated values, we should use some kind of identifiers.

Solution

Where the old code had an options array, add also an option_labels array. The options will be untranslated IDs, the labels are translated and displayed to the user.

TODO:

  • add translation markers N_("text") to the actual answers

Testing

  • Some unit tests adjusted
  • TODO: manual tests

How to test manually:

  1. run ./testing-using-container.sh
  2. zypper in -y glibc-locale
  3. systemctl restart agama.service
  4. open a browser at https://localhost:10443/
  5. select French as the installer UI language
  6. select a product (MicroOS)
  7. cd /checkout # in the container again
  8. agama config generate file://$(pwd)/service/test/fixtures/profiles/cloned.xml &
  9. see a question in the browser
  10. ...

Screenshots

TODO, make one

Documentation

Remember to look at it from the user's perspective. Yes you have made the compiler happy.
But will the humans even know about your contribution? Sometimes they cannot miss it,
other times they need advertisement and explanation.

Look for relevant sections and adjust:

@mvidner mvidner force-pushed the question-ids-and-labels branch from 5ffe3b7 to e96f941 Compare August 21, 2025 14:07
@coveralls
Copy link

coveralls commented Aug 21, 2025

Coverage Status

coverage: 64.255% (-11.9%) from 76.149%
when pulling e96f941 on question-ids-and-labels
into fe93696 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants