Skip to content

Commit bb31060

Browse files
Merge pull request #6180 from mailcow/fix/6046
[Web] add missing translation for ratelimit in templates overview
2 parents 8e9a936 + fe7211f commit bb31060

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

data/web/js/site/mailbox.js

+8-19
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,8 @@ jQuery(function($){
693693
} else if (item.attributes.rl_frame === "d"){
694694
item.attributes.rl_frame = lang_rl.day;
695695
}
696-
item.attributes.rl_value = escapeHtml(item.attributes.rl_value);
697-
696+
item.attributes.rl_value = (!item.attributes.rl_value) ? "∞" : escapeHtml(item.attributes.rl_value);
697+
item.attributes.ratelimit = item.attributes.rl_value + " " + item.attributes.rl_frame;
698698

699699
if (item.template.toLowerCase() == "default"){
700700
item.action = '<div class="btn-group">' +
@@ -818,14 +818,8 @@ jQuery(function($){
818818
}
819819
},
820820
{
821-
title: 'rl_frame',
822-
data: 'attributes.rl_frame',
823-
defaultContent: '',
824-
class: 'none',
825-
},
826-
{
827-
title: 'rl_value',
828-
data: 'attributes.rl_value',
821+
title: lang_edit.ratelimit,
822+
data: 'attributes.ratelimit',
829823
defaultContent: '',
830824
class: 'none',
831825
},
@@ -1183,7 +1177,8 @@ jQuery(function($){
11831177
} else if (item.attributes.rl_frame === "d"){
11841178
item.attributes.rl_frame = lang_rl.day;
11851179
}
1186-
item.attributes.rl_value = escapeHtml(item.attributes.rl_value);
1180+
item.attributes.rl_value = (!item.attributes.rl_value) ? "∞" : escapeHtml(item.attributes.rl_value);
1181+
item.attributes.ratelimit = item.attributes.rl_value + " " + item.attributes.rl_frame;
11871182

11881183
item.attributes.quota = humanFileSize(item.attributes.quota);
11891184

@@ -1328,14 +1323,8 @@ jQuery(function($){
13281323
}
13291324
},
13301325
{
1331-
title: "rl_frame",
1332-
data: 'attributes.rl_frame',
1333-
defaultContent: '',
1334-
class: 'none',
1335-
},
1336-
{
1337-
title: 'rl_value',
1338-
data: 'attributes.rl_value',
1326+
title: lang_edit.ratelimit,
1327+
data: 'attributes.ratelimit',
13391328
defaultContent: '',
13401329
class: 'none',
13411330
},

data/web/mailbox.php

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
'mailboxes' => $mailboxes,
4242
'lang_mailbox' => json_encode($lang['mailbox']),
4343
'lang_rl' => json_encode($lang['ratelimit']),
44+
'lang_edit' => json_encode($lang['edit']),
4445
'lang_datatables' => json_encode($lang['datatables']),
4546
];
4647

data/web/templates/mailbox.twig

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
var acl = '{{ acl_json|raw }}';
6969
var lang = {{ lang_mailbox|raw }};
7070
var lang_rl = {{ lang_rl|raw }};
71+
var lang_edit = {{ lang_edit|raw }};
7172
var lang_datatables = {{ lang_datatables|raw }};
7273
var csrf_token = '{{ csrf_token }}';
7374
var pagination_size = Math.trunc('{{ pagination_size }}');

0 commit comments

Comments
 (0)