i18n: use automatic type inference of translation keys

Finally figured out a way to make typescript strongly type translation
keys so we can avoid the tedium of creating enums of translation keys.
This commit is contained in:
David Lechner
2022-07-22 13:48:50 -05:00
parent 3e10096b6e
commit d6df128860
80 changed files with 402 additions and 875 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ import {
useOverlay,
} from 'react-aria';
import { usePopper } from 'react-popper';
import { I18nId, useI18n } from './i18n';
import { useI18n } from './i18n';
type HelpDialogProps = {
/** The title of the dialog. */
@@ -147,7 +147,7 @@ const HelpDialog: React.FunctionComponent<HelpDialogProps> = ({
<DismissButton
id={dismissId}
aria-label={i18n.translate(
I18nId.HelpDialogCloseButtonLabel,
'helpDialog.closeButton.label',
)}
onDismiss={onClose}
/>