mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-11-13 13:55:14 +00:00
Wrap intl in span identifying translation
This commit is contained in:
@@ -61,4 +61,10 @@ const changeLocale = (locale: string): void => {
|
||||
document.documentElement.lang = locale;
|
||||
};
|
||||
|
||||
export { localeOptions, getFlagCodeForLocale, getLocale, createIntl, changeLocale, intl };
|
||||
// This is a translation component that wraps the translation in a span with a data
|
||||
// attribute so devs can inspect the element to see the translation ID
|
||||
const T = ({ id, data }: { id: string; data?: any }) => {
|
||||
return <span data-translation-id={id}>{intl.formatMessage({ id }, data)}</span>;
|
||||
};
|
||||
|
||||
export { localeOptions, getFlagCodeForLocale, getLocale, createIntl, changeLocale, intl, T };
|
||||
|
||||
Reference in New Issue
Block a user