mirror of
https://github.com/strapi/strapi.git
synced 2025-08-07 08:16:35 +00:00
27 lines
430 B
JavaScript
27 lines
430 B
JavaScript
![]() |
/*
|
||
|
*
|
||
|
* LanguageProvider reducer
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
import { fromJS } from 'immutable';
|
||
|
import {
|
||
|
CHANGE_LOCALE,
|
||
|
} from './constants';
|
||
|
|
||
|
const initialState = fromJS({
|
||
|
locale: 'en',
|
||
|
});
|
||
|
|
||
|
function languageProviderReducer(state = initialState, action) {
|
||
|
switch (action.type) {
|
||
|
case CHANGE_LOCALE:
|
||
|
return state
|
||
|
.set('locale', action.locale);
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default languageProviderReducer;
|