Make translatable all options in Keep results field

Created on 28 March 2023, over 1 year ago
Updated 9 August 2024, 3 months 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

Fixed

Version

7.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.71.5 2024