localicious icon indicating copy to clipboard operation
localicious copied to clipboard

iOS code generation can cause runtime exception if number of parameters is not the same as the localization format

Open leonardowf opened this issue 4 years ago • 0 comments

Right now, if you by mistake provide one less argument to the Localicious format, the string replacement throws a run time exception.

The problem:

The following example string: "Screen.Component.Button.ACCESSIBILITY.LABEL" = "%1$@%2$@, hello %3$@.";

when replaced with two arguments result in an EXC_BAD_ACCESS exception

Proposal

Count the number of arguments and placeholders and avoid the exception if they don't match

leonardowf avatar May 29 '20 11:05 leonardowf