Plugin: Add new option "translate_options" when using a select

pull/2624/head
Julio Montoya 7 years ago
parent fb70b45504
commit 233ca60495
  1. 5
      main/inc/lib/plugin.class.php
  2. 3
      plugin/bbb/lang/english.php
  3. 9
      plugin/bbb/lib/bbb_plugin.class.php

@ -216,6 +216,11 @@ class Plugin
$options = null;
if (is_array($type) && isset($type['type']) && $type['type'] === 'select') {
$attributes = isset($type['attributes']) ? $type['attributes'] : [];
if (!empty($type['options']) && isset($type['translate_options']) && $type['translate_options']) {
foreach ($type['options'] as $key => &$optionName) {
$optionName = $this->get_lang($optionName);
}
}
$options = $type['options'];
$type = $type['type'];
}

@ -69,3 +69,6 @@ $strings['launch_type'] = 'Client launch type';
$strings['EnterConferenceFlash'] = 'Enter the videoconference (Flash client)';
$strings['EnterConferenceHTML5'] = 'Enter the videoconference (HTML5 client)';
$strings['ParticipantsWillUseSameInterface'] = 'Participants will use the same interface as you';
$strings['SetByStudent'] = 'Set by student';
$strings['SetByTeacher'] = 'Set by teacher';
$strings['SetByDefault'] = 'Default';

@ -73,10 +73,11 @@ class BBBPlugin extends Plugin
'launch_type' => [
'type' => 'select',
'options' => [
self::LAUNCH_TYPE_DEFAULT => 'Default',
self::LAUNCH_TYPE_SET_BY_TEACHER => 'Set by teacher',
self::LAUNCH_TYPE_SET_BY_STUDENT => 'Set by student',
]
self::LAUNCH_TYPE_DEFAULT => 'SetByDefault',
self::LAUNCH_TYPE_SET_BY_TEACHER => 'SetByTeacher',
self::LAUNCH_TYPE_SET_BY_STUDENT => 'SetByStudent',
],
'translate_options' => true, // variables will be translated using the plugin->get_lang
]
]
);

Loading…
Cancel
Save