[Update] Config Page: Add Appearance Tab. Add UI Language section.(Functionally, too)

This commit is contained in:
Sakamoto Shiina committed 2024-09-13 16:23:23 +09:00
1 parent 1eceb8e8e8
commit f74ebc1942
8 files changed
+182 -23

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import { useStore_UiLanguage } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useUiLanguage = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentUiLanguage, updateUiLanguage } = useStore_UiLanguage();
const getUiLanguage = () => {
updateUiLanguage(() => new Promise(() => {}));
asyncStdoutToPython("/config/ui_language");
};
const setUiLanguage = (selected_ui_language) => {
updateUiLanguage(() => new Promise(() => {}));
asyncStdoutToPython("/controller/callback_set_ui_language", selected_ui_language);
};
return {
currentUiLanguage,
getUiLanguage,
updateUiLanguage,
setUiLanguage,
};
};
+8 -1
View File
@@ -15,6 +15,8 @@ import { useSpeakerThreshold } from "@logics_configs/useSpeakerThreshold";
import { useEnableAutoClearMessageBox } from "@logics_configs/useEnableAutoClearMessageBox";
import { useSendMessageButtonType } from "@logics_configs/useSendMessageButtonType";
import { useUiLanguage } from "@logics_configs/useUiLanguage";
export const useReceiveRoutes = () => {
const {
@@ -43,6 +45,8 @@ export const useReceiveRoutes = () => {
const { updateEnableAutoClearMessageBox } = useEnableAutoClearMessageBox();
const { updateSendMessageButtonType } = useSendMessageButtonType();
const { updateUiLanguage } = useUiLanguage();
const {
updateVolumeVariable_Mic,
@@ -101,7 +105,10 @@ export const useReceiveRoutes = () => {
"/controller/callback_disable_mic_dynamic_energy_threshold": updateEnableAutomaticMicThreshold,
"/config/input_speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
"/controller/callback_enable_speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
"/controller/callback_disable_speaker_dynamic_energy_threshold": updateEnableAutomaticSpeakerThreshold,
"/config/ui_language": updateUiLanguage,
"/controller/callback_set_ui_language": updateUiLanguage,
"/controller/callback_messagebox_send": updateSentMessageLogById,
"/action/transcription_send_mic_message": addSentMessageLog,