mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
improve i18nhelper
This commit is contained in:
@@ -11,9 +11,10 @@ export function Translated({
|
||||
namespace?: string;
|
||||
} & React.HTMLAttributes<HTMLSpanElement>) {
|
||||
const t = useTranslations(namespace);
|
||||
const helperKey = `${namespace ? `${namespace}.` : ""}${i18nKey}`;
|
||||
|
||||
return (
|
||||
<span data-i18n-key={i18nKey} {...props}>
|
||||
<span data-i18n-key={helperKey} {...props}>
|
||||
{t(i18nKey)}
|
||||
</span>
|
||||
);
|
||||
|
Reference in New Issue
Block a user