Preview: localesReducer.ts
Size: 463 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/frontend/store/reducers/localesReducer.ts
import type { Locale } from '../../../locale/config.js'
import { LOCALE_INITIALIZE } from '../actions/initialize-locale.js'
export type LolcaleInState = Locale
const defaultLocale = { language: 'en', translations: {} } as Locale
export const localesReducer = (
state: Locale = defaultLocale,
action: {
type: string
data: Locale
},
) => {
switch (action.type) {
case LOCALE_INITIALIZE:
return action.data
default:
return state
}
}
Directory Contents
Dirs: 0 × Files: 16