Compare commits

..

7 Commits

Author SHA1 Message Date
Marc Brooks 13aff1109a
Merge 748155d815 into cc9ff74276 2025-10-15 03:35:16 +00:00
Marc Brooks 748155d815
Added setting to choose locale 2025-10-14 22:35:05 -05:00
Marc Brooks 423bf1a53f
Delete unused messages 2025-10-14 18:50:21 -05:00
Marc Brooks 9e822850e0
Fix eslint 2025-10-14 17:15:25 -05:00
Marc Brooks c6a12588f5
Restore some missing blanks 2025-10-14 17:06:49 -05:00
Marc Brooks 75716405d5
Use getLocale for date, relative time, and money formatting 2025-10-14 14:49:45 -05:00
Marc Brooks 5363baa37a
Add inlang/paraglide-js localization
Remove the temporary directory after extracting buildkit
Localize the extension popovers.
Update package and fix tsconfig.json
Expand development directory guide
Move messages under localization
Popovers and sidebar
Update Chinese translations
Accidentally lost the changes that @ym provided, brought them back
File formatting pass
Localized all components, hooks, providers, hooks
Localize all pages except Settings
Bump packages
Settings Access page
Settings local auth page
Fix ref lint warning
Settings Advanced page
Fix UI lint warnings
There were a bunch of ref and useEffect violations.
Settings appearance page
Settings general pages
Settings hardware page
Settings keyboard page
Settings macros pages
Settings mouse page
Settings page
Settings video page
Settings network page
Fix compilation issues
Ran machine translate
2025-10-14 06:41:12 -05:00
2 changed files with 24 additions and 25 deletions

View File

@ -2,7 +2,7 @@ import { useMemo } from "react";
import { LuArrowUp, LuArrowDown, LuX, LuTrash2 } from "react-icons/lu"; import { LuArrowUp, LuArrowDown, LuX, LuTrash2 } from "react-icons/lu";
import { Button } from "@components/Button"; import { Button } from "@components/Button";
import { Combobox, ComboboxOption } from "@components/Combobox"; import { Combobox } from "@components/Combobox";
import Card from "@components/Card"; import Card from "@components/Card";
import FieldLabel from "@components/FieldLabel"; import FieldLabel from "@components/FieldLabel";
import { SelectMenuBasic } from "@components/SelectMenuBasic"; import { SelectMenuBasic } from "@components/SelectMenuBasic";
@ -179,7 +179,6 @@ export function MacroStepCard({
</div> </div>
</div> </div>
<div className="w-full flex flex-col gap-1"> <div className="w-full flex flex-col gap-1">
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<FieldLabel label={m.macro_step_keys_label()} description={m.macro_step_keys_description({ max: MAX_KEYS_PER_STEP })} /> <FieldLabel label={m.macro_step_keys_label()} description={m.macro_step_keys_description({ max: MAX_KEYS_PER_STEP })} />
@ -210,9 +209,8 @@ export function MacroStepCard({
)} )}
<div className="relative w-full"> <div className="relative w-full">
<Combobox <Combobox
onChange={(option) => { onChange={(value) => {
const selectedOption = option as ComboboxOption | null; onKeySelect({ value: value as string | null });
onKeySelect({ value: selectedOption?.value ?? null });
onKeyQueryChange(''); onKeyQueryChange('');
}} }}
displayValue={() => keyQuery} displayValue={() => keyQuery}
@ -245,4 +243,4 @@ export function MacroStepCard({
</div> </div>
</Card> </Card>
); );
} }

View File

