Add several strings for health notification

update German translation
improve wording
This commit is contained in:
Peter G. (nephros) 2021-05-02 17:18:25 +02:00
parent dfbf1ec078
commit c9281ccabd
4 changed files with 127 additions and 28 deletions

View file

@ -374,7 +374,7 @@ Page {
color: Theme.highlightColor color: Theme.highlightColor
} }
Label { Label {
text: qsTr("Display visual and audible notifications about battery health, when the battery temperature is below or above safe values.") text: qsTr("Display visual and audible notifications about battery health, when the battery status exceeds safe values.<br />This usually means high temperature but can be affected by other factors depending on the hardware.")
anchors { anchors {
left: parent.left left: parent.left
right: parent.right right: parent.right
@ -386,15 +386,15 @@ Page {
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
SectionHeader { text: qsTr("Battery health notification") } SectionHeader { text: qsTr("Health notification") }
ComboBox { ComboBox {
id: healthSelector id: healthSelector
width: parent.width width: parent.width
label: qsTr("Warn on Health status" + ":") label: qsTr("Notify on Health status" + ":")
currentIndex: settings.healthAlert currentIndex: settings.healthAlert
menu: ContextMenu { menu: ContextMenu {
MenuItem { text: qsTr("None") } MenuItem { text: qsTr("Never") }
MenuItem { text: qsTr("Warning") } MenuItem { text: qsTr("Warning") }
MenuItem { text: qsTr("Critical") } MenuItem { text: qsTr("Critical") }
} }
@ -404,7 +404,7 @@ Page {
} }
} }
SectionHeader { text: qsTr("Battery health warning interval") } SectionHeader { text: qsTr("Health notification interval") }
MySlider { MySlider {
id: healthIntervalSlider id: healthIntervalSlider

View file

@ -45,12 +45,16 @@ Settings::Settings(Logger *newLogger, QObject *parent) : QObject(parent)
loadString(sNotificationTitle, notificationTitle); loadString(sNotificationTitle, notificationTitle);
loadString(sNotificationLowText, notificationLowText); loadString(sNotificationLowText, notificationLowText);
loadString(sNotificationHighText, notificationHighText); loadString(sNotificationHighText, notificationHighText);
loadString(sNotificationHealthText, notificationHealthText); loadString(sNotificationHealthTitle, notificationHealthTitle);
loadString(sNotificationHealthWarnText, notificationHealthWarnText);
loadString(sNotificationHealthCritText, notificationHealthCritText);
saveString(sNotificationTitle, tr("Battery charge %1%"), notificationTitle); saveString(sNotificationTitle, tr("Battery charge %1%"), notificationTitle);
saveString(sNotificationLowText, tr("Please connect the charger."), notificationLowText); saveString(sNotificationLowText, tr("Please connect the charger."), notificationLowText);
saveString(sNotificationHighText, tr("Please disconnect the charger."), notificationHighText); saveString(sNotificationHighText, tr("Please disconnect the charger."), notificationHighText);
saveString(sNotificationHealthText, tr("Battery health"), notificationHealthText); saveString(sNotificationHealthTitle, tr("Battery health %1"), notificationHealthTitle);
saveString(sNotificationHealthWarnText, tr("Battery health is not good"), notificationHealthWarnText);
saveString(sNotificationHealthCritText, tr("Battery health is critical"), notificationHealthCritText);
} }
Settings::~Settings() Settings::~Settings()
@ -76,7 +80,9 @@ QString Settings::getLogFilename() { return logFilename; }
QString Settings::getNotificationTitle() { return notificationTitle; } QString Settings::getNotificationTitle() { return notificationTitle; }
QString Settings::getNotificationLowText() { return notificationLowText; } QString Settings::getNotificationLowText() { return notificationLowText; }
QString Settings::getNotificationHighText() { return notificationHighText; } QString Settings::getNotificationHighText() { return notificationHighText; }
QString Settings::getNotificationHealthText() { return notificationHealthText; } QString Settings::getNotificationHealthTitle() { return notificationHealthTitle; }
QString Settings::getNotificationHealthWarnText() { return notificationHealthWarnText; }
QString Settings::getNotificationHealthCritText() { return notificationHealthCritText; }
int Settings::getLogLevel() { return logLevel; } int Settings::getLogLevel() { return logLevel; }
void Settings::setLowAlert(const int newLimit) { void Settings::setLowAlert(const int newLimit) {
@ -146,9 +152,19 @@ void Settings::setNotificationHighText(const QString newText) {
emit notificationHighTextChanged(notificationHighText); emit notificationHighTextChanged(notificationHighText);
} }
void Settings::setNotificationHealthText(const QString newText) { void Settings::setNotificationHealthTitle(const QString newText) {
if(saveString(sNotificationHealthText, newText, notificationHealthText)) if(saveString(sNotificationHealthTitle, newText, notificationTitle))
emit notificationHealthTextChanged(notificationHealthText); emit notificationHealthTitleChanged(notificationTitle);
}
void Settings::setNotificationHealthWarnText(const QString newText) {
if(saveString(sNotificationHealthWarnText, newText, notificationHealthWarnText))
emit notificationHealthWarnTextChanged(notificationHealthWarnText);
}
void Settings::setNotificationHealthCritText(const QString newText) {
if(saveString(sNotificationHealthCritText, newText, notificationHealthCritText))
emit notificationHealthCritTextChanged(notificationHealthCritText);
} }
void Settings::setLogLevel(const int newLogLevel) { void Settings::setLogLevel(const int newLogLevel) {

View file

@ -40,7 +40,9 @@ class Settings : public QObject
Q_PROPERTY(QString notificationTitle READ getNotificationTitle WRITE setNotificationTitle NOTIFY notificationTitleChanged) Q_PROPERTY(QString notificationTitle READ getNotificationTitle WRITE setNotificationTitle NOTIFY notificationTitleChanged)
Q_PROPERTY(QString notificationLowText READ getNotificationLowText WRITE setNotificationLowText NOTIFY notificationLowTextChanged) Q_PROPERTY(QString notificationLowText READ getNotificationLowText WRITE setNotificationLowText NOTIFY notificationLowTextChanged)
Q_PROPERTY(QString notificationHighText READ getNotificationHighText WRITE setNotificationHighText NOTIFY notificationHighTextChanged) Q_PROPERTY(QString notificationHighText READ getNotificationHighText WRITE setNotificationHighText NOTIFY notificationHighTextChanged)
Q_PROPERTY(QString notificationHealthText READ getNotificationHealthText WRITE setNotificationHealthText NOTIFY notificationHealthTextChanged) Q_PROPERTY(QString notificationHealthTitle READ getNotificationHealthTitle WRITE setNotificationHealthTitle NOTIFY notificationHealthTitleChanged)
Q_PROPERTY(QString notificationHealthWarnText READ getNotificationHealthWarnText WRITE setNotificationHealthWarnText NOTIFY notificationHealthWarnTextChanged)
Q_PROPERTY(QString notificationHealthCritText READ getNotificationHealthCritText WRITE setNotificationHealthCritText NOTIFY notificationHealthCritTextChanged)
Q_PROPERTY(QString logFilename READ getLogFilename NOTIFY logFilenameChanged) Q_PROPERTY(QString logFilename READ getLogFilename NOTIFY logFilenameChanged)
Q_PROPERTY(int logLevel READ getLogLevel WRITE setLogLevel NOTIFY logLevelChanged) Q_PROPERTY(int logLevel READ getLogLevel WRITE setLogLevel NOTIFY logLevelChanged)
@ -63,7 +65,9 @@ public:
QString getNotificationTitle(); QString getNotificationTitle();
QString getNotificationLowText(); QString getNotificationLowText();
QString getNotificationHighText(); QString getNotificationHighText();
QString getNotificationHealthText(); QString getNotificationHealthTitle();
QString getNotificationHealthWarnText();
QString getNotificationHealthCritText();
QString getLogFilename(); QString getLogFilename();
int getLogLevel(); int getLogLevel();
@ -79,7 +83,9 @@ public:
void setNotificationTitle(const QString newText); void setNotificationTitle(const QString newText);
void setNotificationLowText(const QString newText); void setNotificationLowText(const QString newText);
void setNotificationHighText(const QString newText); void setNotificationHighText(const QString newText);
void setNotificationHealthText(const QString newText); void setNotificationHealthTitle(const QString newText);
void setNotificationHealthWarnText(const QString newText);
void setNotificationHealthCritText(const QString newText);
void setLogLevel(const int newLogLevel); void setLogLevel(const int newLogLevel);
private: private:
@ -103,7 +109,9 @@ private:
QString notificationTitle; QString notificationTitle;
QString notificationLowText; QString notificationLowText;
QString notificationHighText; QString notificationHighText;
QString notificationHealthText; QString notificationHealthTitle;
QString notificationHealthWarnText;
QString notificationHealthCritText;
QString logFilename; QString logFilename;
int logLevel; int logLevel;
@ -123,7 +131,9 @@ private:
const char* sNotificationTitle = "notificationTitle"; const char* sNotificationTitle = "notificationTitle";
const char* sNotificationLowText = "notificationLowText"; const char* sNotificationLowText = "notificationLowText";
const char* sNotificationHighText = "notificationHighText"; const char* sNotificationHighText = "notificationHighText";
const char* sNotificationHealthText = "notificationHealthText"; const char* sNotificationHealthTitle = "notificationHealthTitle";
const char* sNotificationHealthWarnText = "notificationHealthWarnText";
const char* sNotificationHealthCritText = "notificationHealthCritText";
const char* sLogFilename = "logFilename"; const char* sLogFilename = "logFilename";
const char* sLogLevel = "logLevel"; const char* sLogLevel = "logLevel";
@ -149,7 +159,9 @@ signals:
void notificationTitleChanged(QString); void notificationTitleChanged(QString);
void notificationLowTextChanged(QString); void notificationLowTextChanged(QString);
void notificationHighTextChanged(QString); void notificationHighTextChanged(QString);
void notificationHealthTextChanged(QString); void notificationHealthTitleChanged(QString);
void notificationHealthWarnTextChanged(QString);
void notificationHealthCritTextChanged(QString);
void logFilenameChanged(QString); void logFilenameChanged(QString);
void logLevelChanged(int); void logLevelChanged(int);
}; };

View file

@ -156,34 +156,34 @@
<name>LogPage</name> <name>LogPage</name>
<message> <message>
<source>View log</source> <source>View log</source>
<translation type="unfinished"></translation> <translation>Logdatei ansehen</translation>
</message> </message>
<message> <message>
<source>Update</source> <source>Update</source>
<translation type="unfinished"></translation> <translation>Aktualisieren</translation>
</message> </message>
<message> <message>
<source>Copy</source> <source>Copy</source>
<translation type="unfinished"></translation> <translation>Kopieren</translation>
</message> </message>
<message> <message>
<source>Log level</source> <source>Log level</source>
<translation type="unfinished"></translation> <translation>Log Level</translation>
</message> </message>
<message> <message>
<source>Quiet</source> <source>Quiet</source>
<comment>Low log setting</comment> <comment>Low log setting</comment>
<translation type="unfinished"></translation> <translation>Still</translation>
</message> </message>
<message> <message>
<source>Verbose</source> <source>Verbose</source>
<comment>Medium log setting</comment> <comment>Medium log setting</comment>
<translation type="unfinished"></translation> <translation>Mittel</translation>
</message> </message>
<message> <message>
<source>Debug</source> <source>Debug</source>
<comment>High log setting</comment> <comment>High log setting</comment>
<translation type="unfinished"></translation> <translation>Debug</translation>
</message> </message>
</context> </context>
<context> <context>
@ -275,20 +275,43 @@
<source>Current:</source> <source>Current:</source>
<translation>Strom:</translation> <translation>Strom:</translation>
</message> </message>
<message>
<source>Good</source>
<comment>Battery is OK</comment>
<translation>die Batterie ist OK</translation>
</message>
<message>
<source>Warm</source>
<comment>Battery is warm</comment>
<translation>die Batterie ist warm</translation>
</message>
<message>
<source>Overheated</source>
<comment>Battery is very hot</comment>
<translation>die Batterie ist sehr heiss</translation>
</message>
<message>
<source>Health:</source>
<translation>Zustand:</translation>
</message>
<message>
<source>Temperature:</source>
<translation>Temperatur:</translation>
</message>
</context> </context>
<context> <context>
<name>Settings</name> <name>Settings</name>
<message> <message>
<source>Battery charge %1%</source> <source>Battery charge %1%</source>
<translation>Akkustand %1%</translation> <translation type="vanished">Akkustand %1%</translation>
</message> </message>
<message> <message>
<source>Please connect the charger.</source> <source>Please connect the charger.</source>
<translation>Bitte Ladegerät anschließen.</translation> <translation type="vanished">Bitte Ladegerät anschließen.</translation>
</message> </message>
<message> <message>
<source>Please disconnect the charger.</source> <source>Please disconnect the charger.</source>
<translation>Bitte Ladegerät trennen.</translation> <translation type="vanished">Bitte Ladegerät trennen.</translation>
</message> </message>
</context> </context>
<context> <context>
@ -364,7 +387,55 @@
</message> </message>
<message> <message>
<source>View log</source> <source>View log</source>
<translation type="unfinished"></translation> <translation>Logdatei ansehen</translation>
</message>
<message>
<source>Health Notification settings</source>
<translation>Einstellungen zur Zustandbenachrichtigung</translation>
</message>
<message>
<source>Display visual and audible notifications about battery health, when the battery temperature is below or above safe values.</source>
<translation type="vanished">Visuelle und akustische Benachrichtigungen zum Batteriezustand anzeigen, sobald die Temperatur über gewissen Schwellwerten liegt.</translation>
</message>
<message>
<source>Battery health notification</source>
<translation type="vanished">Zustandsbenachrichtigung</translation>
</message>
<message>
<source>Warn on Health status:</source>
<translation type="vanished">Benachrichtigung bei Zustand:</translation>
</message>
<message>
<source>None</source>
<translation type="vanished">Keine</translation>
</message>
<message>
<source>Warning</source>
<translation>Warnung</translation>
</message>
<message>
<source>Critical</source>
<translation>Kritisch</translation>
</message>
<message>
<source>Battery health warning interval</source>
<translation type="vanished">Zustandsbenachrichtigungsintervall</translation>
</message>
<message>
<source>Display visual and audible notifications about battery health, when the battery status exceeds safe values.&lt;br /&gt;This usually means high temperature but can be affected by other factors depending on the hardware.</source>
<translation>Visuelle und akustische Benachrichtigungen zum Batteriezustand anzeigen, sobald gewisse Schwellwerte erreicht werden.&lt;br /&gt;Das betrifft meist die Temperatur, kann aber je nach Hardware auch andere Faktoren beinhalten.</translation>
</message>
<message>
<source>Health notification</source>
<translation>Zustandsbenachrichtigung</translation>
</message>
<message>
<source>Notify on Health status:</source>
<translation>Benachrichtigung zum Zustand:</translation>
</message>
<message>
<source>Health notification interval</source>
<translation>Zustandsbenachrichtigungsintervall</translation>
</message> </message>
</context> </context>
</TS> </TS>