SVN commit 1082224 by sebas: Fix some i18n errors in combination with multiple batteries Also, default to show only one aggregate battery, as that's the information most people need. And the remaining time for those with more than one battery plugged in is fixed as well with this commit. Sorry translators for being such a pain :/ but even untranslated strings are better than big, fat error messages in the UI CCMAIL:kde-i18n-doc@kde.org M +7 -8 battery.cpp --- branches/KDE/4.4/kdebase/workspace/plasma/generic/applets/battery/battery.cpp #1082223:1082224 @@ -123,7 +123,7 @@ KConfigGroup cg = config(); m_showBatteryString = cg.readEntry("showBatteryString", false); m_showRemainingTime = cg.readEntry("showRemainingTime", false); - m_showMultipleBatteries = cg.readEntry("showMultipleBatteries", !m_isEmbedded); + m_showMultipleBatteries = cg.readEntry("showMultipleBatteries", false); m_theme->resize(contentsRect().size()); m_font = QApplication::font(); @@ -230,6 +230,7 @@ { if (source.startsWith(QLatin1String("Battery"))) { m_batteries_data[source] = data; + kDebug() << "new battery source" << source; } else if (source == "AC Adapter") { m_acAdapterPlugged = data["Plugged in"].toBool(); showAcAdapter(m_acAdapterPlugged); @@ -242,7 +243,7 @@ } if (source == "Battery0") { m_remainingMSecs = data["Remaining msec"].toInt(); - // kDebug() << "Remaining msecs on battery:" << m_remainingMSecs; + kDebug() << "Remaining msecs on battery:" << m_remainingMSecs; } if (m_numOfBattery == 0) { @@ -596,13 +597,13 @@ batteriesLabel.append("
"); batteriesInfo.append("
"); } - batteriesLabel.append(i18nc("Placeholder is the battery ID", "Battery %1:", bnum)); + batteriesLabel.append(i18nc("Placeholder is the battery ID", "Battery %1:", bnum)); if (state == "NoCharge") { - batteriesInfo.append(i18nc("state of battery", "%1% (charged)", battery_data.value()["Percent"].toString())); + batteriesInfo.append(i18n("%1% (charged)", battery_data.value()["Percent"].toString())); } else if (state == "Discharging") { - batteriesInfo.append(i18nc("state of battery", "%1% (discharging)", battery_data.value()["Percent"].toString())); + batteriesInfo.append(i18n("%1% (discharging)", battery_data.value()["Percent"].toString())); } else { - batteriesInfo.append(i18nc("state of battery", "%1% (charging)", battery_data.value()["Percent"].toString())); + batteriesInfo.append(i18n("%1% (charging)", battery_data.value()["Percent"].toString())); } } } @@ -612,8 +613,6 @@ } else { m_acInfoLabel->setText(i18n("Not plugged in")); } - m_remainingMSecs = battery_data.value()["Remaining msec"].toInt(); - //kDebug() << "time left:" << m_remainingMSecs; if ((state == "Discharging" || state == "Charging") && m_remainingMSecs > 0 && m_showRemainingTime) { m_remainingTimeLabel->show(); m_remainingInfoLabel->show();