Skip to content

Commit 1a765d3

Browse files
authored
Merge pull request hestiacp#1170 from hestiacp/fix/1166-emals-not-translated
hestiacp#1166 Issues with emails not translated
2 parents 5334b45 + 98bae0b commit 1a765d3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

web/inc/i18n.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Functions for internationalization
33
// I18N support information here
44

5-
putenv("LANGUAGE=".$_SESSION['language']);
5+
putenv("LANGUAGE=".detect_user_language());
66
setlocale( LC_ALL, 'C.UTF-8' );
77

88
$domain = 'hestiacp';
@@ -16,8 +16,14 @@
1616
* @param string Fallback language (default: 'en')
1717
* @return string Language code (such as 'en' and 'ja')
1818
*/
19-
function detect_user_language($fallback='en') {
20-
19+
function detect_user_language() {
20+
if (!empty($_SESSION['language'])) {
21+
return $_SESSION['language'];
22+
}elseif (!empty($_SESSION['LANGUAGE'])){
23+
return $_SESSION['LANGUAGE'];
24+
}else{
25+
return 'en';
26+
}
2127
}
2228

2329
/**

web/templates/admin/list_backup_detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
7676
<div class="actions-panel clearfix">
7777
<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href">
78-
<a href="/schedule/restore/?backup=<?=$backup?>&type=web&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?php print __('Restore');?>">
78+
<a href="/schedule/restore/?backup=<?=$backup?>&type=web&object=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?php print _('Restore');?>">
7979
<i class="fas fa-undo status-icon green status-icon dim"></i>
8080
</a>
8181
</div>

0 commit comments

Comments
 (0)