From 14e6b69170f938ccedb053523a0a5ef5f887cc00 Mon Sep 17 00:00:00 2001 From: ikhomyn <89014675+ikhomyn@users.noreply.github.com> Date: Tue, 16 Aug 2022 15:16:50 +0200 Subject: [PATCH] Prevent accidental translation of role name (#3127) --- src/components/view-header/ViewHeader.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/view-header/ViewHeader.tsx b/src/components/view-header/ViewHeader.tsx index c3913923be..3f08cfb9f4 100644 --- a/src/components/view-header/ViewHeader.tsx +++ b/src/components/view-header/ViewHeader.tsx @@ -71,7 +71,7 @@ export const ViewHeader = ({ helpTextKey, isReadOnly = false, }: ViewHeaderProps) => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const { enabled } = useHelp(); const [isDropdownOpen, setDropdownOpen] = useState(false); const [isLowerDropdownOpen, setIsLowerDropdownOpen] = useState(false); @@ -95,7 +95,7 @@ export const ViewHeader = ({ - {t(titleKey)} + {i18n.exists(titleKey) ? t(titleKey) : titleKey}