Skip to content

Commit 5b9db05

Browse files
committed
Update: Accessibility drop-down labels use translated labels.
1 parent 810ab8a commit 5b9db05

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/AccessibilitySettings/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect, useState } from "preact/hooks";
22
import { Dropdown, type DropdownOption } from "../Dropdown";
33

44
type AccessibilitySettingsProps = {
5+
dropdownLabel: string;
56
options: DropdownOption[];
67
};
78

@@ -12,6 +13,7 @@ type PossibleA11ySettings =
1213
| "reduced-motion";
1314

1415
export const AccessibilitySettings = ({
16+
dropdownLabel,
1517
options,
1618
}: AccessibilitySettingsProps) => {
1719
const [selectedSettings, setSelectedSettings] = useState<
@@ -51,7 +53,7 @@ export const AccessibilitySettings = ({
5153
return (
5254
<Dropdown
5355
options={options}
54-
dropdownLabel="Accessibility"
56+
dropdownLabel={dropdownLabel}
5557
onChange={(option) => toggleSetting(option.value as PossibleA11ySettings)}
5658
iconKind="settings"
5759
variant="radio"

src/components/Settings/index.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const localeOptionProps = localeOptions.map(({ locale, label, url }) => ({
5151
5252
const t = await getUiTranslator(currentLocale);
5353
54+
const dropdownLabel = t("Accessibility") as string;
55+
5456
const a11ySettingsProps = [
5557
{
5658
value: "dark-theme",
@@ -85,7 +87,7 @@ const { hideSearch } = Astro.props;
8587
/>
8688
</div>
8789
<div class={styles.a11yselect}>
88-
<AccessibilitySettings options={a11ySettingsProps} client:load />
90+
<AccessibilitySettings dropdownLabel={dropdownLabel} options={a11ySettingsProps} client:load />
8991
</div>
9092
{
9193
!hideSearch && (

0 commit comments

Comments
 (0)