diff options
author | George Hazan <ghazan@miranda.im> | 2021-06-10 19:56:32 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-06-10 19:56:32 +0300 |
commit | 27f97e685fd942996525c2dfb841f8709591a159 (patch) | |
tree | 9e45658373049dc95a874717645ca5180140f586 /protocols | |
parent | 4ddea205205f8172cef709752fa723db743b4316 (diff) |
fixes #2889 (Weather: строки нужно переводить во время сборки, а не после)
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Weather/docs/weather/msn.ini | 29 | ||||
-rw-r--r-- | protocols/Weather/src/version.h | 2 | ||||
-rw-r--r-- | protocols/Weather/src/weather_ini.cpp | 85 | ||||
-rw-r--r-- | protocols/Weather/src/weather_update.cpp | 2 | ||||
-rw-r--r-- | protocols/Weather/src/weather_userinfo.cpp | 25 |
5 files changed, 66 insertions, 77 deletions
diff --git a/protocols/Weather/docs/weather/msn.ini b/protocols/Weather/docs/weather/msn.ini index ccbb428154..4322ceb93c 100644 --- a/protocols/Weather/docs/weather/msn.ini +++ b/protocols/Weather/docs/weather/msn.ini @@ -14,11 +14,6 @@ Default Map=https://www.msn.com/en-us/weather/maps/x/we-city?q=%s Update URL=https://www.msn.com/en-us/weather/today/x/we-city?q=%s&weadegreetype=C UserAgent=Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0 -[Update] -Start=xdmap: -End=; -Url=1 - ;current Weather [Ignore] Start=<div class="current-info"> @@ -98,7 +93,7 @@ Start="moonset":" End=" Url=1 -[Moon phase] +[Moonphase] Start="moon":" End=" Url=1 @@ -983,34 +978,38 @@ Hidden=true +[Update] +Start=data-obstime=" +End=" +Url=1 [Forecast Day 1] -Set Data=[Forecast Day 1 WeekDay] & ", " & [Forecast Day 1 Day] & ": " & [Forecast Day 1 Condition] & " (" & [Forecast Day 1 Low] & "/" & [Forecast Day 1 High] & "), " & [Forecast Day 1 Precipitation] & " Rain, UV: " & [Forecast Day 1 UV Index] & ", Humidity: " & [Forecast Day 1 Humidity] +Set Data=[Forecast Day 1 WeekDay] & ", " & [Forecast Day 1 Day] & ": " & [Forecast Day 1 Condition] & " (" & [Forecast Day 1 Low] & "/" & [Forecast Day 1 High] & "), " & [Forecast Day 1 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 1 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 1 Humidity] [Forecast Day 2] -Set Data=[Forecast Day 2 WeekDay] & ", " & [Forecast Day 2 Day] & ": " & [Forecast Day 2 Condition] & " (" & [Forecast Day 2 Low] & "/" & [Forecast Day 2 High] & "), " & [Forecast Day 2 Precipitation] & " Rain, UV: " & [Forecast Day 2 UV Index] & ", Humidity: " & [Forecast Day 2 Humidity] +Set Data=[Forecast Day 2 WeekDay] & ", " & [Forecast Day 2 Day] & ": " & [Forecast Day 2 Condition] & " (" & [Forecast Day 2 Low] & "/" & [Forecast Day 2 High] & "), " & [Forecast Day 2 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 2 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 2 Humidity] [Forecast Day 3] -Set Data=[Forecast Day 3 WeekDay] & ", " & [Forecast Day 3 Day] & ": " & [Forecast Day 3 Condition] & " (" & [Forecast Day 3 Low] & "/" & [Forecast Day 3 High] & "), " & [Forecast Day 3 Precipitation] & " Rain, UV: " & [Forecast Day 3 UV Index] & ", Humidity: " & [Forecast Day 3 Humidity] +Set Data=[Forecast Day 3 WeekDay] & ", " & [Forecast Day 3 Day] & ": " & [Forecast Day 3 Condition] & " (" & [Forecast Day 3 Low] & "/" & [Forecast Day 3 High] & "), " & [Forecast Day 3 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 3 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 3 Humidity] [Forecast Day 4] -Set Data=[Forecast Day 4 WeekDay] & ", " & [Forecast Day 4 Day] & ": " & [Forecast Day 4 Condition] & " (" & [Forecast Day 4 Low] & "/" & [Forecast Day 4 High] & "), " & [Forecast Day 4 Precipitation] & " Rain, UV: " & [Forecast Day 4 UV Index] & ", Humidity: " & [Forecast Day 4 Humidity] +Set Data=[Forecast Day 4 WeekDay] & ", " & [Forecast Day 4 Day] & ": " & [Forecast Day 4 Condition] & " (" & [Forecast Day 4 Low] & "/" & [Forecast Day 4 High] & "), " & [Forecast Day 4 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 4 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 4 Humidity] [Forecast Day 5] -Set Data=[Forecast Day 5 WeekDay] & ", " & [Forecast Day 5 Day] & ": " & [Forecast Day 5 Condition] & " (" & [Forecast Day 5 Low] & "/" & [Forecast Day 5 High] & "), " & [Forecast Day 5 Precipitation] & " Rain, UV: " & [Forecast Day 5 UV Index] & ", Humidity: " & [Forecast Day 5 Humidity] +Set Data=[Forecast Day 5 WeekDay] & ", " & [Forecast Day 5 Day] & ": " & [Forecast Day 5 Condition] & " (" & [Forecast Day 5 Low] & "/" & [Forecast Day 5 High] & "), " & [Forecast Day 5 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 5 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 5 Humidity] [Forecast Day 6] -Set Data=[Forecast Day 6 WeekDay] & ", " & [Forecast Day 6 Day] & ": " & [Forecast Day 6 Condition] & " (" & [Forecast Day 6 Low] & "/" & [Forecast Day 6 High] & "), " & [Forecast Day 6 Precipitation] & " Rain, UV: " & [Forecast Day 6 UV Index] & ", Humidity: " & [Forecast Day 6 Humidity] +Set Data=[Forecast Day 6 WeekDay] & ", " & [Forecast Day 6 Day] & ": " & [Forecast Day 6 Condition] & " (" & [Forecast Day 6 Low] & "/" & [Forecast Day 6 High] & "), " & [Forecast Day 6 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 6 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 6 Humidity] [Forecast Day 7] -Set Data=[Forecast Day 7 WeekDay] & ", " & [Forecast Day 7 Day] & ": " & [Forecast Day 7 Condition] & " (" & [Forecast Day 7 Low] & "/" & [Forecast Day 7 High] & "), " & [Forecast Day 7 Precipitation] & " Rain, UV: " & [Forecast Day 7 UV Index] & ", Humidity: " & [Forecast Day 7 Humidity] +Set Data=[Forecast Day 7 WeekDay] & ", " & [Forecast Day 7 Day] & ": " & [Forecast Day 7 Condition] & " (" & [Forecast Day 7 Low] & "/" & [Forecast Day 7 High] & "), " & [Forecast Day 7 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 7 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 7 Humidity] [Forecast Day 8] -Set Data=[Forecast Day 8 WeekDay] & ", " & [Forecast Day 8 Day] & ": " & [Forecast Day 8 Condition] & " (" & [Forecast Day 8 Low] & "/" & [Forecast Day 8 High] & "), " & [Forecast Day 8 Precipitation] & " Rain, UV: " & [Forecast Day 8 UV Index] & ", Humidity: " & [Forecast Day 8 Humidity] +Set Data=[Forecast Day 8 WeekDay] & ", " & [Forecast Day 8 Day] & ": " & [Forecast Day 8 Condition] & " (" & [Forecast Day 8 Low] & "/" & [Forecast Day 8 High] & "), " & [Forecast Day 8 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 8 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 8 Humidity] [Forecast Day 9] -Set Data=[Forecast Day 9 WeekDay] & ", " & [Forecast Day 9 Day] & ": " & [Forecast Day 9 Condition] & " (" & [Forecast Day 9 Low] & "/" & [Forecast Day 9 High] & "), " & [Forecast Day 9 Precipitation] & " Rain, UV: " & [Forecast Day 9 UV Index] & ", Humidity: " & [Forecast Day 9 Humidity] +Set Data=[Forecast Day 9 WeekDay] & ", " & [Forecast Day 9 Day] & ": " & [Forecast Day 9 Condition] & " (" & [Forecast Day 9 Low] & "/" & [Forecast Day 9 High] & "), " & [Forecast Day 9 Precipitation] & " " & "Rain" & ", " & "UV" & ": " & [Forecast Day 9 UV Index] & ", " & "Humidity" & ": " & [Forecast Day 9 Humidity] diff --git a/protocols/Weather/src/version.h b/protocols/Weather/src/version.h index c081f771da..552b5e3dfe 100644 --- a/protocols/Weather/src/version.h +++ b/protocols/Weather/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 4 #define __RELEASE_NUM 0 -#define __BUILD_NUM 6 +#define __BUILD_NUM 7 #include <stdver.h> diff --git a/protocols/Weather/src/weather_ini.cpp b/protocols/Weather/src/weather_ini.cpp index cc2ebae6a8..077f0ef1a3 100644 --- a/protocols/Weather/src/weather_ini.cpp +++ b/protocols/Weather/src/weather_ini.cpp @@ -380,54 +380,45 @@ static void LoadStationData(const wchar_t *pszFile, wchar_t *pszShortFile, WIDAT // store the value for each string if (!_stricmp(Group, "HEADER")) { - if (!_stricmp(ValName, "NAME")) wSetData(&Data->DisplayName, Value); - else if (!_stricmp(ValName, "INTERNAL NAME")) wSetData(&Data->InternalName, Value); - else if (!_stricmp(ValName, "DESCRIPTION")) wSetData(&Data->Description, Value); - else if (!_stricmp(ValName, "AUTHOR")) wSetData(&Data->Author, Value); - else if (!_stricmp(ValName, "VERSION")) wSetData(&Data->Version, Value); - } - else if (!_stricmp(Group, "DEFAULT")) { - if (!_stricmp(ValName, "DEFAULT URL")) wSetData(&Data->DefaultURL, Value); - else if (!_stricmp(ValName, "DEFAULT MAP")) wSetData(&Data->DefaultMap, Value); - else if (!_stricmp(ValName, "UPDATE URL")) wSetData(&Data->UpdateURL, Value); - else if (!_stricmp(ValName, "UPDATE URL2")) wSetData(&Data->UpdateURL2, Value); - else if (!_stricmp(ValName, "UPDATE URL3")) wSetData(&Data->UpdateURL3, Value); - else if (!_stricmp(ValName, "UPDATE URL4")) wSetData(&Data->UpdateURL4, Value); - else if (!_stricmp(ValName, "COOKIE")) wSetData(&Data->Cookie, Value); - else if (!_stricmp(ValName, "USERAGENT")) wSetData(&Data->UserAgent, Value); - } - else if (!_stricmp(Group, "ID SEARCH")) { - if (!_stricmp(ValName, "AVAILABLE")) { - if (!_stricmp(Value, "TRUE")) Data->IDSearch.Available = TRUE; - else Data->IDSearch.Available = FALSE; - } - else if (!_stricmp(ValName, "SEARCH URL")) wSetData(&Data->IDSearch.SearchURL, Value); - else if (!_stricmp(ValName, "NOT FOUND STR")) wSetData(&Data->IDSearch.NotFoundStr, Value); - else if (!_stricmp(ValName, "NAME START")) wSetData(&Data->IDSearch.Name.Start, Value); - else if (!_stricmp(ValName, "NAME END")) wSetData(&Data->IDSearch.Name.End, Value); - } - else if (!_stricmp(Group, "NAME SEARCH")) { - if (!_stricmp(ValName, "SINGLE RESULT")) { - if (!_stricmp(Value, "TRUE")) Data->NameSearch.Single.Available = TRUE; - else Data->NameSearch.Single.Available = FALSE; - } - else if (!_stricmp(ValName, "MULTIPLE RESULT")) { - if (!_stricmp(Value, "TRUE")) Data->NameSearch.Multiple.Available = TRUE; - else Data->NameSearch.Multiple.Available = FALSE; - } - else if (!_stricmp(ValName, "SEARCH URL")) wSetData(&Data->NameSearch.SearchURL, Value); - else if (!_stricmp(ValName, "NOT FOUND STR")) wSetData(&Data->NameSearch.NotFoundStr, Value); + if (!_stricmp(ValName, "NAME")) wSetData(&Data->DisplayName, Value); + else if (!_stricmp(ValName, "INTERNAL NAME")) wSetData(&Data->InternalName, Value); + else if (!_stricmp(ValName, "DESCRIPTION")) wSetData(&Data->Description, Value); + else if (!_stricmp(ValName, "AUTHOR")) wSetData(&Data->Author, Value); + else if (!_stricmp(ValName, "VERSION")) wSetData(&Data->Version, Value); + } + else if (!_stricmp(Group, "DEFAULT")) { + if (!_stricmp(ValName, "DEFAULT URL")) wSetData(&Data->DefaultURL, Value); + else if (!_stricmp(ValName, "DEFAULT MAP")) wSetData(&Data->DefaultMap, Value); + else if (!_stricmp(ValName, "UPDATE URL")) wSetData(&Data->UpdateURL, Value); + else if (!_stricmp(ValName, "UPDATE URL2")) wSetData(&Data->UpdateURL2, Value); + else if (!_stricmp(ValName, "UPDATE URL3")) wSetData(&Data->UpdateURL3, Value); + else if (!_stricmp(ValName, "UPDATE URL4")) wSetData(&Data->UpdateURL4, Value); + else if (!_stricmp(ValName, "COOKIE")) wSetData(&Data->Cookie, Value); + else if (!_stricmp(ValName, "USERAGENT")) wSetData(&Data->UserAgent, Value); + } + else if (!_stricmp(Group, "ID SEARCH")) { + if (!_stricmp(ValName, "AVAILABLE")) Data->IDSearch.Available = (0 == _stricmp(Value, "true")); + else if (!_stricmp(ValName, "SEARCH URL")) wSetData(&Data->IDSearch.SearchURL, Value); + else if (!_stricmp(ValName, "NOT FOUND STR")) wSetData(&Data->IDSearch.NotFoundStr, Value); + else if (!_stricmp(ValName, "NAME START")) wSetData(&Data->IDSearch.Name.Start, Value); + else if (!_stricmp(ValName, "NAME END")) wSetData(&Data->IDSearch.Name.End, Value); + } + else if (!_stricmp(Group, "NAME SEARCH")) { + if (!_stricmp(ValName, "SINGLE RESULT")) Data->NameSearch.Single.Available = (0 == _stricmp(Value, "true")); + else if (!_stricmp(ValName, "MULTIPLE RESULT")) Data->NameSearch.Multiple.Available = (0 == _stricmp(Value, "true")); + else if (!_stricmp(ValName, "SEARCH URL")) wSetData(&Data->NameSearch.SearchURL, Value); + else if (!_stricmp(ValName, "NOT FOUND STR")) wSetData(&Data->NameSearch.NotFoundStr, Value); else if (!_stricmp(ValName, "SINGLE RESULT STR")) wSetData(&Data->NameSearch.SingleStr, Value); - else if (!_stricmp(ValName, "SINGLE FIRST")) wSetData(&Data->NameSearch.Single.First, Value); - else if (!_stricmp(ValName, "SINGLE NAME START"))wSetData(&Data->NameSearch.Single.Name.Start, Value); - else if (!_stricmp(ValName, "SINGLE NAME END")) wSetData(&Data->NameSearch.Single.Name.End, Value); - else if (!_stricmp(ValName, "SINGLE ID START")) wSetData(&Data->NameSearch.Single.ID.Start, Value); - else if (!_stricmp(ValName, "SINGLE ID END")) wSetData(&Data->NameSearch.Single.ID.End, Value); - else if (!_stricmp(ValName, "MULT FIRST")) wSetData(&Data->NameSearch.Multiple.First, Value); - else if (!_stricmp(ValName, "MULT NAME START")) wSetData(&Data->NameSearch.Multiple.Name.Start, Value); - else if (!_stricmp(ValName, "MULT NAME END")) wSetData(&Data->NameSearch.Multiple.Name.End, Value); - else if (!_stricmp(ValName, "MULT ID START")) wSetData(&Data->NameSearch.Multiple.ID.Start, Value); - else if (!_stricmp(ValName, "MULT ID END")) wSetData(&Data->NameSearch.Multiple.ID.End, Value); + else if (!_stricmp(ValName, "SINGLE FIRST")) wSetData(&Data->NameSearch.Single.First, Value); + else if (!_stricmp(ValName, "SINGLE NAME START")) wSetData(&Data->NameSearch.Single.Name.Start, Value); + else if (!_stricmp(ValName, "SINGLE NAME END")) wSetData(&Data->NameSearch.Single.Name.End, Value); + else if (!_stricmp(ValName, "SINGLE ID START")) wSetData(&Data->NameSearch.Single.ID.Start, Value); + else if (!_stricmp(ValName, "SINGLE ID END")) wSetData(&Data->NameSearch.Single.ID.End, Value); + else if (!_stricmp(ValName, "MULT FIRST")) wSetData(&Data->NameSearch.Multiple.First, Value); + else if (!_stricmp(ValName, "MULT NAME START")) wSetData(&Data->NameSearch.Multiple.Name.Start, Value); + else if (!_stricmp(ValName, "MULT NAME END")) wSetData(&Data->NameSearch.Multiple.Name.End, Value); + else if (!_stricmp(ValName, "MULT ID START")) wSetData(&Data->NameSearch.Multiple.ID.Start, Value); + else if (!_stricmp(ValName, "MULT ID END")) wSetData(&Data->NameSearch.Multiple.ID.End, Value); } else if (!_stricmp(Group, "ICONS")) { for (int i = 0; i < _countof(statusStr); i++) { diff --git a/protocols/Weather/src/weather_update.cpp b/protocols/Weather/src/weather_update.cpp index 652ac3239a..93a519f495 100644 --- a/protocols/Weather/src/weather_update.cpp +++ b/protocols/Weather/src/weather_update.cpp @@ -484,7 +484,7 @@ int GetWeatherData(MCONTACT hContact) case '[': // variable, add the value to the result string hasvar = TRUE; if (!DBGetData(hContact, _T2A(str2), &dbv)) { - mir_wstrncat(DataValue, dbv.pwszVal, _countof(DataValue) - mir_wstrlen(DataValue)); + mir_wstrncat(DataValue, TranslateW(dbv.pwszVal), _countof(DataValue) - mir_wstrlen(DataValue)); DataValue[_countof(DataValue) - 1] = 0; db_free(&dbv); } diff --git a/protocols/Weather/src/weather_userinfo.cpp b/protocols/Weather/src/weather_userinfo.cpp index e0420d48bf..1008a6c44e 100644 --- a/protocols/Weather/src/weather_userinfo.cpp +++ b/protocols/Weather/src/weather_userinfo.cpp @@ -335,26 +335,25 @@ int UserInfoInit(WPARAM wParam, LPARAM hContact) return 0; } - // show brief information dialog // wParam = current contact int BriefInfo(WPARAM wParam, LPARAM) { // make sure that the contact is actually a weather one - if (IsMyContact(wParam)) { - HWND hMoreDataDlg = WindowList_Find(hDataWindowList, wParam); - if (hMoreDataDlg != nullptr) { - SetForegroundWindow(hMoreDataDlg); - SetFocus(hMoreDataDlg); - } - else hMoreDataDlg = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BRIEF), nullptr, DlgProcMoreData, (LPARAM)wParam); + if (!IsMyContact(wParam)) + return 0; - ShowWindow(GetDlgItem(hMoreDataDlg, IDC_DATALIST), 0); - ShowWindow(GetDlgItem(hMoreDataDlg, IDC_MTEXT), 1); - SetDlgItemText(hMoreDataDlg, IDC_MTOGGLE, TranslateT("More Info")); - return 1; + HWND hMoreDataDlg = WindowList_Find(hDataWindowList, wParam); + if (hMoreDataDlg != nullptr) { + SetForegroundWindow(hMoreDataDlg); + SetFocus(hMoreDataDlg); } - return 0; + else hMoreDataDlg = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BRIEF), nullptr, DlgProcMoreData, (LPARAM)wParam); + + ShowWindow(GetDlgItem(hMoreDataDlg, IDC_DATALIST), 0); + ShowWindow(GetDlgItem(hMoreDataDlg, IDC_MTEXT), 1); + SetDlgItemText(hMoreDataDlg, IDC_MTOGGLE, TranslateT("More Info")); + return 1; } INT_PTR BriefInfoSvc(WPARAM wParam, LPARAM lParam) |