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