mojira.dev
MC-262117

Language regex too broad

Language.UNSUPPORTED_FORMAT_PATTERN is intended to catch stray %d and %f placeholders in the translation resources and convert them to %s, since the translation component only supports this.

However, the regex is currently too broad – in particular it will also catch and convert %%dark and %%food (to %%sark and %%sood respectively), despite these being escaped.

This does not directly affect players, but it's a landmine waiting for mod developers and also your own dev team.

Comments 3

Affects resource packs in vanilla as well.

Simply fixed by checking if it's escaped or not, or by simply removing the converting since it has been deprecated for a ton of versions and vanilla is entirely converted.

Still exists in 1.21. Any content matching the following pattern will be replaced.

%(\d+\$)?[\d.]*[df]

Actually it looks like it’s worse in 1.21.1 (possibly earlier, didn’t check when it changed). When the regex matches it will now replace with “%$1s” instead of “%s”, which is both illegal syntax and had it been the right syntax would mess up the argument ordering.

migrated

(Unassigned)

Community Consensus

Platform

Low

Internationalisation, Resource Packs

1.19.4, 1.21

Retrieved