Skip to content

Commit

Permalink
fix: make role info translatable (backport #20813) (#20828)
Browse files Browse the repository at this point in the history
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
fix: make role info translatable (#20813)
  • Loading branch information
3 people committed Apr 24, 2023
1 parent b4b6b66 commit 265d9b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
22 changes: 12 additions & 10 deletions frappe/public/js/frappe/roles_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ frappe.RoleEditor = class {
const $body = $(this.perm_dialog.body);
if (!permissions.length) {
$body.append(`<div class="text-muted text-center padding">
${__('{0} role does not have permission on any doctype', [role])}
${__("{0} role does not have permission on any doctype", [__(role)])}
</div>`);
} else {
$body.append(`
<table class="user-perm">
<thead>
<tr>
<th> ${__('Document Type')} </th>
<th> ${__('Level')} </th>
${frappe.perm.rights.map(p => `<th> ${frappe.unscrub(p)}</th>`).join("")}
<th> ${__("Document Type")} </th>
<th> ${__("Level")} </th>
${frappe.perm.rights.map((p) => `<th> ${__(frappe.unscrub(p))}</th>`).join("")}
</tr>
</thead>
<tbody></tbody>
Expand All @@ -72,14 +72,14 @@ frappe.RoleEditor = class {
permissions.forEach(perm => {
$body.find('tbody').append(`
<tr>
<td>${perm.parent}</td>
<td>${__(perm.parent)}</td>
<td>${perm.permlevel}</td>
${frappe.perm.rights.map(p => `<td class="text-muted bold">${perm[p] ? frappe.utils.icon('check', 'xs') : '-'}</td>`).join("")}
</tr>
`);
});
}
this.perm_dialog.set_title(role);
this.perm_dialog.set_title(__(role));
this.perm_dialog.show();
});
}
Expand All @@ -89,9 +89,11 @@ frappe.RoleEditor = class {
});

this.perm_dialog.$wrapper
.find('.modal-dialog')
.css("width", "1200px")
.css("max-width", "80vw");
.find(".modal-dialog")
.css("width", "auto")
.css("max-width", "1200px");

this.perm_dialog.$wrapper.find(".modal-body").css("overflow", "overlay");
}
show() {
this.reset();
Expand Down Expand Up @@ -124,4 +126,4 @@ frappe.RoleEditor = class {
unchecked_roles: this.multicheck.get_unchecked_options()
};
}
};
};
5 changes: 3 additions & 2 deletions frappe/translations/de.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2282,8 +2282,8 @@ Setup Auto Email,Einstellungen Auto E-Mail,
Setup Complete,Einrichtung abgeschlossen,
Setup Notifications based on various criteria.,Setup Benachrichtigungen basierend auf verschiedenen Kriterien.,
Setup Reports to be emailed at regular intervals,Berichte regelmäßig per E-Mail senden,
"Setup of top navigation bar, footer and logo.","Einrichten der oberen Navigationsleiste, der Fußzeile und des Logos",
Share,Aktie,
"Setup of top navigation bar, footer and logo.","Einrichten der oberen Navigationsleiste, der Fußzeile und des Logos",
Share,Freigeben,
Share URL,URL teilen,
Share With,Freigeben für,
Share this document with,Dieses Dokument teilen mit,
Expand Down Expand Up @@ -4810,3 +4810,4 @@ Notification sent to,Benachrichtigung gesendet an,
Add to this activity by mailing to {0},"Senden Sie eine E-Mail an {0}, damit sie hier erscheint",
This value is fetched from {0}'s {1} field,Dieser Wert ergibt sich aus dem Feld {1} von {0},
This form is not editable due to a Workflow.,Dieses Formular kann in diesem Workflow-Status nicht bearbeitet werden.,
{0} role does not have permission on any doctype,Die Rolle {0} hat auf keinen DocType Zugriff,

0 comments on commit 265d9b2

Please sign in to comment.