1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

i18n: fix missing locale for "en" error (#17014)

on locale change
This commit is contained in:
Ariella Vu 2022-12-22 00:31:06 +07:00 committed by GitHub
parent ee321971e7
commit 25e9184d9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -2,8 +2,8 @@ import React, { Component, createContext, useMemo } from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import { getMessage } from '../helpers/utils/i18n-helper';
import { getCurrentLocale } from '../ducks/metamask/metamask';
import {
getCurrentLocale,
getCurrentLocaleMessages,
getEnLocaleMessages,
} from '../ducks/locale/locale';

View File

@ -6,12 +6,15 @@ export default function reduceLocaleMessages(state = {}, { type, value }) {
return {
...state,
current: value.messages,
currentLocale: value.locale,
};
default:
return state;
}
}
export const getCurrentLocale = (state) => state.localeMessages.currentLocale;
export const getCurrentLocaleMessages = (state) => state.localeMessages.current;
export const getEnLocaleMessages = (state) => state.localeMessages.en;