l18n for client names in device activity (#32982)

Fixes #32916

Signed-off-by: Stan Silvert <ssilvert@redhat.com>
This commit is contained in:
Stan Silvert 2024-09-17 06:48:25 -04:00 committed by GitHub
parent 905584c742
commit 01601beaa8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
import { import {
ContinueCancelModal, ContinueCancelModal,
useEnvironment, useEnvironment,
label,
} from "@keycloak/keycloak-ui-shared"; } from "@keycloak/keycloak-ui-shared";
import { import {
Button, Button,
@ -35,7 +36,6 @@ import {
SessionRepresentation, SessionRepresentation,
} from "../api/representations"; } from "../api/representations";
import { Page } from "../components/page/Page"; import { Page } from "../components/page/Page";
import { TFuncKey } from "../i18n";
import { formatDate } from "../utils/formatDate"; import { formatDate } from "../utils/formatDate";
import { useAccountAlerts } from "../utils/useAccountAlerts"; import { useAccountAlerts } from "../utils/useAccountAlerts";
import { usePromise } from "../utils/usePromise"; import { usePromise } from "../utils/usePromise";
@ -92,7 +92,7 @@ export const DeviceActivity = () => {
clients.forEach((client, index) => { clients.forEach((client, index) => {
let clientName: string; let clientName: string;
if (client.clientName !== "") { if (client.clientName !== "") {
clientName = t(client.clientName as TFuncKey); clientName = label(t, client.clientName);
} else { } else {
clientName = client.clientId; clientName = client.clientId;
} }