Added language support
This commit is contained in:
26
public/reducers/language.js
Normal file
26
public/reducers/language.js
Normal file
@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
import Language from './../language/Language';
|
||||
import { SET_LANGUAGE, LANGUAGES } from './../actions/language';
|
||||
|
||||
const initialState = {
|
||||
code: Language.getLanguage()
|
||||
};
|
||||
|
||||
function language(state, action) {
|
||||
if(typeof state === typeof undefined) {
|
||||
state = initialState;
|
||||
}
|
||||
|
||||
switch(action.type) {
|
||||
case SET_LANGUAGE:
|
||||
if(!(action.theme)) return state;
|
||||
return {
|
||||
code: action.code
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
export default language;
|
Reference in New Issue
Block a user