diff --git a/app/(dashboard)/calendar/calendar-client.tsx b/app/(dashboard)/calendar/calendar-client.tsx index 36a1005..8e17fab 100644 --- a/app/(dashboard)/calendar/calendar-client.tsx +++ b/app/(dashboard)/calendar/calendar-client.tsx @@ -56,14 +56,6 @@ export type CalendarEventItem = { translations?: Record>; }; -const typeLabels = { - meeting: "Toplantı", - focus: "Odak", - deadline: "Deadline", - personal: "Kişisel", - finance: "Finans", -}; - const typeClasses = { meeting: "border-blue-200 bg-blue-50 text-blue-700", focus: "border-emerald-200 bg-emerald-50 text-emerald-700", @@ -251,7 +243,7 @@ function EventList({ ) : null} - {t(`calendar.types.${event.type}` as any)} + {t(`calendar.types.${event.type}`)} {!compact ? (
diff --git a/app/(dashboard)/clients/clients-client.tsx b/app/(dashboard)/clients/clients-client.tsx index 6c9089c..2713280 100644 --- a/app/(dashboard)/clients/clients-client.tsx +++ b/app/(dashboard)/clients/clients-client.tsx @@ -217,7 +217,7 @@ export function ClientsClient({ return ( handleDrop(stage.id)} @@ -383,7 +383,7 @@ function ClientRow({ client, activeLocales }: { client: ClientListItem, activeLo
- {t(`clients.pipeline.${stage.id}` as any)} + {t(`clients.pipeline.${stage.id}`)}
@@ -528,7 +528,7 @@ function ClientFormFields({ client, activeLocales }: { client?: ClientListItem, {pipelineStages.map(stage => ( - {t(`clients.pipeline.${stage.id}` as any)} + {t(`clients.pipeline.${stage.id}`)} ))} diff --git a/app/(dashboard)/projects/projects-client.tsx b/app/(dashboard)/projects/projects-client.tsx index 0cf1d39..5401856 100644 --- a/app/(dashboard)/projects/projects-client.tsx +++ b/app/(dashboard)/projects/projects-client.tsx @@ -73,12 +73,14 @@ export type ProjectListItem = { translations?: LocalizedFieldValues; }; -const typeLabels = (t: any) => ({ +type Translate = ReturnType; + +const typeLabels = (t: Translate) => ({ client_project: t("projects.types.client"), side_project: t("projects.types.side"), }); -const statusLabels = (t: any) => ({ +const statusLabels = (t: Translate) => ({ planning: t("projects.status.planning"), active: t("projects.status.active"), paused: t("projects.status.paused"), @@ -605,7 +607,11 @@ function ProjectFormFields({ idPrefix={`project-${project?.id || "new"}`} defaultLocale={localization.defaultLocale} locales={localization.locales} - fields={contentTranslationRegistry.project.map((f: any) => ({ ...f, label: (t as any)(`projects.fields.${f.name}`) || f.label, placeholder: f.placeholder ? (t as any)(`projects.placeholders.${f.name}`) || f.placeholder : undefined }))} + fields={contentTranslationRegistry.project.map((f) => ({ + ...f, + label: t(`projects.fields.${f.name}`) || f.label, + placeholder: f.placeholder ? t(`projects.placeholders.${f.name}`) || f.placeholder : undefined, + }))} values={project?.translations} fallbackValues={{ name: project?.name, diff --git a/app/(dashboard)/settings/languages/[locale]/translations/translation-editor.tsx b/app/(dashboard)/settings/languages/[locale]/translations/translation-editor.tsx index 7e5009c..38ed484 100644 --- a/app/(dashboard)/settings/languages/[locale]/translations/translation-editor.tsx +++ b/app/(dashboard)/settings/languages/[locale]/translations/translation-editor.tsx @@ -120,7 +120,7 @@ export function TranslationEditor({
- setFilter(value as typeof filter)}> diff --git a/app/(dashboard)/settings/languages/import-export/actions.ts b/app/(dashboard)/settings/languages/import-export/actions.ts index 2e8eb13..02dc8fc 100644 --- a/app/(dashboard)/settings/languages/import-export/actions.ts +++ b/app/(dashboard)/settings/languages/import-export/actions.ts @@ -21,8 +21,8 @@ export async function importTranslationsAction(content: string) { service.importPackage(actor, data); revalidatePath("/settings/languages"); return { success: true }; - } catch (error: any) { + } catch (error) { console.error("Import error:", error); - return { errorKey: "common.error.description", details: error.message }; + return { errorKey: "common.error.description", details: error instanceof Error ? error.message : String(error) }; } } diff --git a/app/(dashboard)/tasks/tasks-client.tsx b/app/(dashboard)/tasks/tasks-client.tsx index ba3c189..0a195c3 100644 --- a/app/(dashboard)/tasks/tasks-client.tsx +++ b/app/(dashboard)/tasks/tasks-client.tsx @@ -60,19 +60,6 @@ export type TaskListItem = { translations?: LocalizedFieldValues; }; -const statusLabels = { - todo: "Yapılacak", - in_progress: "Devam ediyor", - done: "Tamamlandı", -}; - -const priorityLabels = { - low: "Düşük", - medium: "Orta", - high: "Yüksek", - urgent: "Acil", -}; - const priorityClasses = { low: "border-zinc-200 bg-zinc-50 text-zinc-700", medium: "border-blue-200 bg-blue-50 text-blue-700", @@ -687,7 +674,11 @@ function TaskFormFields({ idPrefix={`task-${task?.id || "new"}`} defaultLocale={localization.defaultLocale} locales={localization.locales} - fields={contentTranslationRegistry.task.map((f: any) => ({ ...f, label: (t as any)(`tasks.fields.${f.name}`) || f.label, placeholder: f.placeholder ? (t as any)(`tasks.placeholders.${f.name}`) || f.placeholder : undefined }))} + fields={contentTranslationRegistry.task.map((f) => ({ + ...f, + label: t(`tasks.fields.${f.name}`) || f.label, + placeholder: f.placeholder ? t(`tasks.placeholders.${f.name}`) || f.placeholder : undefined, + }))} values={task?.translations} fallbackValues={{ title: task?.title, diff --git a/scripts/i18n-v2-auth-pages-smoke.ts b/scripts/i18n-v2-auth-pages-smoke.ts index ac9d4aa..392d80d 100644 --- a/scripts/i18n-v2-auth-pages-smoke.ts +++ b/scripts/i18n-v2-auth-pages-smoke.ts @@ -1,7 +1,7 @@ import assert from "node:assert/strict"; import { readFileSync } from "fs"; import { join } from "path"; -import { compareCatalogKeys, I18N_NAMESPACES } from "../lib/i18n"; +import { compareCatalogKeys } from "../lib/i18n"; import { trCatalog } from "../locales/tr"; import { enCatalog } from "../locales/en"; @@ -24,7 +24,7 @@ for (const page of authPages) { assert.equal(content.includes("resolvePublicLocale"), true, `${page} missing resolvePublicLocale`); } -const result = compareCatalogKeys(trCatalog as any, enCatalog as any, ["auth"]); +const result = compareCatalogKeys(trCatalog, enCatalog, ["auth"]); const authMissingInEn = result.missingInRight.filter((k: string) => k.startsWith("auth.")); const authMissingInTr = result.missingInLeft.filter((k: string) => k.startsWith("auth.")); diff --git a/server/domain/validation.ts b/server/domain/validation.ts index 1184a3a..8c1daab 100644 --- a/server/domain/validation.ts +++ b/server/domain/validation.ts @@ -219,6 +219,7 @@ export const revisionCreateSchema = z.object({ id: resourceIdSchema.optional(), projectId: resourceIdSchema, description: z.string().trim().min(1).max(20_000), + sourceLocale: z.string().trim().min(2).max(12).nullable().optional(), }); export const revisionStatusSchema = z.enum(revisionStatuses); diff --git a/server/services/domain.ts b/server/services/domain.ts index 5c993ee..e385709 100644 --- a/server/services/domain.ts +++ b/server/services/domain.ts @@ -433,6 +433,7 @@ export class DomainService { clientId: scope.clientId, requestedByUserId: scope.authUserId, description: value.description, + sourceLocale: value.sourceLocale, }).returning().get(); }, { behavior: "immediate" }); }