fix: language update functionality #29900 (#29901)

* removed bug of language update work properly

* feat: implement general settings view and user form components for profile configuration

---------

Co-authored-by: Bandhan Majumder <[email protected]>
This commit is contained in:
AYUSHKUMAR_21JE0209andBandhan Majumder authored and GitHub committed 2026-08-05 06:31:10 +00:00
1 parent 5e3fe3cbe6
commit b2c28a23ab
2 files changed
+31 -24

No files matched your search

+16 -12
View File
@@ -1,5 +1,6 @@
"use client";
import { useMemo } from "react";
import { formatToLocalizedDate } from "@calcom/lib/dayjs";
import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -71,22 +72,25 @@ export function UserForm({
onSubmit: (data: FormValues) => void;
submitLabel?: string;
}) {
const { t } = useLocale();
const { t, i18n: { language } } = useLocale();
const timeFormatOptions = [
{ value: 12, label: t("12_hour") },
{ value: 24, label: t("24_hour") },
];
const weekStartOptions = [
{ value: "Sunday", label: nameOfDay(localeProp, 0) },
{ value: "Monday", label: nameOfDay(localeProp, 1) },
{ value: "Tuesday", label: nameOfDay(localeProp, 2) },
{ value: "Wednesday", label: nameOfDay(localeProp, 3) },
{ value: "Thursday", label: nameOfDay(localeProp, 4) },
{ value: "Friday", label: nameOfDay(localeProp, 5) },
{ value: "Saturday", label: nameOfDay(localeProp, 6) },
];
const weekStartOptions = useMemo(
() => [
{ value: "Sunday", label: nameOfDay(language || localeProp, 0) },
{ value: "Monday", label: nameOfDay(language || localeProp, 1) },
{ value: "Tuesday", label: nameOfDay(language || localeProp, 2) },
{ value: "Wednesday", label: nameOfDay(language || localeProp, 3) },
{ value: "Thursday", label: nameOfDay(language || localeProp, 4) },
{ value: "Friday", label: nameOfDay(language || localeProp, 5) },
{ value: "Saturday", label: nameOfDay(language || localeProp, 6) },
],
[language, localeProp]
);
const userRoleOptions = [
{ value: "USER", label: t("user") },
@@ -257,7 +261,7 @@ export function UserForm({
<>{t("time_format")}</>
</Label>
<Select
value={value}
value={timeFormatOptions.find((option) => option.value === (typeof value === "object" ? value?.value : value)) || value}
options={timeFormatOptions}
onChange={(event) => {
if (event) form.setValue("timeFormat", { ...event });
@@ -275,7 +279,7 @@ export function UserForm({
<>{t("start_of_week")}</>
</Label>
<Select
value={value}
value={weekStartOptions.find((option) => option.value === (typeof value === "object" ? value?.value : value)) || value}
options={weekStartOptions}
onChange={(event) => {
if (event) form.setValue("weekStart", { ...event });