Skip to content

Commit

Permalink
Merge pull request #910 from Arnei/fix-missing-translations
Browse files Browse the repository at this point in the history
Fix translation for table name  in EditTableModal
  • Loading branch information
lkiesow authored Nov 18, 2024
2 parents 9f6a2de + b8d1d6e commit 054d6d6
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/components/shared/EditTableViewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,26 @@ const EditTableViewModal = ({
setActiveColumns((columns) => arrayMoveImmutable(columns, result.source.index, destination.index));
}

const getTranslationForSubheading = (resource: string) => {
const resourceLC = resource.toLowerCase();
if (resourceLC === "events" || resourceLC === "series") {
return "EVENTS." + resource.toUpperCase() + ".TABLE.CAPTION"
}
if (resourceLC === "recordings") {
return resource.toUpperCase() + "." + resource.toUpperCase() + ".TABLE.CAPTION"
}
if (resourceLC === "jobs" || resourceLC === "servers" || resourceLC === "services") {
return "SYSTEMS." + resource.toUpperCase() + ".TABLE.CAPTION"
}
if (resourceLC === "users" || resourceLC === "groups" || resourceLC === "acls") {
return "USERS." + resource.toUpperCase() + ".TABLE.CAPTION"
}
if (resourceLC === "themes") {
return "CONFIGURATION." + resource.toUpperCase() + ".TABLE.CAPTION"
}
return ""
}

return (
<>
<div className="modal-animation modal-overlay" />
Expand All @@ -118,9 +138,7 @@ const EditTableViewModal = ({
<div className="tab-description for-header">
<p>
{t("PREFERENCES.TABLE.SUBHEADING", {
tableName: t(
"EVENTS." + resource.toUpperCase() + ".TABLE.CAPTION"
),
tableName: t(getTranslationForSubheading(resource)),
})}
</p>
</div>
Expand Down

0 comments on commit 054d6d6

Please sign in to comment.