mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
## Description Add initial French translations <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for the French language, enhancing accessibility for French-speaking users. - Introduced localized French messages for various application functionalities, improving user experience. - **Bug Fixes** - Minor formatting updates in French translation files to remove extraneous newline characters. - **Chores** - Updated line references in French translation files to maintain alignment with code changes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Lucas Smith <me@lucasjamessmith.me> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: github-actions <github-actions@documenso.com>
46 lines
951 B
TypeScript
46 lines
951 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const SUPPORTED_LANGUAGE_CODES = ['de', 'en', 'fr'] as const;
|
|
|
|
export const ZSupportedLanguageCodeSchema = z.enum(SUPPORTED_LANGUAGE_CODES).catch('en');
|
|
|
|
export type SupportedLanguageCodes = (typeof SUPPORTED_LANGUAGE_CODES)[number];
|
|
|
|
export type I18nLocaleData = {
|
|
/**
|
|
* The supported language extracted from the locale.
|
|
*/
|
|
lang: SupportedLanguageCodes;
|
|
|
|
/**
|
|
* The preferred locales.
|
|
*/
|
|
locales: string[];
|
|
};
|
|
|
|
export const APP_I18N_OPTIONS = {
|
|
supportedLangs: SUPPORTED_LANGUAGE_CODES,
|
|
sourceLang: 'en',
|
|
defaultLocale: 'en-US',
|
|
} as const;
|
|
|
|
type SupportedLanguage = {
|
|
full: string;
|
|
short: string;
|
|
};
|
|
|
|
export const SUPPORTED_LANGUAGES: Record<string, SupportedLanguage> = {
|
|
de: {
|
|
full: 'German',
|
|
short: 'de',
|
|
},
|
|
en: {
|
|
full: 'English',
|
|
short: 'en',
|
|
},
|
|
fr: {
|
|
full: 'French',
|
|
short: 'fr',
|
|
},
|
|
} satisfies Record<SupportedLanguageCodes, SupportedLanguage>;
|