From 37f09f5b29740466acd03cbf3c51fd215622744c Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Sat, 3 Jan 2015 08:33:21 +0000 Subject: UserInfoEx: fix for 'He', 'She' and 'He/she' correct translation git-svn-id: http://svn.miranda-ng.org/main/trunk@11731 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/src/svc_reminder.cpp | 42 ++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'plugins/UserInfoEx/src/svc_reminder.cpp') diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 51d39c7d86..04f54a39b7 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -369,15 +369,6 @@ static BYTE NotifyWithSound(const CEvent &evt) * "check for anniversary" functions ***********************************************************************************************************/ -static LPCTSTR ContactGender(MCONTACT hContact) -{ - switch (GenderOf(hContact)) { - case 'M': return TranslateT("He"); - case 'F': return TranslateT("She"); - } - return TranslateT("He/She"); -} - static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify) { int numAnniversaries = 0; @@ -406,7 +397,17 @@ static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE if (bNotify) { // first anniversary found if (numAnniversaries == 1) - tszMsg.AppendFormat(TranslateT("%s has the following anniversaries:"), ContactGender(hContact)); + switch (GenderOf(hContact)){ + case 0: + tszMsg += TranslateT("He/she has the following anniversaries:"); + break; + case 'M': + tszMsg += TranslateT("He has the following anniversaries:"); + break; + case 'F': + tszMsg += TranslateT("She has the following anniversaries:"); + break; + } tszMsg.Append(_T("\n- ")); switch (Diff) { @@ -492,10 +493,23 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti } int age = mtb.Age(&Now); if (age > 0) - mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg, - TranslateT("\n%s becomes %d years old."), - ContactGender(hContact), age + (Diff > 0)); - + switch (GenderOf(hContact)){ + case 0: + mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg, + TranslateT("\nHe/she becomes %d years old."), + age + (Diff > 0)); + break; + case 'M': + mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg, + TranslateT("\nHe becomes %d years old."), + age + (Diff > 0)); + break; + case 'F': + mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg, + TranslateT("\nShe becomes %d years old."), + age + (Diff > 0)); + break; + } NotifyWithPopup(hContact, CEvent::BIRTHDAY, Diff, mtb.Description(), szMsg); } return true; -- cgit v1.2.3