Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(mobile): choose the dictation language for voice input #26725

Closedgabrielsch(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/26725/headopened View on GitHub

Showing 9 changed files with 35 additions and 2 deletions (loading 6).

x
0 of 9 viewed, 9 left
26 additions and 0 deletionsapps/mobile/src/features/settings/SettingsMicrophoneRouteScreen.tsxModified
View file
@@ -10,6 +10,7 @@
import { type AppSymbolName } from "../../components/ui/AppSymbol";
import { AppText as Text } from "../../components/ui/AppText";
import { cn } from "../../lib/cn";
+import { DICTATION_LANGUAGES } from "../../lib/dictationLanguage";
import { makePermissionStatusAtom } from "../../lib/permissionStatusAtom";
import {
isMicrophoneDevice,
@@ -22,6 +23,7 @@
import { ListRowLayout } from "../../components/ui/ListRowLayout";
import { ThreadSwipeable } from "../home/thread-swipe-actions";
import { ListActionRow as SettingsActionRow } from "../../components/ui/ListActionRow";
+import { ListChoiceRow as SettingsChoiceRow } from "../../components/ui/ListChoiceRow";
import { SettingsDragHandle } from "./components/SettingsDragHandle";
import { SettingsSection } from "./components/SettingsSection";
​
@@ -96,6 +98,9 @@
const entries = microphoneOrder(
AsyncResult.isSuccess(preferencesResult) ? preferencesResult.value.microphones : undefined,
+ const dictationLocale = AsyncResult.isSuccess(preferencesResult)
+ ? (preferencesResult.value.dictationLocale ?? null)
+ : null;
const { permission, request: requestPermission } = useMicrophonePermission();
const [drag, setDrag] = useState<{ readonly key: string; readonly translation: number } | null>(
null,
@@ -201,6 +206,27 @@