New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translations: when wrong number of placeholders, error: sprintf() Too few arguments #7546
Comments
Hi Diego, what is the problem here? |
labelSecondsPlural sprintf format mask is expected to contain only 1 argument, but I noticed that in some cases "%s %s" generate a warning which is logged into piwik.log file:
|
maybe this is caused by some translations having the wrong number of placeholders in the translation strings? we should have a test that checks and notices when a translation has invalid number of placeholders. (fyi @sgiehl maybe transifex has a mechanism to enforce placeholder count to be the same as in english strings? if not, we continue to remove translations that have wrong number of |
Transifex is able to check that. Currently I have set that it produces a
warning only. But we could set it to an error aswell. Need to check that
works well before...
|
nice to hear! let's try to ensure that all translations when they make it into Piwik git repo, use the same number of placeholders as in the english translation, in our transifex migration (#7567) this should therefore solve this issue in the future so i'm decreasing priority |
we have tests for translation files also checking for the correct parameter count. But they are only marked as "skipped" when failing, so we will not get notice about that. |
Thanks for your comments, |
I've rechecked that issue. As long as we ALWAYS run a translation update before building a release, this issue should not appear in any release as an update will filter such translations. Btw. tests will fail aswell if the parameter count for any translation does not match, so I'll close this ticket as we can't do much more to prevent such errors in the furure. |
Hi all,
may you verify sprintf argument usage at:
core/DataTable/Filter/BeautifyTimeRangeLabels.php line 115
Thanks a lot
Diego
The text was updated successfully, but these errors were encountered: