Skip to content
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

Fix Unknown format specifier in translation in Live plugin #19928

Closed
tsteur opened this issue Oct 30, 2022 · 3 comments
Closed

Fix Unknown format specifier in translation in Live plugin #19928

tsteur opened this issue Oct 30, 2022 · 3 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Oct 30, 2022

see https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/Live/lang/id.json#L58

it says % 1$s Jika when it should be %1$s Jika and there is a % 2$s which should be %2$s.

This happened when opening /index.php?date=today&module=Live&format=html&forceView=1&viewDataTable=VisitorLog&action=getLastVisitsDetails&small=1&period=day&idSite=1&segment=&widget=&showtitle=1 resulting in this error:

Error: {"message":"Unknown format specifier "$"","file":"/var/www/html/core/Translation/Translator.php","line":100,"request_id":"048c8","backtrace":" on /var/www/html/core/Translation/Translator.php(100)\n#0 /var/www/html/core/Translation/Translator.php(100): vsprintf('Tabel ini menun...', Array)\n#1 /var/www/html/core/Piwik.php(916): Piwik\Translation\Translator->translate('Tabel ini menun...', Array, 'id')\n#2

I'll mark this as a regression as I believe this translation key changed only recently.

I would adjust the translation myself but I don't think I'm set up in Weblate to do it and we need to make sure to have the translation in the next patch release.

Can we maybe cover something like this in a test to detect it proactively?

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should. labels Oct 30, 2022
@bx80 bx80 added this to the 5.0.0 milestone Oct 30, 2022
@bx80
Copy link
Contributor

bx80 commented Oct 30, 2022

I've assigned this to the next patch release as it's a regression (and should be trivial to fix)

@bx80 bx80 modified the milestones: 5.0.0, 4.12.4 Oct 30, 2022
@sgiehl
Copy link
Member

sgiehl commented Nov 2, 2022

I have fixed those on weblate so the next translation update should fix it. There actually should be tests to check that stuff, but I think they are currently marked as incomplete instead of failing. Need to check them...

@mattab
Copy link
Member

mattab commented Jan 9, 2023

This particular issue is fixed. Created follow up #20181

@mattab mattab closed this as completed Jan 9, 2023
@justinvelluppillai justinvelluppillai changed the title Unknown format specifier in translation in Live/lang/id.json Fix Unknown format specifier in translation in Live plugin Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

No branches or pull requests

5 participants