mirror of
https://github.com/getpaseo/paseo.git
synced 2026-08-15 04:42:45 +00:00
Complete client UI i18n migration
Adds client-side i18n support, language settings, translated UI copy, and locale parity coverage.
This commit is contained in:
committed by
GitHub
parent
41cf070fd8
commit
08ebe5e7e1
@@ -2,6 +2,7 @@ import { useRef, ReactNode, useCallback, useEffect } from "react";
|
||||
import { Buffer } from "buffer";
|
||||
import { AppState } from "react-native";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useClientActivity } from "@/hooks/use-client-activity";
|
||||
import { usePushTokenRegistration } from "@/hooks/use-push-token-registration";
|
||||
import { clearArchiveAgentPending } from "@/hooks/use-archive-agent";
|
||||
@@ -440,6 +441,7 @@ export function SessionProvider(props: SessionProviderProps) {
|
||||
}
|
||||
|
||||
function SessionProviderInternal({ children, serverId, client }: SessionProviderClientProps) {
|
||||
const { t } = useTranslation();
|
||||
const voiceRuntime = useVoiceRuntimeOptional();
|
||||
const voiceAudioEngine = useVoiceAudioEngineOptional();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -908,25 +910,25 @@ function SessionProviderInternal({ children, serverId, client }: SessionProvider
|
||||
serverId,
|
||||
setVoiceMode: async (enabled, agentId) => {
|
||||
if (!client) {
|
||||
throw new Error("Daemon unavailable");
|
||||
throw new Error(t("common.errors.daemonUnavailable"));
|
||||
}
|
||||
await client.setVoiceMode(enabled, agentId);
|
||||
},
|
||||
sendVoiceAudioChunk: async (audioData, mimeType) => {
|
||||
if (!client) {
|
||||
throw new Error("Daemon unavailable");
|
||||
throw new Error(t("common.errors.daemonUnavailable"));
|
||||
}
|
||||
await client.sendVoiceAudioChunk(audioData, mimeType);
|
||||
},
|
||||
audioPlayed: async (chunkId) => {
|
||||
if (!client) {
|
||||
throw new Error("Daemon unavailable");
|
||||
throw new Error(t("common.errors.daemonUnavailable"));
|
||||
}
|
||||
await client.audioPlayed(chunkId);
|
||||
},
|
||||
abortRequest: async () => {
|
||||
if (!client) {
|
||||
throw new Error("Daemon unavailable");
|
||||
throw new Error(t("common.errors.daemonUnavailable"));
|
||||
}
|
||||
await client.abortRequest();
|
||||
},
|
||||
@@ -935,7 +937,7 @@ function SessionProviderInternal({ children, serverId, client }: SessionProvider
|
||||
},
|
||||
});
|
||||
return () => unregister?.();
|
||||
}, [client, serverId, setIsPlayingAudio, voiceRuntime]);
|
||||
}, [client, serverId, setIsPlayingAudio, t, voiceRuntime]);
|
||||
|
||||
useEffect(() => {
|
||||
voiceRuntime?.updateSessionConnection(serverId, isConnected);
|
||||
|
||||
Reference in New Issue
Block a user