diff --git a/src/cascadia/ShellExtension/OpenTerminalHere.cpp b/src/cascadia/ShellExtension/OpenTerminalHere.cpp index dea3ecf1c..a8f2c70ac 100644 --- a/src/cascadia/ShellExtension/OpenTerminalHere.cpp +++ b/src/cascadia/ShellExtension/OpenTerminalHere.cpp @@ -4,11 +4,11 @@ #include "pch.h" #include "OpenTerminalHere.h" #include "../WinRTUtils/inc/WtExeUtils.h" +#include "../WinRTUtils/inc/LibraryResources.h" + +#include #include -// TODO GH#6112: Localize these strings -static constexpr std::wstring_view VerbDisplayName{ L"Open in Windows Terminal" }; -static constexpr std::wstring_view VerbDevBuildDisplayName{ L"Open in Windows Terminal (Dev Build)" }; static constexpr std::wstring_view VerbName{ L"WindowsTerminalOpenHere" }; // This code is aggressively copied from @@ -87,8 +87,15 @@ HRESULT OpenTerminalHere::GetTitle(IShellItemArray* /*psiItemArray*/, { // Change the string we return depending on if we're running from the dev // build package or not. - const bool isDevBuild = IsDevBuild(); - return SHStrDup(isDevBuild ? VerbDevBuildDisplayName.data() : VerbDisplayName.data(), ppszName); + const auto resource = +#if defined(WT_BRANDING_RELEASE) + RS_(L"ShellExtension_OpenInTerminalMenuItem"); +#elif defined(WT_BRANDING_PREVIEW) + RS_(L"ShellExtension_OpenInTerminalMenuItem_Preview"); +#else + RS_(L"ShellExtension_OpenInTerminalMenuItem_Dev"); +#endif + return SHStrDup(resource.data(), ppszName); } HRESULT OpenTerminalHere::GetState(IShellItemArray* /*psiItemArray*/, diff --git a/src/cascadia/ShellExtension/dllmain.cpp b/src/cascadia/ShellExtension/dllmain.cpp index 05c835168..862df6c6a 100644 --- a/src/cascadia/ShellExtension/dllmain.cpp +++ b/src/cascadia/ShellExtension/dllmain.cpp @@ -4,6 +4,8 @@ #include "pch.h" #include "OpenTerminalHere.h" +#include "../WinRTUtils/inc/LibraryResources.h" + using namespace Microsoft::WRL; STDAPI DllCanUnloadNow() @@ -30,3 +32,6 @@ DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*) } return TRUE; } + +// Usurp the TerminalApp's resource group. +UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"TerminalApp/Resources") diff --git a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw index 2e35662e3..9537bf48c 100644 --- a/src/cascadia/TerminalApp/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalApp/Resources/en-US/Resources.resw @@ -637,4 +637,16 @@ Command Palette - \ No newline at end of file + + Open in Windows Terminal (Dev) + {Locked} The dev build will never be seen in multiple languages + + + Open in Windows Terminal Preview + {Locked="Windows"} This is a menu item that will be displayed in the Windows File Explorer that launches the Preview version of Windows Terminal + + + Open in Windows Terminal + {Locked="Windows"} This is a menu item that will be displayed in the Windows File Explorer that launches the non-preview version of Windows Terminal + +