https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2e67c18d2ba89282ae2f5c2404ee51ddaacbb764
commit 2e67c18d2ba89282ae2f5c2404ee51ddaacbb764 Author: Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com> AuthorDate: Tue Oct 11 06:15:28 2022 +0900 Commit: GitHub <nore...@github.com> CommitDate: Tue Oct 11 06:15:28 2022 +0900 [BROWSEUI][INCLUDE] Localize 'Address' on CBandSiteMenu (#4767) - Add IDS_ADDRESSMENUTEXT resource string (whose ID matchs the string of addressband.rgs). - Add SHLoadRegUIStringA/W function prototype to <shlwapi_undoc.h>. - Use SHLoadRegUIStringW to load MenuTextPUI. CORE-18394 --- dll/win32/browseui/lang/bg-BG.rc | 1 + dll/win32/browseui/lang/de-DE.rc | 1 + dll/win32/browseui/lang/en-US.rc | 1 + dll/win32/browseui/lang/es-ES.rc | 1 + dll/win32/browseui/lang/et-EE.rc | 1 + dll/win32/browseui/lang/eu-ES.rc | 1 + dll/win32/browseui/lang/fr-FR.rc | 1 + dll/win32/browseui/lang/he-IL.rc | 1 + dll/win32/browseui/lang/hi-IN.rc | 1 + dll/win32/browseui/lang/hu-HU.rc | 1 + dll/win32/browseui/lang/id-ID.rc | 1 + dll/win32/browseui/lang/it-IT.rc | 1 + dll/win32/browseui/lang/ja-JP.rc | 1 + dll/win32/browseui/lang/pl-PL.rc | 1 + dll/win32/browseui/lang/pt-BR.rc | 1 + dll/win32/browseui/lang/pt-PT.rc | 1 + dll/win32/browseui/lang/ro-RO.rc | 1 + dll/win32/browseui/lang/ru-RU.rc | 1 + dll/win32/browseui/lang/sq-AL.rc | 1 + dll/win32/browseui/lang/tr-TR.rc | 1 + dll/win32/browseui/lang/uk-UA.rc | 1 + dll/win32/browseui/lang/zh-CN.rc | 1 + dll/win32/browseui/lang/zh-TW.rc | 1 + dll/win32/browseui/resource.h | 1 + dll/win32/browseui/shellbars/CBandSiteMenu.cpp | 22 ++++++++++++++++++---- sdk/include/reactos/shlwapi_undoc.h | 4 ++++ 26 files changed, 46 insertions(+), 4 deletions(-) diff --git a/dll/win32/browseui/lang/bg-BG.rc b/dll/win32/browseui/lang/bg-BG.rc index 4cae3bb1a47..f051e257427 100644 --- a/dll/win32/browseui/lang/bg-BG.rc +++ b/dll/win32/browseui/lang/bg-BG.rc @@ -298,6 +298,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Дневник\tCtrl+H" END diff --git a/dll/win32/browseui/lang/de-DE.rc b/dll/win32/browseui/lang/de-DE.rc index 69a479897bc..eabd07d55b1 100644 --- a/dll/win32/browseui/lang/de-DE.rc +++ b/dll/win32/browseui/lang/de-DE.rc @@ -316,6 +316,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Verlauf\tCtrl+H" END diff --git a/dll/win32/browseui/lang/en-US.rc b/dll/win32/browseui/lang/en-US.rc index 781d52b0289..8ba65eb7e85 100644 --- a/dll/win32/browseui/lang/en-US.rc +++ b/dll/win32/browseui/lang/en-US.rc @@ -316,6 +316,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&History\tCtrl+H" END diff --git a/dll/win32/browseui/lang/es-ES.rc b/dll/win32/browseui/lang/es-ES.rc index db7cc47da74..6ada459824c 100644 --- a/dll/win32/browseui/lang/es-ES.rc +++ b/dll/win32/browseui/lang/es-ES.rc @@ -307,6 +307,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Historial\tCtrl+H" END diff --git a/dll/win32/browseui/lang/et-EE.rc b/dll/win32/browseui/lang/et-EE.rc index 66ba71e8269..b3804492ec2 100644 --- a/dll/win32/browseui/lang/et-EE.rc +++ b/dll/win32/browseui/lang/et-EE.rc @@ -305,6 +305,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Ajalugu\tCtrl+H" END diff --git a/dll/win32/browseui/lang/eu-ES.rc b/dll/win32/browseui/lang/eu-ES.rc index 4c3fa81ca06..22facab3084 100644 --- a/dll/win32/browseui/lang/eu-ES.rc +++ b/dll/win32/browseui/lang/eu-ES.rc @@ -305,6 +305,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Historial\tCtrl+H" END diff --git a/dll/win32/browseui/lang/fr-FR.rc b/dll/win32/browseui/lang/fr-FR.rc index 250b4b7effc..2764d23f32a 100644 --- a/dll/win32/browseui/lang/fr-FR.rc +++ b/dll/win32/browseui/lang/fr-FR.rc @@ -316,6 +316,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Historique\tCtrl+H" END diff --git a/dll/win32/browseui/lang/he-IL.rc b/dll/win32/browseui/lang/he-IL.rc index 82dde6dca06..5cbc355debb 100644 --- a/dll/win32/browseui/lang/he-IL.rc +++ b/dll/win32/browseui/lang/he-IL.rc @@ -300,6 +300,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "היסטוריה\tCtrl+H" END diff --git a/dll/win32/browseui/lang/hi-IN.rc b/dll/win32/browseui/lang/hi-IN.rc index 49489cba8f0..aefe0f9a268 100644 --- a/dll/win32/browseui/lang/hi-IN.rc +++ b/dll/win32/browseui/lang/hi-IN.rc @@ -298,6 +298,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&हिस्टरी\tCtrl+H" END diff --git a/dll/win32/browseui/lang/hu-HU.rc b/dll/win32/browseui/lang/hu-HU.rc index e5ae625ae5b..cf7a915449f 100644 --- a/dll/win32/browseui/lang/hu-HU.rc +++ b/dll/win32/browseui/lang/hu-HU.rc @@ -316,6 +316,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Előzmények\tCtrl+H" END diff --git a/dll/win32/browseui/lang/id-ID.rc b/dll/win32/browseui/lang/id-ID.rc index d9c0628c634..3f6d1e24103 100644 --- a/dll/win32/browseui/lang/id-ID.rc +++ b/dll/win32/browseui/lang/id-ID.rc @@ -317,6 +317,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Riwayat\tCtrl+H" END diff --git a/dll/win32/browseui/lang/it-IT.rc b/dll/win32/browseui/lang/it-IT.rc index 8175ccaab85..5e7cfaaa80c 100644 --- a/dll/win32/browseui/lang/it-IT.rc +++ b/dll/win32/browseui/lang/it-IT.rc @@ -298,6 +298,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Recenti\tCtrl+H" END diff --git a/dll/win32/browseui/lang/ja-JP.rc b/dll/win32/browseui/lang/ja-JP.rc index 2c631e1b17a..b364f788821 100644 --- a/dll/win32/browseui/lang/ja-JP.rc +++ b/dll/win32/browseui/lang/ja-JP.rc @@ -316,6 +316,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "アドレス(&A)" IDS_HISTORYTEXT "履歴(&H)\tCtrl+H" END diff --git a/dll/win32/browseui/lang/pl-PL.rc b/dll/win32/browseui/lang/pl-PL.rc index 864d712f918..152154bcf87 100644 --- a/dll/win32/browseui/lang/pl-PL.rc +++ b/dll/win32/browseui/lang/pl-PL.rc @@ -307,6 +307,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Historia\tCtrl+H" END diff --git a/dll/win32/browseui/lang/pt-BR.rc b/dll/win32/browseui/lang/pt-BR.rc index 569e93dfa07..16c96a9c561 100644 --- a/dll/win32/browseui/lang/pt-BR.rc +++ b/dll/win32/browseui/lang/pt-BR.rc @@ -300,6 +300,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Histórico\tCtrl+H" END diff --git a/dll/win32/browseui/lang/pt-PT.rc b/dll/win32/browseui/lang/pt-PT.rc index 1995124629f..fb08d194705 100644 --- a/dll/win32/browseui/lang/pt-PT.rc +++ b/dll/win32/browseui/lang/pt-PT.rc @@ -300,6 +300,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Histórico\tCtrl+H" END diff --git a/dll/win32/browseui/lang/ro-RO.rc b/dll/win32/browseui/lang/ro-RO.rc index 2caf148ef72..bd3b8ddd4d8 100644 --- a/dll/win32/browseui/lang/ro-RO.rc +++ b/dll/win32/browseui/lang/ro-RO.rc @@ -300,6 +300,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "Ist&oric\tCtrl+H" END diff --git a/dll/win32/browseui/lang/ru-RU.rc b/dll/win32/browseui/lang/ru-RU.rc index 68d71cb7d1c..8f7e9fea772 100644 --- a/dll/win32/browseui/lang/ru-RU.rc +++ b/dll/win32/browseui/lang/ru-RU.rc @@ -307,6 +307,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&История\tCtrl+H" END diff --git a/dll/win32/browseui/lang/sq-AL.rc b/dll/win32/browseui/lang/sq-AL.rc index 241defc0c4d..3565f3610ac 100644 --- a/dll/win32/browseui/lang/sq-AL.rc +++ b/dll/win32/browseui/lang/sq-AL.rc @@ -317,6 +317,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Histori\tCtrl+H" END diff --git a/dll/win32/browseui/lang/tr-TR.rc b/dll/win32/browseui/lang/tr-TR.rc index 2e5b5db790e..5efd7ecf59f 100644 --- a/dll/win32/browseui/lang/tr-TR.rc +++ b/dll/win32/browseui/lang/tr-TR.rc @@ -300,6 +300,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Geçmiş\tCtrl+H" END diff --git a/dll/win32/browseui/lang/uk-UA.rc b/dll/win32/browseui/lang/uk-UA.rc index 55c5f04ebc3..ed8a6557c67 100644 --- a/dll/win32/browseui/lang/uk-UA.rc +++ b/dll/win32/browseui/lang/uk-UA.rc @@ -306,6 +306,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "&Історія\tCtrl+H" END diff --git a/dll/win32/browseui/lang/zh-CN.rc b/dll/win32/browseui/lang/zh-CN.rc index f82db6990cf..c6ceb6c4214 100644 --- a/dll/win32/browseui/lang/zh-CN.rc +++ b/dll/win32/browseui/lang/zh-CN.rc @@ -320,6 +320,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "历史(&H)\tCtrl+H" END diff --git a/dll/win32/browseui/lang/zh-TW.rc b/dll/win32/browseui/lang/zh-TW.rc index 15c244dbfdd..b8adf2df828 100644 --- a/dll/win32/browseui/lang/zh-TW.rc +++ b/dll/win32/browseui/lang/zh-TW.rc @@ -322,6 +322,7 @@ END STRINGTABLE BEGIN + IDS_ADDRESSMENUTEXT "&Address" IDS_HISTORYTEXT "歷程記錄(&H)\tCtrl+H" END diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h index 4bbe766b964..8b4318ffcb4 100644 --- a/dll/win32/browseui/resource.h +++ b/dll/win32/browseui/resource.h @@ -125,6 +125,7 @@ #define IDS_STANDARD_TOOLBAR 12624 #define IDS_ADDRESSBANDLABEL 12902 #define IDS_FOLDERSLABEL 12919 +#define IDS_ADDRESSMENUTEXT 13137 #define IDS_HISTORYTEXT 13169 #define IDS_UP 58434 #define IDS_BACK 58689 diff --git a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp index dd7c8f03174..1ea45a47d68 100644 --- a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp +++ b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp @@ -22,6 +22,7 @@ #include "shellbars.h" #include <browseui_undoc.h> +#include <shlwapi_undoc.h> /* The menu consists of 3 parts. The first is loaded from the resources, the second is populated with the classes of the CATID_DeskBand comcat @@ -58,10 +59,9 @@ HRESULT CBandSiteMenu::_CreateMenuPart() WCHAR wszBandGUID[MAX_PATH]; WCHAR wRegKey[MAX_PATH]; UINT cBands; - DWORD dwDataSize; CATID category = CATID_DeskBand; HMENU hmenuToolbars; - DWORD dwRead; + DWORD dwRead, dwDataSize; CComPtr<IEnumGUID> pEnumGUID; HRESULT hr; @@ -97,8 +97,22 @@ HRESULT CBandSiteMenu::_CreateMenuPart() /* Get the band name */ StringCchPrintfW(wRegKey, MAX_PATH, L"CLSID\\%s", wszBandGUID); - dwDataSize = MAX_PATH; - SHGetValue(HKEY_CLASSES_ROOT, wRegKey, NULL, NULL, wszBandName, &dwDataSize); + HKEY hKey; + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, wRegKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + hr = SHLoadRegUIStringW(hKey, L"MenuTextPUI", wszBandName, _countof(wszBandName)); + if (FAILED_UNEXPECTEDLY(hr)) + { + hr = SHLoadRegUIStringW(hKey, NULL, wszBandName, _countof(wszBandName)); + FAILED_UNEXPECTEDLY(hr); + } + RegCloseKey(hKey); + } + else + { + dwDataSize = sizeof(wszBandName); + SHGetValueW(HKEY_CLASSES_ROOT, wRegKey, NULL, NULL, wszBandName, &dwDataSize); + } /* Insert it */ InsertMenu(hmenuToolbars, cBands, MF_BYPOSITION, m_ComCatGuids.GetSize() + FIRST_COMCAT_MENU_ID, wszBandName); diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h index b94577f8638..d62b4ec65c4 100644 --- a/sdk/include/reactos/shlwapi_undoc.h +++ b/sdk/include/reactos/shlwapi_undoc.h @@ -134,10 +134,14 @@ DWORD WINAPI SHGetValueGoodBootA(HKEY hkey, LPCSTR pSubKey, LPCSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pbData); DWORD WINAPI SHGetValueGoodBootW(HKEY hkey, LPCWSTR pSubKey, LPCWSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pbData); +HRESULT WINAPI SHLoadRegUIStringA(HKEY hkey, LPCSTR value, LPSTR buf, DWORD size); +HRESULT WINAPI SHLoadRegUIStringW(HKEY hkey, LPCWSTR value, LPWSTR buf, DWORD size); #ifdef UNICODE #define SHGetValueGoodBoot SHGetValueGoodBootW +#define SHLoadRegUIString SHLoadRegUIStringW #else #define SHGetValueGoodBoot SHGetValueGoodBootA +#define SHLoadRegUIString SHLoadRegUIStringA #endif int