1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-01-31 04:03:51 +01:00

Bump version to 2.15.1 and update build version to 25.12.25; refactor LanguageSwitcher and OnboardingDialog for improved locale handling

This commit is contained in:
Nayam Amarshe 2024-12-25 21:35:13 +05:30
parent 4f39acfc6f
commit e1aeaf1217
6 changed files with 11 additions and 7 deletions

View File

@ -2,7 +2,7 @@
"productName": "Upscayl",
"appId": "org.upscayl.Upscayl",
"afterSign": "./notarize.js",
"buildVersion": "25.06.01",
"buildVersion": "25.12.25",
"asar": true,
"asarUnpack": ["**/node_modules/sharp/**/*", "**/node_modules/@img/**/*"],
"extraFiles": [

View File

@ -1,7 +1,7 @@
{
"name": "upscayl",
"private": true,
"version": "2.15.0",
"version": "2.15.1",
"productName": "Upscayl",
"author": {
"name": "Nayam Amarshe",

View File

@ -13,9 +13,10 @@ import {
autoUpdateAtom,
enableContributionAtom,
} from "@/atoms/user-settings-atom";
import { useAtom } from "jotai";
import { useAtom, useAtomValue } from "jotai";
import useTranslation from "../hooks/use-translation";
import LanguageSwitcher from "../sidebar/settings-tab/language-switcher";
import { localeAtom } from "@/atoms/translations-atom";
type OnboardingStep = {
title: string;
@ -36,6 +37,7 @@ export function OnboardingDialog() {
const [currentStep, setCurrentStep] = useState(0);
const [settings, setSettings] = useState<Record<string, any>>({});
const locale = useAtomValue(localeAtom);
const [open, setOpen] = useState(false);
@ -97,7 +99,7 @@ export function OnboardingDialog() {
type: "info",
},
],
[],
[locale],
);
const currentStepData = onboardingSteps[currentStep];
@ -152,7 +154,8 @@ export function OnboardingDialog() {
className={cn(
"flex h-full w-full flex-col rounded-sm bg-primary p-8",
"h-auto w-auto gap-8",
currentStepData.configurationOptions[0].type === "video" && "p-0",
currentStepData.configurationOptions[0].type === "video" &&
"h-full w-full gap-0 p-0",
)}
>
{currentStepData.configurationOptions.map((option) => (

View File

@ -1,5 +1,5 @@
import { localeAtom, translationAtom } from "@/atoms/translations-atom";
import { useAtomValue, useSetAtom } from "jotai";
import { useAtom, useAtomValue, useSetAtom } from "jotai";
const locales = {
en: "English",
@ -14,7 +14,7 @@ const locales = {
};
const LanguageSwitcher = ({ hideLabel = false }: { hideLabel?: boolean }) => {
const setLocale = useSetAtom(localeAtom);
const [locale, setLocale] = useAtom(localeAtom);
const t = useAtomValue(translationAtom);
return (
@ -26,6 +26,7 @@ const LanguageSwitcher = ({ hideLabel = false }: { hideLabel?: boolean }) => {
<select
data-choose-theme
className="select select-primary"
value={useAtomValue(localeAtom)}
onChange={(e) => setLocale(e.target.value as keyof typeof locales)}
>
{Object.entries(locales)