mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-02 19:50:44 +05:30
23 lines
364 B
TypeScript
23 lines
364 B
TypeScript
import i18n from 'app/services/i18n';
|
|
|
|
import { Action } from './actions';
|
|
|
|
export interface State {
|
|
locale: string;
|
|
}
|
|
|
|
const defaultState: State = {
|
|
locale: i18n.detectLanguage(),
|
|
};
|
|
|
|
export default function (
|
|
state: State = defaultState,
|
|
{ type, payload }: Action,
|
|
): State {
|
|
if (type === 'i18n:setLocale') {
|
|
return payload;
|
|
}
|
|
|
|
return state;
|
|
}
|