From dcbaebaba2e1c39dd4c595e014d9875d99da8322 Mon Sep 17 00:00:00 2001 From: jimsihk <99048231+jimsihk@users.noreply.github.com> Date: Mon, 12 Feb 2024 00:11:23 +0800 Subject: [PATCH] Support additional name placeholders in English --- lang/en/enrol_notificationeabc.php | 12 ++++++------ lang/es/enrol_notificationeabc.php | 12 ++++++------ lib.php | 2 ++ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lang/en/enrol_notificationeabc.php b/lang/en/enrol_notificationeabc.php index e8e0d2c..3672496 100644 --- a/lang/en/enrol_notificationeabc.php +++ b/lang/en/enrol_notificationeabc.php @@ -35,8 +35,8 @@
 {COURSENAME} = course fullname
 {USERNAME} = username
-{NOMBRE} = firstname
-{APELLIDO} = lastname
+{NOMBRE} or {FIRSTNAME} = firstname
+{APELLIDO} or {LASTNAME} = lastname
 {URL} = course url
 
'; $string['fecha_help'] = 'Place the period for which you want to perform the first virificación'; @@ -63,8 +63,8 @@
 {COURSENAME} = course fullname
 {USERNAME} = username
-{NOMBRE} = firstname
-{APELLIDO} = lastname
+{NOMBRE} or {FIRSTNAME} = firstname
+{APELLIDO} or {LASTNAME} = lastname
 {URL} = course url
 
'; $string['unenrolmessagedefault'] = 'You has been unenrolled from {$a->fullname} ({$a->url})'; @@ -78,8 +78,8 @@
 {COURSENAME} = course fullname
 {USERNAME} = username
-{NOMBRE} = firstname
-{APELLIDO} = lastname
+{NOMBRE} or {FIRSTNAME} = firstname
+{APELLIDO} or {LASTNAME} = lastname
 {URL} = course url
 
'; $string['updatedenrolmessagedefault'] = 'Your enrolment from {$a->fullname} has been updated ({$a->url})'; diff --git a/lang/es/enrol_notificationeabc.php b/lang/es/enrol_notificationeabc.php index a185d74..2213e88 100644 --- a/lang/es/enrol_notificationeabc.php +++ b/lang/es/enrol_notificationeabc.php @@ -35,8 +35,8 @@
 {COURSENAME} = Nombre completo del curso
 {USERNAME} = Nombre de usuario
-{NOMBRE} = Nombre
-{APELLIDO} = Apellido
+{NOMBRE} or {FIRSTNAME} = Nombre
+{APELLIDO} or {LASTNAME} = Apellido
 {URL} = Url del curso
 
'; $string['fecha_help'] = 'Coloque el periodo por el cual desea que se realice la virificación inicial de usuarios matriculados'; @@ -63,8 +63,8 @@
 {COURSENAME} = Nombre completo del curso
 {USERNAME} = Nombre de usuario
-{NOMBRE} = Nombre
-{APELLIDO} = Apellido
+{NOMBRE} or {FIRSTNAME} = Nombre
+{APELLIDO} or {LASTNAME} = Apellido
 {URL} = Url del curso
 
'; $string['unenrolmessagedefault'] = 'Ud ha sido desmatriculado del curso {$a->fullname} ({$a->url})'; @@ -78,8 +78,8 @@
 {COURSENAME} = Nombre completo del curso
 {USERNAME} = Nombre de usuario
-{NOMBRE} = Nombre
-{APELLIDO} = Apellido
+{NOMBRE} or {FIRSTNAME} = Nombre
+{APELLIDO} or {LASTNAME} = Apellido
 {URL} = Url del curso
 
'; $string['updatedenrolmessagedefault'] = 'Su matriculacion en el curso {$a->fullname} ha sido actualizada ({$a->url})'; diff --git a/lib.php b/lib.php index f8bb742..ccb41ae 100644 --- a/lib.php +++ b/lib.php @@ -178,7 +178,9 @@ public function process_mensaje($mensaje, stdClass $user, stdClass $course) { $m = str_replace('{COURSENAME}', $course->fullname, $m); $m = str_replace('{USERNAME}', $user->username, $m); $m = str_replace('{NOMBRE}', $user->firstname, $m); + $m = str_replace('{FIRSTNAME}', $user->firstname, $m); // Supports also EN placeholder name $m = str_replace('{APELLIDO}', $user->lastname, $m); + $m = str_replace('{LASTNAME}', $user->lastname, $m); // Supports also EN placeholder name $m = str_replace('{URL}', $url, $m); return $m; }