[SHELL32] Add IDS_NEWITEMFORMAT and retry FCIDM_SHVIEW_NEW (#5412)

- FCIDM_SHVIEW_NEW resource string had some problems in localization and keyboard usability.
- Add IDS_NEWITEMFORMAT resource string ("New %s") to format the new file item string.
- Modify CNewMenu::NewItemByNonCommand for IDS_NEWITEMFORMAT.
- FCIDM_SHVIEW_NEW is provided for [New] menu item, so it should have an ampersand.
  Add a comment for it and then retry the translation.
CORE-18706
This commit is contained in:
Katayama Hirofumi MZ 2023-07-07 17:24:25 +09:00 committed by GitHub
parent 3da13042ea
commit abf1934d92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 77 additions and 43 deletions

View file

@ -518,17 +518,14 @@ HRESULT CNewMenu::NewItemByCommand(SHELLNEW_ITEM *pItem, LPCWSTR wszPath)
HRESULT CNewMenu::NewItemByNonCommand(SHELLNEW_ITEM *pItem, LPWSTR wszName,
DWORD cchNameMax, LPCWSTR wszPath)
{
WCHAR wszBuf[MAX_PATH];
WCHAR wszNewFile[MAX_PATH];
BOOL bSuccess = TRUE;
if (!LoadStringW(shell32_hInstance, FCIDM_SHVIEW_NEW, wszBuf, _countof(wszBuf)))
return E_FAIL;
StringCchPrintfW(wszNewFile, _countof(wszNewFile), L"%s %s%s", wszBuf, pItem->pwszDesc, pItem->pwszExt);
CStringW strNewItem;
strNewItem.Format(IDS_NEWITEMFORMAT, pItem->pwszDesc);
strNewItem += pItem->pwszExt;
/* Create the name of the new file */
if (!PathYetAnotherMakeUniqueName(wszName, wszPath, NULL, wszNewFile))
if (!PathYetAnotherMakeUniqueName(wszName, wszPath, NULL, strNewItem))
return E_FAIL;
/* Create new file */