mirror of
https://github.com/strapi/strapi.git
synced 2025-08-11 10:18:28 +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;
|