Your error (actually a warning) seems to come from the Theme Check plugin.
There’s nothing wrong with the code you’re showing above. 'acf'
is your text domain. and the _n function takes four arguments as you’ve given it.
It strikes me that the Theme Check plugin is not very good at static analysis of function calls. I actually get a different warning with your code (possibly a later version) It seems it can’t cope with array expressions like $field['min']
. But of course WordPress/PHP will execute this just fine.
As you discovered yourself, assigning a variable gets rid of the warning. So doing something like the following is absolutely fine and seems to satisfy Theme Check’s code scanner.
$n = $field['min'];
$valid = _n( '....', '....', $n, 'acf' );
$valid = sprintf( $valid, $field['label'], $n );