Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#13585 closed Bug Report - General (fixed)

Channelscan progress lost in translation

Reported by: Klaas de Waal Owned by: Klaas de Waal
Priority: minor Milestone: 31.0
Component: MythTV - Channel Scanner Version: Master Head
Severity: medium Keywords: Translation
Cc: Nick, Morrott, John, Poet Ticket locked: no

Description (last modified by Klaas de Waal)

The presentation of the progress and the signal strength by the channelscanner is wrong since a few days. See the attached picture. This regression is likely to be have been introduced by the translations recently committed.

The relevant bit of code in channelscanner_gui_scan_pane.cpp is from 15 Jul 2017, commit 24064ac6e618bc5f340c08116c6ed4dae2c0aaa6 and has always worked correct. This is the code:

void ChannelScannerGUIScanPane::SetStatusSignalStrength(int value)
{
    if (m_signalStrengthText)
        m_signalStrengthText->SetText(tr("%1%")
                               .arg(static_cast<uint>(value * 100 / 65535)));

It looks to me that it tries to translate the number. I am not aware that this is done anywhere else in the code and if the translation is done by a string to string replacement then you need a lot of strings.....

I intend to fix this now for the time being by changing the code to this:

void ChannelScannerGUIScanPane::SetStatusSignalStrength(int value)
{
    if (m_signalStrengthText)
        m_signalStrengthText->SetText(QString("%1%")
                               .arg(static_cast<uint>(value * 100 / 65535)));

which will restore the old behavior.

If the intention is really to translate the number then the original code can always be restored once the translation is fixed.

It is possible that the changed behavior of the "tr" function may have effects elsewhere as well.

Attachments (1)

mythtv-setup-scan-screenshot.png (244.8 KB ) - added by Klaas de Waal 6 years ago.
Channelscan Scan Progress and Signal Strength presentation wrong

Download all attachments as: .zip

Change History (9)

by Klaas de Waal, 6 years ago

Channelscan Scan Progress and Signal Strength presentation wrong

comment:1 by Klaas de Waal, 6 years ago

Description: modified (diff)

comment:2 by Klaas de Waal <kdewaal@…>, 6 years ago

In 66b7dd2d0b/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:3 by Klaas de Waal, 6 years ago

Description: modified (diff)
Milestone: needs_triage31.0

This does of course not solve the underlying problem in the translation system, which produces now the string "18:{1%?}" instead of "18%" for

tr("%1%).arg(18)

as shown in the attached screenshot.

comment:4 by Klaas de Waal <kdewaal@…>, 6 years ago

In 8f2475fb83/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:5 by Klaas de Waal, 6 years ago

Resolution: Fixed
Status: assignedclosed

comment:6 by Ian Campbell <ijc@…>, 6 years ago

Resolution: Fixedfixed

In 1236aef0a/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:7 by Ian Campbell <ijc@…>, 6 years ago

In 672d45b7b/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:8 by Klaas de Waal, 6 years ago

Looks to me that today's commit should refer to ticket #13595

Note: See TracTickets for help on using tickets.