1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00
metamask-extension/ui
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
..
app Prevent multiple warnings for the same locale message (#7091) 2019-09-06 10:47:07 -03:00
design Revert "[ImgBot] Optimize images" (#7027) 2019-08-16 12:32:02 -02:30
lib Remove unused lostAccounts state (#6979) 2019-08-08 17:03:10 -02:30
index.html Right-to-left CSS (using module for conversion) (#7072) 2019-09-03 14:47:54 -03:00
index.js Right-to-left CSS (using module for conversion) (#7072) 2019-09-03 14:47:54 -03:00