Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions public/main/auth/inscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -1171,9 +1171,9 @@
$recipient_name = api_get_person_name($values['firstname'], $values['lastname']);
$textAfterRegistration =
'<p>'.
get_lang('Dear').' '.
get_lang('Dear', $userEntity->getLocale()).' '.
stripslashes(Security::remove_XSS($recipient_name)).',<br /><br />'.
get_lang('Your personal settings have been registered')."</p>";
get_lang('Your personal settings have been registered', $userEntity->getLocale())."</p>";

$formData = [
'button' => Display::button(
Expand Down Expand Up @@ -1205,11 +1205,11 @@
} else {
if (!empty($values['email'])) {
$linkDiagnostic = api_get_path(WEB_PATH).'main/search/search.php';
$textAfterRegistration .= '<p>'.get_lang('An e-mail has been sent to remind you of your login and password').'</p>';
$textAfterRegistration .= '<p>'.get_lang('An e-mail has been sent to remind you of your login and password', $userEntity->getLocale()).'</p>';
$diagnosticPath = '<a href="'.$linkDiagnostic.'" class="custom-link">'.$linkDiagnostic.'</a>';
$textAfterRegistration .= '<p>';
$textAfterRegistration .= sprintf(
get_lang('Welcome, please go to diagnostic at %s.'),
get_lang('Welcome, please go to diagnostic at %s.', $userEntity->getLocale()),
$diagnosticPath
);
$textAfterRegistration .= '</p>';
Expand Down
4 changes: 3 additions & 1 deletion public/main/inc/lib/usermanager.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public static function create_user(
$userId = $user->getId();

if (!empty($userId)) {
$userLocale = $user->getLocale();
if ($isAdmin) {
self::addUserAsAdmin($user);
}
Expand Down Expand Up @@ -377,7 +378,7 @@ public static function create_user(
PERSON_NAME_EMAIL_ADDRESS
);
$tpl = Container::getTwig();
$emailSubject = $tpl->render('@ChamiloCore/Mailer/Legacy/subject_registration_platform.html.twig');
$emailSubject = $tpl->render('@ChamiloCore/Mailer/Legacy/subject_registration_platform.html.twig', ['locale' => $userLocale]);
$sender_name = api_get_person_name(
api_get_setting('administratorName'),
api_get_setting('administratorSurname'),
Expand Down Expand Up @@ -405,6 +406,7 @@ public static function create_user(
'mailWebPath' => $url,
'new_user' => $user,
'search_link' => $url,
'locale' => $userLocale,
];

// ofaj
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{% set user_locale = locale is defined ? locale : 'en' %}
{% trans_default_domain 'messages' %}

{% autoescape false %}
<p>{{ 'Dear'|trans }} {{ complete_name }},</p>
<p>{{ 'Welcome to this platform'|trans }}</p>
<p>{{ 'You are registered to'|trans }} {{ 'platform.site_name' | api_get_setting }} {{ 'with the following settings:'|trans }}</p>
<p>{{ 'Username'|trans }} : {{ login_name }}<br>
{{ 'Pass'|trans }} : {{ original_password }}</p>
<p>{{ 'For more details visit %s'|trans|format(search_link) }}</p>
<p>{{ 'In case of trouble, contact us.'|trans }}</p>
<p>{{ 'Dear'|trans({}, 'messages', user_locale) }} {{ complete_name }},</p>
<p>{{ 'Welcome to this platform'|trans({}, 'messages', user_locale) }}</p>
<p>{{ 'You are registered to'|trans({}, 'messages', user_locale) }} {{ 'platform.site_name' | api_get_setting }} {{ 'with the following settings:'|trans({}, 'messages', user_locale) }}</p>
<p>{{ 'Username'|trans({}, 'messages', user_locale) }} : {{ login_name }}<br>
{{ 'Pass'|trans({}, 'messages', user_locale) }} : {{ original_password }}</p>
<p>{{ 'For more details visit %s'|trans({'%s': search_link}, 'messages', user_locale) }}</p>
<p>{{ 'In case of trouble, contact us.'|trans({}, 'messages', user_locale) }}</p>

<p>{{ 'Sincerely'|trans }}</p>
<p>{{ 'Sincerely'|trans({}, 'messages', user_locale) }}</p>
<p>{{ 'admin.administrator_name' | api_get_setting }} {{ 'admin.administrator_surname' | api_get_setting }}<br />
{{ 'Manager'|trans }} {{ 'platform.site_name' | api_get_setting }}<br />
{{ 'Manager'|trans({}, 'messages', user_locale) }} {{ 'platform.site_name' | api_get_setting }}<br />

{% if 'admin.administrator_phone' | api_get_setting %}
{{ 'T. ' ~ 'admin.administrator_phone' | api_get_setting }}<br />
{% endif %}
{% if 'admin.administrator_email' | api_get_setting %}
{{ 'Email'|trans ~ ': ' ~ 'admin.administrator_email' | api_get_setting }}
{{ 'Email'|trans({}, 'messages', user_locale) ~ ': ' ~ 'admin.administrator_email' | api_get_setting }}
{% endif %}
</p>
{% endautoescape %}
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{{ '['~ 'platform.site_name' | api_get_setting ~ '] ' ~ 'Your Reg'|trans ~ ' ' ~ 'platform.site_name' | api_get_setting }}
{% set user_locale = locale is defined ? locale : 'en' %}
{% trans_default_domain 'messages' %}

{{ '['~ 'platform.site_name' | api_get_setting ~ '] ' ~ 'Your Reg'|trans({}, 'messages', user_locale) ~ ' ' ~ 'platform.site_name' | api_get_setting }}
Loading