Skip to content

Commit ff997fe

Browse files
committed
chore: add new strings to translations
1 parent d41cb29 commit ff997fe

5 files changed

Lines changed: 17 additions & 7 deletions

File tree

lbplanner/classes/enums/CAPABILITY_FLAG_ORNONE.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class CAPABILITY_FLAG_ORNONE extends CAPABILITY_FLAG {
4747
* @link CAPABILITY
4848
*/
4949
public static function to_capability(int $num): string {
50-
if ($num === 0) { // TODO: put in translation strings.
51-
throw new \coding_exception('0 means the absence of capabilities, and thus cannot be converted to a capability');
50+
if ($num === 0) {
51+
throw new \coding_exception(get_string('err_enum_capability_none', 'local_lbplanner'));
5252
}
5353
return parent::to_capability($num);
5454
}

lbplanner/lang/de/local_lbplanner.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
$string['sett_futuresight_desc'] = 'Wie viele Tage im Voraus Schüler Termine/Slots buchen dürfen. (0 = nur selber Tag)';
4040
$string['sett_outdaterange_title'] = 'Sichtbarkeitsdauer nach Kursende';
4141
$string['sett_outdaterange_desc'] = 'Die maximale Dauer, die ein Kurs nach seinem Ende im EduPlanner sichtbar bleibt.';
42-
$string['sett_sentrydsn_title'] = 'Sentry DSN';
43-
$string['sett_sentrydsn_desc'] = 'Wo Fehlermeldungen hingeschickt werden. (Bitte frag das Pallasys-Team um einen Code)';
42+
$string['sett_panic_title'] = 'PANIKSCHALTER';
43+
$string['sett_panic_desc'] =
44+
'Schaltet API ab - nur im Notfall. Kein Datenverlust, aber totale Abschaltung der Dienste bis die box enthakt wird.';
4445
// Custom Fields.
4546
$string['cf_name'] = 'LB Planer Aufgabentyp';
4647
$string['cf_description'] = 'Gibt an, ob die Aufgabe GK/EK/TEST/M ist';
@@ -53,11 +54,14 @@
5354
$string['plan_defaultname'] = 'Plan für {$a}'; // $a is the user's name.
5455
$string['capability_deprecated_unnecessary'] = 'Diese Berechtigung wurde entfernt, da sie nicht mehr benötigt wird';
5556
// Error messages.
57+
$string['err_panic'] = 'PANIK';
5658
$string['err_accessdenied'] = 'Zugriff verweigert';
5759
$string['err_doublechacheset'] = 'Versuchte {$a} doppelt im Cache zu speichern'; // $a is an object name.
5860
$string['err_dateformat'] = 'Ungültiges Datumsformat: \'{$a}\' erhalten, erwartet YYYY-MM-DD';
5961
$string['err_enum_casevaluetype_unimp'] = 'Nicht implementierter Case Value Typ für Enum::format()';
6062
$string['err_enum_namemissing'] = 'Name {$a->name} existiert nicht in {$a->classname}';
63+
$string['err_enum_capability_none'] =
64+
'0 heißt die Abwesenheit von Berechtigungen, und kann daher nicht zur Berechtigung umgewandelt werden';
6165
$string['err_invite_alr'] = 'Einladung bereits {$a}'; // $a is a state the invite is in.
6266
$string['err_invite_notfound'] = 'Einladung existiert nicht';
6367
$string['err_invite_yourself'] = 'Kann dich nicht selbst einladen';

lbplanner/lang/en/local_lbplanner.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
$string['sett_outdaterange_desc'] = 'The maximum duration a course remains visible in EduPlanner after it ends.';
4242
$string['sett_sentrydsn_title'] = 'Sentry DSN';
4343
$string['sett_sentrydsn_desc'] = 'For where to send error debugging info to. (Please ask the Pallasys team for a key)';
44+
$string['sett_panic_title'] = 'PANIC SWITCH';
45+
$string['sett_panic_desc'] =
46+
'Turns API off - only use in emergencies. No data loss, but total loss of EduPlanner services until box is unchecked.';
4447
// Custom Fields.
4548
$string['cf_name'] = 'LB Planer Task Type';
4649
$string['cf_description'] = 'Tracks whether the task is GK/EK/TEST/M';
@@ -53,11 +56,14 @@
5356
$string['plan_defaultname'] = 'Plan for {$a}'; // $a is the user's name.
5457
$string['capability_deprecated_unnecessary'] = 'This capability was removed because of internal changes making it unnecessary';
5558
// Error messages.
59+
$string['err_panic'] = 'PANIC';
5660
$string['err_accessdenied'] = 'Access denied';
5761
$string['err_doublechacheset'] = 'Tried to set cached {$a} twice'; // $a is an object name.
5862
$string['err_dateformat'] = 'Invalid date formatting: got \'{$a}\', must be YYYY-MM-DD';
5963
$string['err_enum_casevaluetype_unimp'] = 'Unimplemented case value type for Enum::format()';
6064
$string['err_enum_namemissing'] = 'Name {$a->name} doesn\'t exist in {$a->classname}';
65+
$string['err_enum_capability_none'] =
66+
'0 means the absence of capabilities, and thus cannot be converted to a capability';
6167
$string['err_invite_alr'] = 'Invite already {$a}'; // $a is a state the invite is in.
6268
$string['err_invite_notfound'] = 'Invitation does not exist';
6369
$string['err_invite_yourself'] = 'Cannot invite yourself';

lbplanner/lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function local_lbplanner_override_webservice_execution(stdClass $externalfunctio
3636
// Only override calling our own functions.
3737
if ($externalfunctioninfo->component === 'local_lbplanner') {
3838
if (get_config('local_lbplanner', SETTINGS::PANIC) === '1') {
39-
throw new \moodle_exception('PANIC'); // TODO: add to translations.
39+
throw new \moodle_exception(get_string('err_panic', 'local_lbplanner'));
4040
}
4141
sentry_helper::init();
4242
// Actually calling the function (since we're overriding this part, duh).

lbplanner/settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272

7373
$panicsett = new admin_setting_configcheckbox(
7474
'local_lbplanner/' . SETTINGS::PANIC,
75-
'PANIC SWITCH',
76-
'Turns API off - only use in emergencies. No data loss, but total loss of EduPlanner services until box is unchecked.',
75+
get_string('sett_panic_title', 'local_lbplanner'),
76+
get_string('sett_panic_desc', 'local_lbplanner'),
7777
'0',
7878
);
7979
$settings->add($panicsett);

0 commit comments

Comments
 (0)