1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/ducks/locale/locale.js

21 lines
595 B
JavaScript
Raw Normal View History

import * as actionConstants from '../../store/actionConstants';
2018-03-16 01:29:45 +01:00
export default function reduceLocaleMessages(state = {}, { type, payload }) {
switch (type) {
case actionConstants.SET_CURRENT_LOCALE:
2020-01-13 17:29:21 +01:00
return {
...state,
current: payload.messages,
currentLocale: payload.locale,
};
2018-03-16 01:29:45 +01:00
default:
return state;
2018-03-16 01:29:45 +01:00
}
}
export const getCurrentLocale = (state) => state.localeMessages.currentLocale;
export const getCurrentLocaleMessages = (state) => state.localeMessages.current;
export const getEnLocaleMessages = (state) => state.localeMessages.en;