mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-11-01 21:47:05 +00:00
Move processors in their own file
This commit is contained in:
@@ -1,18 +1,7 @@
|
|||||||
import i18n from 'i18next';
|
import i18n from 'i18next';
|
||||||
import { initReactI18next } from 'react-i18next';
|
import { initReactI18next } from 'react-i18next';
|
||||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||||
|
import { capitalizeAll, capitalizeFirst } from './processors';
|
||||||
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),
|
|
||||||
};
|
|
||||||
|
|
||||||
export const supportedLanguages = {
|
export const supportedLanguages = {
|
||||||
de: { name: 'Deutsch', flag: '🇩🇪' },
|
de: { name: 'Deutsch', flag: '🇩🇪' },
|
||||||
|
|||||||
11
src/i18n/processors.ts
Normal file
11
src/i18n/processors.ts
Normal file
@@ -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),
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user