From 0e196a68cf13acdb6de31bae50cc28b15bc727b0 Mon Sep 17 00:00:00 2001 From: lars Date: Fri, 25 Apr 2025 15:11:15 +0200 Subject: [PATCH] Fix: Standartsprache - deutsch & andere Sprachen deaktiviert --- .../forms/team-document-preferences-form.tsx | 2 +- packages/lib/constants/i18n.ts | 49 ++++++++++--------- .../migration.sql | 4 +- .../migration.sql | 2 +- .../update-team-document-settings.types.ts | 2 +- .../add-template-settings.types.tsx | 2 +- 6 files changed, 31 insertions(+), 30 deletions(-) diff --git a/apps/remix/app/components/forms/team-document-preferences-form.tsx b/apps/remix/app/components/forms/team-document-preferences-form.tsx index 2b4846116..531292445 100644 --- a/apps/remix/app/components/forms/team-document-preferences-form.tsx +++ b/apps/remix/app/components/forms/team-document-preferences-form.tsx @@ -74,7 +74,7 @@ export const TeamDocumentPreferencesForm = ({ documentVisibility: settings?.documentVisibility ?? 'EVERYONE', documentLanguage: isValidLanguageCode(settings?.documentLanguage) ? settings?.documentLanguage - : 'en', + : 'de', includeSenderDetails: settings?.includeSenderDetails ?? false, includeSigningCertificate: settings?.includeSigningCertificate ?? true, signatureTypes: extractTeamSignatureSettings(settings), diff --git a/packages/lib/constants/i18n.ts b/packages/lib/constants/i18n.ts index 12950b118..c8507756c 100644 --- a/packages/lib/constants/i18n.ts +++ b/packages/lib/constants/i18n.ts @@ -1,6 +1,7 @@ import { z } from 'zod'; -export const SUPPORTED_LANGUAGE_CODES = ['de', 'en', 'fr', 'es', 'it', 'pl'] as const; +//export const SUPPORTED_LANGUAGE_CODES = ['de', 'de', 'fr', 'es', 'it', 'pl'] as const; +export const SUPPORTED_LANGUAGE_CODES = ['de'] as const; //Nur Deutsch wird angeboten export const ZSupportedLanguageCodeSchema = z.enum(SUPPORTED_LANGUAGE_CODES).catch('de'); @@ -20,8 +21,8 @@ export type I18nLocaleData = { export const APP_I18N_OPTIONS = { supportedLangs: SUPPORTED_LANGUAGE_CODES, - sourceLang: 'en', - defaultLocale: 'en-US', + sourceLang: 'de', + defaultLocale: 'de-DE', } as const; type SupportedLanguage = { @@ -34,27 +35,27 @@ export const SUPPORTED_LANGUAGES: Record = { full: 'Deutsch', short: 'de', }, - en: { - full: 'English', - short: 'en', - }, - fr: { - full: 'French', - short: 'fr', - }, - es: { - full: 'Spanish', - short: 'es', - }, - it: { - full: 'Italian', - short: 'it', - }, - pl: { - short: 'pl', - full: 'Polish', - }, + //en: { + // full: 'English', + // short: 'en', + //}, + //fr: { + // full: 'French', + // short: 'fr', + //}, + //es: { + // full: 'Spanish', + // short: 'es', + //}, + //it: { + // full: 'Italian', + // short: 'it', + //}, + //pl: { + // short: 'pl', + // full: 'Polish', + //}, } satisfies Record; export const isValidLanguageCode = (code: unknown): code is SupportedLanguageCodes => - SUPPORTED_LANGUAGE_CODES.includes(code as SupportedLanguageCodes); + SUPPORTED_LANGUAGE_CODES.includes(code as SupportedLanguageCodes); \ No newline at end of file diff --git a/packages/prisma/migrations/20241101103425_add_language_column_for_documents_and_templates/migration.sql b/packages/prisma/migrations/20241101103425_add_language_column_for_documents_and_templates/migration.sql index 5a4dde1d8..43922dc59 100644 --- a/packages/prisma/migrations/20241101103425_add_language_column_for_documents_and_templates/migration.sql +++ b/packages/prisma/migrations/20241101103425_add_language_column_for_documents_and_templates/migration.sql @@ -1,5 +1,5 @@ -- AlterTable -ALTER TABLE "DocumentMeta" ADD COLUMN "language" TEXT NOT NULL DEFAULT 'en'; +ALTER TABLE "DocumentMeta" ADD COLUMN "language" TEXT NOT NULL DEFAULT 'de'; -- AlterTable -ALTER TABLE "TemplateMeta" ADD COLUMN "language" TEXT NOT NULL DEFAULT 'en'; +ALTER TABLE "TemplateMeta" ADD COLUMN "language" TEXT NOT NULL DEFAULT 'de'; diff --git a/packages/prisma/migrations/20241107223943_add_document_language_preference/migration.sql b/packages/prisma/migrations/20241107223943_add_document_language_preference/migration.sql index e99ae9a27..ef3926bef 100644 --- a/packages/prisma/migrations/20241107223943_add_document_language_preference/migration.sql +++ b/packages/prisma/migrations/20241107223943_add_document_language_preference/migration.sql @@ -1,2 +1,2 @@ -- AlterTable -ALTER TABLE "TeamGlobalSettings" ADD COLUMN "documentLanguage" TEXT NOT NULL DEFAULT 'en'; +ALTER TABLE "TeamGlobalSettings" ADD COLUMN "documentLanguage" TEXT NOT NULL DEFAULT 'de'; diff --git a/packages/trpc/server/team-router/update-team-document-settings.types.ts b/packages/trpc/server/team-router/update-team-document-settings.types.ts index 14263ce56..dbb783123 100644 --- a/packages/trpc/server/team-router/update-team-document-settings.types.ts +++ b/packages/trpc/server/team-router/update-team-document-settings.types.ts @@ -11,7 +11,7 @@ export const ZUpdateTeamDocumentSettingsRequestSchema = z.object({ .nativeEnum(DocumentVisibility) .optional() .default(DocumentVisibility.EVERYONE), - documentLanguage: z.enum(SUPPORTED_LANGUAGE_CODES).optional().default('en'), + documentLanguage: z.enum(SUPPORTED_LANGUAGE_CODES).optional().default('de'), includeSenderDetails: z.boolean().optional().default(false), includeSigningCertificate: z.boolean().optional().default(true), typedSignatureEnabled: z.boolean().optional().default(true), diff --git a/packages/ui/primitives/template-flow/add-template-settings.types.tsx b/packages/ui/primitives/template-flow/add-template-settings.types.tsx index 2e0a1cd86..f5d6b62ae 100644 --- a/packages/ui/primitives/template-flow/add-template-settings.types.tsx +++ b/packages/ui/primitives/template-flow/add-template-settings.types.tsx @@ -49,7 +49,7 @@ export const ZAddTemplateSettingsFormSchema = z.object({ language: z .union([z.string(), z.enum(SUPPORTED_LANGUAGE_CODES)]) .optional() - .default('en'), + .default('de'), emailSettings: ZDocumentEmailSettingsSchema, signatureTypes: z.array(z.nativeEnum(DocumentSignatureType)).min(1, { message: msg`At least one signature type must be enabled`.id,