Make translatable all options in Keep results field

Created on 28 March 2023, about 1 year ago
Updated 18 April 2023, about 1 year ago

Problem/Motivation

In the Quiz edit form, Taking options, the keep results field has tree options but two of theese ("The newest" and "All") are not translatable.

Proposed resolution

Just add the t function in /src/Entity/Quiz.php, baseFieldDefinitions function, rows 228 and 229.

    $fields['keep_results'] = BaseFieldDefinition::create('list_integer')
      ->setDisplayConfigurable('form', TRUE)
      ->setRevisionable(TRUE)
      ->setCardinality(1)
      ->setDefaultValue(2)
      ->setRequired(TRUE)
      ->setDisplayOptions('form', [
        'type' => 'options_buttons',
      ])
      ->setSetting('allowed_values', [
        0 => t('The best'),
        1 => t('The newest'),
        2 => t('All'),
      ])
      ->setLabel(t('Store results'))
      ->setDescription(t('These results should be stored for each user.'));

Attaching patch.

🐛 Bug report
Status

Needs review

Version

6.0

Component

Code - Quiz core

Created by

🇮🇹Italy nessunluogo Tremestieri Etneo (CT)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024