From 193ef7b14d3805718b805071570c01819c38432e Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 28 Feb 2016 01:47:46 +0100 Subject: [PATCH] - adzap: make locale to announce zap back more flexible --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- src/gui/adzap.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index cb914b55b..afd8ab2fa 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -108,7 +108,7 @@ GENRE.TRAVEL_HOBBIES.6 Einkauf GENRE.TRAVEL_HOBBIES.7 Garten GENRE.UNKNOWN Unbekannt adzap Werbezapper -adzap.announce In 15 Sekunden wird umgeschaltet auf +adzap.announce In %d Sekunden wird umgeschaltet auf\n%s adzap.cancel Deaktiviert adzap.disable Deaktivieren adzap.enable Einmalig aktivieren diff --git a/data/locale/english.locale b/data/locale/english.locale index a9877339a..899b15d83 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -108,7 +108,7 @@ GENRE.TRAVEL_HOBBIES.6 advertisement/shopping GENRE.TRAVEL_HOBBIES.7 gardening GENRE.UNKNOWN unknown adzap AdZap -adzap.announce In 15 seconds, the channel will be switched to +adzap.announce In %d seconds, the channel will be switched to\n%s adzap.cancel Timer was cancelled adzap.disable Deactivate adzap.enable Activate once diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index ae275500c..4f2ecf06b 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -38,7 +38,7 @@ #include #include -#define ZAPBACK_ALERT_PERIOD 15 // seconds. Keep this in sync with the locales. +#define ZAPBACK_ALERT_PERIOD 15 // seconds static CAdZapMenu *azm = NULL; @@ -152,9 +152,9 @@ void CAdZapMenu::Run() { if (channelId != curChannelId) { - std::string name = g_Locale->getText(LOCALE_ADZAP_ANNOUNCE); - name += "\n" + channelName; - ShowHint(LOCALE_ADZAP, name.c_str()); + char name[1024]; + snprintf(name, sizeof(name)-1, g_Locale->getText(LOCALE_ADZAP_ANNOUNCE), ZAPBACK_ALERT_PERIOD, channelName.c_str()); + ShowHint(LOCALE_ADZAP, name); } alerted = true; zapBackTime.tv_sec += ZAPBACK_ALERT_PERIOD;