2020-05-06 20:56:09 +02:00
|
|
|
import * as actionConstants from '../../store/actionConstants'
|
2018-03-16 01:29:45 +01:00
|
|
|
|
2020-02-06 17:38:14 +01:00
|
|
|
export default function reduceLocaleMessages (state = {}, { type, value }) {
|
|
|
|
switch (type) {
|
2020-01-09 04:34:58 +01:00
|
|
|
case actionConstants.SET_CURRENT_LOCALE:
|
2020-01-13 17:29:21 +01:00
|
|
|
return {
|
2020-02-06 17:38:14 +01:00
|
|
|
...state,
|
|
|
|
current: value.messages,
|
2020-01-13 17:29:21 +01:00
|
|
|
}
|
2018-03-16 01:29:45 +01:00
|
|
|
default:
|
2020-02-06 17:38:14 +01:00
|
|
|
return state
|
2018-03-16 01:29:45 +01:00
|
|
|
}
|
|
|
|
}
|
2020-03-23 18:07:05 +01:00
|
|
|
|
|
|
|
export const getCurrentLocaleMessages = (state) => state.localeMessages.current
|
|
|
|
|
|
|
|
export const getEnLocaleMessages = (state) => state.localeMessages.en
|