Fix: Standartsprache - deutsch & andere Sprachen deaktiviert

This commit is contained in:
2025-04-25 15:11:15 +02:00
parent 643e37a0aa
commit 0e196a68cf
6 changed files with 31 additions and 30 deletions

View File

@@ -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),

View File

@@ -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<string, SupportedLanguage> = {
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<SupportedLanguageCodes, SupportedLanguage>;
export const isValidLanguageCode = (code: unknown): code is SupportedLanguageCodes =>
SUPPORTED_LANGUAGE_CODES.includes(code as SupportedLanguageCodes);
SUPPORTED_LANGUAGE_CODES.includes(code as SupportedLanguageCodes);

View File

@@ -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';

View File

@@ -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';

View File

@@ -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),

View File

@@ -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,