@ -189,6 +189,8 @@ function UpdatingDeviceState({
otaState: UpdateState["otaState"]; otaState: UpdateState["otaState"];
onMinimizeUpgradeDialog: () => void; onMinimizeUpgradeDialog: () => void;
}) { }) {
const formatProgress = (progress: number) => `${Math.round(progress)}%`;
const calculateOverallProgress = (type: "system" | "app") => { const calculateOverallProgress = (type: "system" | "app") => {
const downloadProgress = Math.round((otaState[`${type}DownloadProgress`] || 0) * 100); const downloadProgress = Math.round((otaState[`${type}DownloadProgress`] || 0) * 100);
const updateProgress = Math.round((otaState[`${type}UpdateProgress`] || 0) * 100); const updateProgress = Math.round((otaState[`${type}UpdateProgress`] || 0) * 100);
@ -256,11 +258,6 @@ function UpdatingDeviceState({
); );
}; };
const systemOverallProgress = calculateOverallProgress("system");
const systemUpdateStatus = getUpdateStatus("system");
const appOverallProgress = calculateOverallProgress("app");
const appUpdateStatus = getUpdateStatus("app");
return ( return (
<div className="flex flex-col items-start justify-start space-y-4 text-left"> <div className="flex flex-col items-start justify-start space-y-4 text-left">
<div className="w-full max-w-sm space-y-4"> <div className="w-full max-w-sm space-y-4">
@ -296,7 +293,7 @@ function UpdatingDeviceState({
<p className="text-sm font-semibold text-black dark:text-white"> <p className="text-sm font-semibold text-black dark:text-white">
{m.general_update_system_update_title()} {m.general_update_system_update_title()}
</p> </p>
{systemOverallProgress < 100 ? ( {calculateOverallProgress("system") < 100 ? (
<LoadingSpinner className="h-4 w-4 text-blue-700 dark:text-blue-500" /> <LoadingSpinner className="h-4 w-4 text-blue-700 dark:text-blue-500" />
) : ( ) : (
<CheckCircleIcon className="h-4 w-4 text-blue-700 dark:text-blue-500" /> <CheckCircleIcon className="h-4 w-4 text-blue-700 dark:text-blue-500" />
@ -305,14 +302,16 @@ function UpdatingDeviceState({
<div className="h-2.5 w-full overflow-hidden rounded-full bg-slate-300 dark:bg-slate-600"> <div className="h-2.5 w-full overflow-hidden rounded-full bg-slate-300 dark:bg-slate-600">
<div <div
className="h-2.5 rounded-full bg-blue-700 transition-all duration-500 ease-linear dark:bg-blue-500" className="h-2.5 rounded-full bg-blue-700 transition-all duration-500 ease-linear dark:bg-blue-500"
style={{ width: `${systemOverallProgress}%` }} style={{
width: formatProgress(calculateOverallProgress("system")),
}}
></div> ></div>
</div> </div>
<div className="flex justify-between text-sm text-slate-600 dark:text-slate-300"> <div className="flex justify-between text-sm text-slate-600 dark:text-slate-300">
<span>{systemUpdateStatus}</span>{" "} <span>{getUpdateStatus("system")}</span>{" "}
{systemOverallProgress < 100 {calculateOverallProgress("system") < 100 ? (
? (<span>{`${systemOverallProgress}%`}</span>) <span>{formatProgress(calculateOverallProgress("system"))}</span>
: null} ) : null}
</div> </div>
</div> </div>
)} )}
@ -326,7 +325,7 @@ function UpdatingDeviceState({
<p className="text-sm font-semibold text-black dark:text-white"> <p className="text-sm font-semibold text-black dark:text-white">
{m.general_update_app_update_title()} {m.general_update_app_update_title()}
</p> </p>
{appOverallProgress < 100 ? ( {calculateOverallProgress("app") < 100 ? (
<LoadingSpinner className="h-4 w-4 text-blue-700 dark:text-blue-500" /> <LoadingSpinner className="h-4 w-4 text-blue-700 dark:text-blue-500" />
) : ( ) : (
<CheckCircleIcon className="h-4 w-4 text-blue-700 dark:text-blue-500" /> <CheckCircleIcon className="h-4 w-4 text-blue-700 dark:text-blue-500" />
@ -335,14 +334,16 @@ function UpdatingDeviceState({
<div className="h-2.5 w-full overflow-hidden rounded-full bg-slate-300 dark:bg-slate-600"> <div className="h-2.5 w-full overflow-hidden rounded-full bg-slate-300 dark:bg-slate-600">
<div <div
className="h-2.5 rounded-full bg-blue-700 transition-all duration-500 ease-linear dark:bg-blue-500" className="h-2.5 rounded-full bg-blue-700 transition-all duration-500 ease-linear dark:bg-blue-500"
style={{ width: `${appOverallProgress}%` }} style={{
width: formatProgress(calculateOverallProgress("app")),
}}
></div> ></div>
</div> </div>
<div className="flex justify-between text-sm text-slate-600 dark:text-slate-300"> <div className="flex justify-between text-sm text-slate-600 dark:text-slate-300">
<span>{appUpdateStatus}</span>{" "} <span>{getUpdateStatus("app")}</span>{" "}
{appOverallProgress < 100 {calculateOverallProgress("system") < 100 ? (
? (<span>{`${appOverallProgress}%`}</span>) <span>{formatProgress(calculateOverallProgress("app"))}</span>
: null} ) : null}
</div> </div>
</div> </div>
</> </>
@ -410,13 +411,13 @@ function UpdateAvailableState({
<p className="mb-4 text-sm text-slate-600 dark:text-slate-300"> <p className="mb-4 text-sm text-slate-600 dark:text-slate-300">
{versionInfo?.systemUpdateAvailable ? ( {versionInfo?.systemUpdateAvailable ? (
<> <>
<span className="font-semibold">{m.general_update_system_type()}</span>: {versionInfo?.remote?.systemVersion} <span className="font-semibold">{m.general_update_system_type()}</span>:&nbsp;{versionInfo?.remote?.systemVersion}
<br /> <br />
</> </>
) : null} ) : null}
{versionInfo?.appUpdateAvailable ? ( {versionInfo?.appUpdateAvailable ? (
<> <>
<span className="font-semibold">{m.general_update_application_type()}</span>: {versionInfo?.remote?.appVersion} <span className="font-semibold">{m.general_update_application_type()}</span>:&nbsp;{versionInfo?.remote?.appVersion}
</> </>
) : null} ) : null}
</p> </p>