• Hi Tim,

    I’m the developer of Complianz GDPR and Really Simple SSL.

    Since the introduction of PHP 8 the printf and sprintf functions can cause fatal errors when the number of arguments do not match. As a result we’ve been seeing a rise in support questions after updates.

    For example: a string like this:

    Please see the %sprivacy statement%s

    Can cause fatal errors in PHP 8 if a translator makes a mistake and types something like
    Please see the %privacy statement%s

    Or if the string changes, and the new string has a different number of arguments.

    It would really help if Loco Translate could give feedback on this to translators, by counting the number of arguments in the string, and giving a notice if it doesn’t match.

    Would be great if this can be added at some point!

    Rogier

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Tim W

    (@timwhitlock)

    Thanks Rogier. This has actually been on the TODO list for a long time.

    The same problem is also produced by automatic translation APIs which generally can’t cope with printf formatting.

    I’m already validating printf syntax on the main Loco platform, so I’m aware of various gotchas (edge cases) that have put me off adding it into the WordPress plugin thus far. WordPress users are often non-technical so adding this kind of validation will likely send more support requests in my direction too.

    You are quite right that PHP8 has made this more urgent. I will get around to it soon, but I can’t say when.

    Thread Starter Rogier Lankhorst

    (@rogierlankhorst)

    Ok, thanks, I’ll keep an eye out for the updates ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘feature request: feedback on %s inconsistencies in translations’ is closed to new replies.