Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion web/src/components/LocaleSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GlobeIcon } from "lucide-react";
import { FC } from "react";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { locales } from "@/i18n";
import { locales, loadLocale } from "@/i18n";
import { getLocaleDisplayName } from "@/utils/i18n";

interface Props {
Expand All @@ -13,6 +13,9 @@ const LocaleSelect: FC<Props> = (props: Props) => {
const { onChange, value } = props;

const handleSelectChange = async (locale: Locale) => {
// Apply locale globally immediately
loadLocale(locale);
// Also notify parent component
onChange(locale);
};

Expand Down
5 changes: 4 additions & 1 deletion web/src/components/ThemeSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Monitor, Moon, MoonStar, Palette, Sun, Wallpaper } from "lucide-react";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { THEME_OPTIONS } from "@/utils/theme";
import { THEME_OPTIONS, loadTheme } from "@/utils/theme";

interface ThemeSelectProps {
value?: string;
Expand All @@ -21,6 +21,9 @@ const ThemeSelect = ({ value, onValueChange, className }: ThemeSelectProps = {})
const currentTheme = value || "system";

const handleThemeChange = (newTheme: string) => {
// Apply theme globally immediately
loadTheme(newTheme);
// Also notify parent component if callback is provided
if (onValueChange) {
onValueChange(newTheme);
}
Expand Down
Loading