@Perdrix said in LUpdate not adding entry to .ts file:
and running lupdate the .ts file still has no entry for that translation :(
Interesting. This looks like a pretty clear lupdate bug to me, where lupdate is failing on the cast of the n argument. For example, this doesn't work for me:
auto strText = QCoreApplication::translate(
"LiveEngine",
"Image %1 registered: %n star(s) detected - FWHM = %2 - Score = %3\n",
"IDS_LOG_REGISTERRESULTS",
static_cast<int>(123) ///< This breaks lupdate?
)
.arg(QString::fromWCharArray(nullptr))
.arg(0.01, 0, 'f', 2)
.arg(0.02, 0, 'f', 2);
And this does't work either:
auto strText = QCoreApplication::translate(
"LiveEngine",
"Image %1 registered: %n star(s) detected - FWHM = %2 - Score = %3\n",
"IDS_LOG_REGISTERRESULTS",
(int)123 ///< This breaks lupdate also?
)
.arg(QString::fromWCharArray(nullptr))
.arg(0.01, 0, 'f', 2)
.arg(0.02, 0, 'f', 2);
But this works fine (for lupdate ... I wouldn't execute the code itself ;)
auto strText = QCoreApplication::translate(
"LiveEngine",
"Image %1 registered: %n star(s) detected - FWHM = %2 - Score = %3\n",
"IDS_LOG_REGISTERRESULTS",
123
)
.arg(QString::fromWCharArray(nullptr))
.arg(0.01, 0, 'f', 2)
.arg(0.02, 0, 'f', 2);
And this works also:
const int size = 123;
auto strText = QCoreApplication::translate(
"LiveEngine",
"Image %1 registered: %n star(s) detected - FWHM = %2 - Score = %3\n",
"IDS_LOG_REGISTERRESULTS",
size
)
.arg(QString::fromWCharArray(nullptr))
.arg(0.01, 0, 'f', 2)
.arg(0.02, 0, 'f', 2);
So I would suggest you convert your lfi.m_vStars.size() to int as a separate statement, and then report this as a bug over at https://bugreports.qt.io/ (or I can report it, if you don't get around to it)
Cheers.