Update error message for missing substitutions (#9541)

This updated error message shows the key of the message instead of the
message text itself, followed by the locale code.

This will make it easier to filter messages we want to ignore in
Sentry. Currently it's difficult to filter because the message is
radically different for each locale. With this change, we can add a
filter and use a glob for the last part to filter it for all locales.

It's still important to include the locale code in the message, so that
we can catch cases where the message has the wrong number of
substitutions for a specific locale.
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent 12f0c2161d
commit 4505ab5f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui/app/helpers/utils/i18n-helper.js

@ -64,7 +64,7 @@ export const getMessage = (localeCode, localeMessages, key, substitutions) => {
missingSubstitutionErrors[localeCode] = {}
}
missingSubstitutionErrors[localeCode][key] = true
const error = new Error(`Insufficient number of substitutions for message: '${phrase}'`)
const error = new Error(`Insufficient number of substitutions for key "${key}" with locale "${localeCode}"`)
log.error(error)
Sentry.captureException(error)
}

Loading…
Cancel
Save