1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/test/unit
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
..
actions Remove seedWords completely from metamask state (#6920) 2019-07-26 10:35:21 -03:00
app Combine fetch-with-timeout implementations (#7084) 2019-09-04 17:00:11 -03:00
development Version 5.0.3 (#5785) 2018-11-20 08:34:14 -10:00
migrations Connections settings tab (#7013) 2019-08-15 18:37:18 -02:30
reducers Folder restructure (#6304) 2019-03-21 20:33:30 -02:30
responsive/components Folder restructure (#6304) 2019-03-21 20:33:30 -02:30
ui Prevent multiple warnings for the same locale message (#7091) 2019-09-06 10:47:07 -03:00
balance-formatter-test.js Folder restructure (#6304) 2019-03-21 20:33:30 -02:30
localhostState.js Enable indent linting via ESLint (#6936) 2019-07-31 10:17:11 -10:00
test-utils.js test - unit - add assertRejects to test asyncFns 2018-06-13 21:01:00 -07:00
util_test.js Folder restructure (#6304) 2019-03-21 20:33:30 -02:30