Only display old and new versions when both are available
ClosedPublic

Authored by ngraham on Aug 18 2019, 11:48 PM.

Details

Summary

Sometimes, availableVersion isn't set when the i18n() string is built, leading to ugly
"argument not found" errors. This is an attempt to fix it by not even displaying the
string until both are set.

Test Plan

Hard to reproduce, but in my testing, it works.

Diff Detail

Repository
R134 Discover Software Store
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Aug 18 2019, 11:48 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 18 2019, 11:48 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Aug 18 2019, 11:48 PM
pino added a subscriber: pino.Aug 19 2019, 4:59 AM

This looks like a workaround to me: if installedVersion is not available (is it known when, actually?), why keep using it anyway, with or without i18n?
Also, -1 to string puzzles and to UI strings not translatable.

apol added a comment.Aug 19 2019, 9:46 AM

Doesn't the visible addition solve it already? We can keep the i18n() call, it will fail in this case but since it's not visible it isn't a big problem anyway.

@pino it's just not available in brief occasions when loading updates.

ngraham updated this revision to Diff 64064.Aug 19 2019, 7:21 PM

Yeah, that seems to work too

ngraham retitled this revision from Try to fix i18n() timing error in version strings to Only display old and new versions when both are available.Aug 19 2019, 7:22 PM
ngraham edited the summary of this revision. (Show Details)
ngraham edited the test plan for this revision. (Show Details)
apol accepted this revision.Aug 19 2019, 10:29 PM
This revision is now accepted and ready to land.Aug 19 2019, 10:29 PM
This revision was automatically updated to reflect the committed changes.