diff --git a/gui/SensorDisplayLib/FancyPlotter.cpp b/gui/SensorDisplayLib/FancyPlotter.cpp --- a/gui/SensorDisplayLib/FancyPlotter.cpp +++ b/gui/SensorDisplayLib/FancyPlotter.cpp @@ -594,7 +594,7 @@ if(sensor->maxValue != 0 && sensor->unit() != QLatin1String("%")) { //Use a multi length string incase we do not have enough room - lastValue = i18n("%1 of %2" "\xc2\x9c" "%1", lastValue, mPlotter->valueAsString(sensor->maxValue, precision) ); + lastValue = i18n("%1 of %2", lastValue, mPlotter->valueAsString(sensor->maxValue, precision) ) + "\xc2\x9c" + lastValue; } } else { lastValue = i18n("Error"); diff --git a/gui/ksysguard.cpp b/gui/ksysguard.cpp --- a/gui/ksysguard.cpp +++ b/gui/ksysguard.cpp @@ -364,7 +364,8 @@ } void TopLevel::updateProcessCount() { - const QString s = i18np( "1 process" "\u009C" "1", "%1 processes" "\u009C" "%1", mLocalProcessController->processList()->visibleProcessesCount() ); + const int count = mLocalProcessController->processList()->visibleProcessesCount(); + const QString s = i18np( "1 process", "%1 processes", count ) + "\xc2\x9c" + QString::number( count ); sbProcessCount->setText( s ); } void TopLevel::changeEvent( QEvent * event ) @@ -443,9 +444,12 @@ switch ( id ) { case 1: - s = i18n( "CPU: %1%\xc2\x9c%1%", (int) (100 - answer.toFloat()) ); + { + const auto percent = (int) (100 - answer.toFloat()); + s = i18n( "CPU: %1%", percent ) + "\xc2\x9c" + i18nc("This is the shorter version of CPU: %1%", "%1%", percent); sbCpuStat->setText( s ); break; + } case 2: mFree = answer.toLongLong(); @@ -456,13 +460,21 @@ break; case 4: + { + const auto used = KFormat().formatByteSize( mUsedApplication*1024); + const auto total = KFormat().formatByteSize( (mFree+mUsedTotal)*1024 ); mUsedApplication = answer.toLongLong(); //Use a multi-length string - s = i18nc( "Arguments are formatted byte sizes (used/total)", "Memory: %1 / %2" "\xc2\x9c" "Mem: %1 / %2" "\xc2\x9c" "Mem: %1" "\xc2\x9c" "%1", - KFormat().formatByteSize( mUsedApplication*1024), - KFormat().formatByteSize( (mFree+mUsedTotal)*1024 ) ); + s = i18nc( "Arguments are formatted byte sizes (used/total)", "Memory: %1 / %2", used, total ); + s += "\xc2\x9c"; + s += i18nc( "Arguments are formatted byte sizes (used/total) This should be a shorter version of the previous Memory: %1 / %2", "Mem: %1 / %2", used, total ); + s += "\xc2\x9c"; + s += i18nc( "Arguments is formatted byte sizes (used) This should be a shorter version of the previous Mem: %1 / %2", "Mem: %1", used ); + s += "\xc2\x9c"; + s += used; sbMemTotal->setText( s ); break; + } case 5: sFree = answer.toLongLong(); @@ -487,9 +499,13 @@ if ( used == 0 && free == 0 ) // no swap available msg = i18n( " No swap space available " ); else { - msg = i18nc( "Arguments are formatted byte sizes (used/total)", "Swap: %1 / %2" "\xc2\x9c" "Swap: %1" "\xc2\x9c" "%1" , - KFormat().formatByteSize( used*1024 ), - KFormat().formatByteSize( (free+used)*1024) ); + const auto formattedUsed = KFormat().formatByteSize( used*1024 ); + const auto formattedTotal = KFormat().formatByteSize( (free+used)*1024); + msg = i18nc( "Arguments are formatted byte sizes (used/total)", "Swap: %1 / %2", formattedUsed, formattedTotal ); + msg += "\xc2\x9c"; + msg += i18nc( "Arguments is formatted byte sizes (used)", "Swap: %1", formattedUsed ); + msg += "\xc2\x9c"; + msg += formattedUsed; } sbSwapTotal->setText( msg );