Prevent accidental translation of role name (#3127)

This commit is contained in:
ikhomyn 2022-08-16 15:16:50 +02:00 committed by GitHub
parent c9ee2608ea
commit 14e6b69170
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = ({
<LevelItem>
<TextContent className="pf-u-mr-sm">
<Text className={className} component="h1">
{t(titleKey)}
{i18n.exists(titleKey) ? t(titleKey) : titleKey}
</Text>
</TextContent>
</LevelItem>