From 5a5d68ab79c2fe4a34453c0769bf2a237b60e82b Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Sun, 18 May 2025 14:49:10 +0200 Subject: [PATCH] Move processors in their own file --- src/i18n/i18n.ts | 13 +------------ src/i18n/processors.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 src/i18n/processors.ts diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index 23a76a3..614f814 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -1,18 +1,7 @@ import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; import LanguageDetector from 'i18next-browser-languagedetector'; - -const capitalizeAll = { - type: 'postProcessor', - name: 'capitalizeAll', - process: (value: string) => value.toUpperCase(), -}; - -const capitalizeFirst = { - type: 'postProcessor', - name: 'capitalizeFirst', - process: (value: string) => value.charAt(0).toUpperCase() + value.slice(1), -}; +import { capitalizeAll, capitalizeFirst } from './processors'; export const supportedLanguages = { de: { name: 'Deutsch', flag: '🇩🇪' }, diff --git a/src/i18n/processors.ts b/src/i18n/processors.ts new file mode 100644 index 0000000..cb2f8e4 --- /dev/null +++ b/src/i18n/processors.ts @@ -0,0 +1,11 @@ +export const capitalizeAll = { + type: 'postProcessor', + name: 'capitalizeAll', + process: (value: string) => value.toUpperCase(), +}; + +export const capitalizeFirst = { + type: 'postProcessor', + name: 'capitalizeFirst', + process: (value: string) => value.charAt(0).toUpperCase() + value.slice(1), +};