jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Admin Page: Error notices which use args in strings for localization are not currently replacing the arguments.

Open oskosk opened this issue 10 years ago • 1 comments

When some async action is executed and it errors, we usually show a red global notice but it's not working great.

Steps to reproduce the issue

Description incoming

What I expected

To see a clean/descriptive string in the error notice.

What happened instead

Currently if one perceives an error, the message looks weird as the module name or other arguments are not replaced in the string used to localize the message.

oskosk avatar Aug 27 '16 17:08 oskosk

It usually happens when a placeholder is omitted or entered incorrectly. You can also see the i18n exception in the console when that notice is displayed. Some examlpes are:

Actual string %(module)s error: %(error)d The problem here that the type of the placeholder is d, when it should be s.

Should be %(module)s error: %(error)s

Actual string There is a problem with %(plugin) The problem here is that the placeholder type is omitted.

Should be There is a problem with %(plugin)s

zinigor avatar Aug 29 '16 12:08 zinigor