1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00
metamask-extension/test
Mark Stacey 5363d6aa2a
Prevent multiple warnings for the same locale message (#7091)
* Prevent multiple warnings for the same locale message

Our i18n helper issues warnings whenever a requested message is
missing. These warnings are helpful in assisting translation efforts,
but they can be distracting otherwise. They're especially problematic
for locales that are missing many messages. My browser ended up
crashing on more than one occasion due to the sheer volume of warnings.

The warning has been updated to only be issued once per missing key.
This required updating the method to pass in the current locale. The
current locale was added to the warning itself as well, which could be
helpful for cases where a message is missing in both the current locale
and the fallback ('en').

* Change locale and localeMessages as single action

Updating the current locale and the locale messages resulted in two
renders, and during the first the state was inconsistent (it would say
the locale had changed to the new one, but still be using the old set
of locale messages). Instead the locale is now updated with one atomic
action.

This was required after adding the locale to the missing locale message
warning, as otherwise it would say the message was missing from the
wrong locale.
2019-09-06 10:47:07 -03:00
..
data Remove ComputedbalancesController (#7057) 2019-08-22 10:26:43 -02:30
e2e Return after rejecting promise in action (#7079) 2019-08-31 13:34:27 -03:00
integration Address book send plus contact list (#6914) 2019-07-31 17:26:44 -02:30
lib Check for unused function arguments (#6583) 2019-05-08 15:51:33 -04:00
stub Merge branch 'develop' into testing 2018-05-21 14:57:57 -07:00
unit Prevent multiple warnings for the same locale message (#7091) 2019-09-06 10:47:07 -03:00
web3 Enable indent linting via ESLint (#6936) 2019-07-31 10:17:11 -10:00
base.conf.js eslint --fix . 2018-07-02 18:49:33 -04:00
flat.conf.js eslint --fix . 2018-07-02 18:49:33 -04:00
helper.js 4byte fallback (#6551) 2019-06-18 09:47:14 -02:30
setup.js Upgrade to Babel 7 (#6942) 2019-08-02 13:17:20 -02:30