mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
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:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user