Support » Plugin: Loco Translate » Many errors

  • In my error log on the server there are dozens of errors like this

    Got error ‘PHP message: PHP Warning: sprintf(): Too few arguments in /home/*****/domains/*******.nl/public_html/wp-content/plugins/loco-translate/src/hooks/AdminHooks.php on line 66’

    It is always line 66.

    What is wrong and how can I fix this?

    Maybe good to know that I also use TranslatePress.

    Kind regards, Gerson

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

    (@timwhitlock)

    What language are you viewing the admin area in?

    The english text from line 66 is this:

    Administrators and auditors may wish to review Loco\'s <a href="%s">plugin privacy notice</a>

    This has one argument. If your translation of this text has more arguments you would get this error.

    Thread Starter gerske

    (@gerske)

    We are using the Dutch language.

    Thread Starter gerske

    (@gerske)

    What can I do to fix this? I’d prefer to stay with the Dutch admin.

    Thanks for the fast reply btw!

    Thread Starter gerske

    (@gerske)

    I have never translated “Administrators and auditors may wish to review Loco” btw. It might have been done automatically via Translatepress though.

    Plugin Author Tim W

    (@timwhitlock)

    To fix it you have to fix the translation.

    I note that the community Dutch translation seems correct. What does your translation look like?

    Plugin Author Tim W

    (@timwhitlock)

    I can’t comment on TranslatePress and have no idea what it may be doing on your system. All I can tell you is that the value returned from __('Administrators.....','loco-translate') is badly formed and this is why you get an error. This is not a bug in my code, but is easily fixed if you can get to the bottom of it.

    Thread Starter gerske

    (@gerske)

    EN:
    Administrators and auditors may wish to review Loco's <a href="%s">plugin privacy notice</a>.

    NL:
    Bestuurders en controleurs kunnen wensen om te beoordelen Loco's<a href="%s">plugin privacy kennisgeving</a>.

    This Dutch translation doesn’t make sense. It seems like a bad machine translation. But code wise it doesn’t seem wrong. This does not explain the errors.

    • This reply was modified 10 months, 1 week ago by gerske.
    • This reply was modified 10 months, 1 week ago by gerske.
    Thread Starter gerske

    (@gerske)

    I now have tried to delete the whole translation of this string in Loco Translate Dutch language, and I still get this error.

    Also tried to copy the original string to the Dutch version. Still getting the errors in my logs. With every webpage request on my site I get this error in my log.

    Really don’t know what to do.

    Plugin Author Tim W

    (@timwhitlock)

    I don’t speak Dutch, but that translation was approved by a human. I can see the spacing is bad, but this would not produce your error.

    The only way you will resolve this is to debug line 66 by looking at the translation that actually gets passed to the sprintf function. It could be modified by any number of filters. Perhaps some other plugin is doing that. I would disable them one by one until you find the culprit.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Many errors’ is closed to new replies.