feat(i18n): localize core dashboard flows
This commit is contained in:
@@ -123,15 +123,9 @@ export function CalendarClient({ events, clients, projects, tasks, activeLocales
|
||||
<p className="text-sm text-muted-foreground">{t("common.itemsCount", { count: events.length })}</p>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button effect="shine" type="button" variant="secondary" onClick={() => shiftMonth(-1)}>
|
||||
Önceki
|
||||
</Button>
|
||||
<Button effect="shine" type="button" variant="secondary" onClick={() => setMonthDate(new Date())}>
|
||||
Bugün
|
||||
</Button>
|
||||
<Button effect="shine" type="button" variant="secondary" onClick={() => shiftMonth(1)}>
|
||||
Sonraki
|
||||
</Button>
|
||||
<Button effect="shine" type="button" variant="secondary" onClick={() => shiftMonth(-1)}>{t("calendar.navigation.previous")}</Button>
|
||||
<Button effect="shine" type="button" variant="secondary" onClick={() => setMonthDate(new Date())}>{t("calendar.navigation.today")}</Button>
|
||||
<Button effect="shine" type="button" variant="secondary" onClick={() => shiftMonth(1)}>{t("calendar.navigation.next")}</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -210,7 +204,7 @@ export function CalendarClient({ events, clients, projects, tasks, activeLocales
|
||||
|
||||
<Card>
|
||||
<CardContent className="space-y-3 p-4">
|
||||
<h2 className="text-base font-semibold text-foreground">Yaklaşan etkinlikler</h2>
|
||||
<h2 className="text-base font-semibold text-foreground">{t("calendar.upcoming")}</h2>
|
||||
<EventList events={upcomingEvents} clients={clients} projects={projects} tasks={tasks} activeLocales={activeLocales} compact />
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -237,7 +231,7 @@ function EventList({
|
||||
}) {
|
||||
const t = useTranslations();
|
||||
if (events.length === 0) {
|
||||
return <p className="text-sm text-muted-foreground">Etkinlik yok.</p>;
|
||||
return <p className="text-sm text-muted-foreground">{t("calendar.noEvents")}</p>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -20,7 +20,7 @@ function buildTranslations(rows: ContentTranslationRow[] | undefined) {
|
||||
export default async function CalendarPage() {
|
||||
const { context, actor, service } = await requireFreelancerBackend();
|
||||
const resolvedLocale = await resolveFreelancerLocale(context);
|
||||
const payload = getClientI18nPayload(resolvedLocale.locale, ["calendar"]);
|
||||
const payload = getClientI18nPayload(resolvedLocale.locale, ["calendar", "common"]);
|
||||
|
||||
const i18n = new I18nService(getSqliteConnection().db);
|
||||
const activeLocales = i18n.listLocales(actor).filter(l => l.status !== "archived").map(l => ({ code: l.code, name: l.nativeName }));
|
||||
@@ -61,7 +61,7 @@ export default async function CalendarPage() {
|
||||
.map(({ id, title }) => ({ id, title }));
|
||||
|
||||
return (
|
||||
<I18nProvider payload={payload}>
|
||||
<I18nProvider {...payload}>
|
||||
<CalendarClient events={events} clients={clientOptions} projects={projectOptions} tasks={taskOptions} activeLocales={activeLocales} />
|
||||
</I18nProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user