Name the translate function _t

Then it should continue to get picked up by the script

This seems a bit flaky and ew but I'm not sure I want to get into
changing this in this PR.
This commit is contained in:
David Baker 2025-11-27 11:50:36 +00:00
parent 7e76eb5f93
commit b74c4d449b
4 changed files with 8 additions and 8 deletions

View File

@ -90,11 +90,11 @@ interface AudioPlayerViewProps {
* ``` * ```
*/ */
export function AudioPlayerView({ vm }: Readonly<AudioPlayerViewProps>): JSX.Element { export function AudioPlayerView({ vm }: Readonly<AudioPlayerViewProps>): JSX.Element {
const i18n = useI18n(); const { translate: _t } = useI18n();
const { const {
playbackState, playbackState,
mediaName = i18n.translate("timeline|m.audio|unnamed_audio"), mediaName = _t("timeline|m.audio|unnamed_audio"),
sizeBytes, sizeBytes,
durationSeconds, durationSeconds,
playedSeconds, playedSeconds,

View File

@ -46,9 +46,9 @@ export function PlayPauseButton({
togglePlay, togglePlay,
...rest ...rest
}: Readonly<PlayPauseButtonProps>): JSX.Element { }: Readonly<PlayPauseButtonProps>): JSX.Element {
const i18n = useI18n(); const { translate: _t } = useI18n();
const label = playing ? i18n.translate("action|pause") : i18n.translate("action|play"); const label = playing ? _t("action|pause") : _t("action|play");
return ( return (
<IconButton <IconButton

View File

@ -33,7 +33,7 @@ interface ISeekCSS extends CSSProperties {
* ``` * ```
*/ */
export function SeekBar({ value = 0, className, ...rest }: Readonly<SeekBarProps>): JSX.Element { export function SeekBar({ value = 0, className, ...rest }: Readonly<SeekBarProps>): JSX.Element {
const i18n = useI18n(); const { translate: _t } = useI18n();
const [newValue, setNewValue] = useState(value); const [newValue, setNewValue] = useState(value);
// Throttle the value setting to avoid excessive re-renders // Throttle the value setting to avoid excessive re-renders
@ -53,7 +53,7 @@ export function SeekBar({ value = 0, className, ...rest }: Readonly<SeekBarProps
value={newValue} value={newValue}
step={1} step={1}
style={{ "--fillTo": newValue / 100 } as ISeekCSS} style={{ "--fillTo": newValue / 100 } as ISeekCSS}
aria-label={i18n.translate("a11y|seek_bar_label")} aria-label={_t("a11y|seek_bar_label")}
{...rest} {...rest}
/> />
); );

View File

@ -39,7 +39,7 @@ export interface PillProps extends Omit<HTMLAttributes<HTMLDivElement>, "onClick
*/ */
export function Pill({ className, children, label, onClick, ...props }: PropsWithChildren<PillProps>): JSX.Element { export function Pill({ className, children, label, onClick, ...props }: PropsWithChildren<PillProps>): JSX.Element {
const id = useId(); const id = useId();
const i18n = useI18n(); const { translate: _t } = useI18n();
return ( return (
<Flex <Flex
@ -58,7 +58,7 @@ export function Pill({ className, children, label, onClick, ...props }: PropsWit
aria-describedby={id} aria-describedby={id}
size="16px" size="16px"
onClick={onClick} onClick={onClick}
aria-label={i18n.translate("action|delete")} aria-label={_t("action|delete")}
className="mx_Dialog_nonDialogButton" className="mx_Dialog_nonDialogButton"
> >
<CloseIcon color="var(--cpd-color-icon-tertiary)" /> <CloseIcon color="var(--cpd-color-icon-tertiary)" />