Skip to content

Commit

Permalink
remove h ard coded strings for call settings
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Oct 28, 2024
1 parent db88159 commit 7a61b56
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/components/settings/CallSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ export default function CallSettings() {
<BreadcrumbItem href="/app" icon="home" title={t("dashboard.title")} />
<BreadcrumbItem title={t("settings.drawer.call-settings")} />
</Breadcrumb>
<Notice
type="info"
description="Changes will be applied on your next calls."
/>
<Notice type="info" description={t("settings.call.nextCallNotice")} />
<InputDevices />
<OutputDevices />
<InputMode />
Expand Down Expand Up @@ -83,10 +80,10 @@ function InputDevices() {
});

return (
<SettingsBlock icon="mic" label="Input Device">
<SettingsBlock icon="mic" label={t("settings.call.inputDevices")}>
<DropDown
items={dropDownItem()}
selectedId={inputDeviceId() || "default"}
selectedId={inputDeviceId() || t("settings.call.default")}
onChange={(e) => setInputDeviceId(e.id)}
/>
</SettingsBlock>
Expand Down Expand Up @@ -116,10 +113,10 @@ function OutputDevices() {
});

return (
<SettingsBlock icon="speaker" label="Output Device">
<SettingsBlock icon="speaker" label={t("settings.call.outputDevices")}>
<DropDown
items={dropDownItem()}
selectedId={outputDeviceId() || "default"}
selectedId={outputDeviceId() || t("settings.call.default")}
onChange={(e) => setOutputDeviceId(e.id)}
/>
</SettingsBlock>
Expand All @@ -142,7 +139,11 @@ function InputMode() {

return (
<div>
<SettingsBlock icon="steppers" label="Input Mode" header />
<SettingsBlock
icon="steppers"
label={t("settings.call.inputMode")}
header
/>
<InputModeRadioBoxContainer
onClick={() => {
if (isInCall()) {
Expand All @@ -155,9 +156,9 @@ function InputMode() {
initialId={inputMode()}
onChange={(e) => setInputMode(e.id)}
items={[
{ id: "OPEN", label: "Open Mic" },
{ id: "VOICE_ACTIVITY", label: "Voice Activity" },
{ id: "PTT", label: "Push To Talk" },
{ id: "OPEN", label: t("settings.call.openMic") },
{ id: "VOICE_ACTIVITY", label: t("settings.call.voiceActivity") },
{ id: "PTT", label: t("settings.call.pushToTalk") },
]}
/>
</InputModeRadioBoxContainer>
Expand Down Expand Up @@ -226,18 +227,22 @@ function PushToTalk() {
<Show when={!electronWindowAPI()?.isElectron}>
<Notice
type="info"
description="Download the Nerimity desktop app to use this feature without window tab focus."
description={t("settings.call.downloadAppNotice")}
/>
</Show>
<SettingsBlock icon="keyboard" label="Push To Talk">
<SettingsBlock icon="keyboard" label={t("settings.call.pushToTalk")}>
<Input
disabled
value={value()}
suffix={
<Button
onkeydown={(e) => e.preventDefault()}
color={bindMode() ? "var(--alert-color)" : undefined}
label={bindMode() ? "Stop" : "Bind"}
label={
bindMode()
? t("settings.call.stopButton")
: t("settings.call.bindButton")
}
onClick={toggleBindMode}
/>
}
Expand Down
14 changes: 14 additions & 0 deletions src/locales/list/en-gb.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,20 @@
"inheritFromPingSettings": "Inherit from Ping Settings",
"all": "All"
}
},
"call": {
"nextCallNotice": "Changes will be applied on your next calls.",
"inputDevices": "Input Devices",
"outputDevices": "Output Devices",
"default": "Default",
"inputMode": "Input Mode",
"openMic": "Open Mic",
"voiceActivity": "Voice Activity",
"pushToTalk": "Push to Talk",
"bindButton": "Bind",
"stopButton": "Stop",
"downloadAppNotice": "Download the Nerimity desktop app to use this feature without window tab focus."

}
},
"supportBlock": {
Expand Down

0 comments on commit 7a61b56

Please sign in to comment.