How to fix a string with variable
-
Hi @wpchefgadget,
I just translated your plugin to es_VE and I noticed that one string is not well formatted, I mean this one:
$this->show_error( __( 'The "'. $ip .'" IP range is invalid', 'limit-login-attempts-reloaded' ) );In the translation project, this line stop just before the variable, because the function __() doesn’t support it:

You can fix this issue rewriting the line this way:
/* translators: %s: IP number*/
$this->show_error( sprintf(__( 'The %s IP range is invalid', 'limit-login-attempts-reloaded' ), $ip) );Please note I added a comment above the line. That is necessary to understand what data is stored in the placeholder. Take a look to developer documentation about this topic for more info.
Hope this helps you!
The topic ‘How to fix a string with variable’ is closed to new replies.