Localize C++ Projects of FancyZones (#1130)

* localized dllmain.cpp  of fancyzones project

* localized FancyZones.cpp

* format fancyzones.rc file

* Moved SuperFancyZones back to being a string instead of having it in the resource file as it is the window class name

* reverted changes for window name

* Formatted fancyzones rc file
This commit is contained in:
Alekhya 2020-01-22 10:24:00 -08:00 committed by GitHub
parent 1ad16ade86
commit 925b6694ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 32 deletions

View File

@ -7,6 +7,7 @@
#include <lib/ZoneSet.h> #include <lib/ZoneSet.h>
#include <lib/RegistryHelpers.h> #include <lib/RegistryHelpers.h>
#include <lib/resource.h>
#include <lib/trace.h> #include <lib/trace.h>
#include <lib/Settings.h> #include <lib/Settings.h>
#include <lib/FancyZones.h> #include <lib/FancyZones.h>
@ -108,7 +109,7 @@ public:
// Return the display name of the powertoy, this will be cached // Return the display name of the powertoy, this will be cached
virtual PCWSTR get_name() override virtual PCWSTR get_name() override
{ {
return L"FancyZones"; return app_name.c_str();
} }
// Return array of the names of all events that this powertoy listens for, with // Return array of the names of all events that this powertoy listens for, with
@ -197,6 +198,7 @@ public:
FancyZonesModule() FancyZonesModule()
{ {
app_name = GET_RESOURCE_STRING(IDS_FANCYZONES);
m_settings = MakeFancyZonesSettings(reinterpret_cast<HINSTANCE>(&__ImageBase), FancyZonesModule::get_name()); m_settings = MakeFancyZonesSettings(reinterpret_cast<HINSTANCE>(&__ImageBase), FancyZonesModule::get_name());
} }
@ -257,6 +259,7 @@ private:
HANDLE m_movedWindow = nullptr; HANDLE m_movedWindow = nullptr;
winrt::com_ptr<IFancyZones> m_app; winrt::com_ptr<IFancyZones> m_app;
winrt::com_ptr<IFancyZonesSettings> m_settings; winrt::com_ptr<IFancyZonesSettings> m_settings;
std::wstring app_name;
}; };
intptr_t FancyZonesModule::HandleKeyboardHookEvent(LowlevelKeyboardEvent* data) noexcept intptr_t FancyZonesModule::HandleKeyboardHookEvent(LowlevelKeyboardEvent* data) noexcept

View File

@ -5,22 +5,23 @@
STRINGTABLE STRINGTABLE
BEGIN BEGIN
IDS_SETTING_DESCRIPTION "Create window layouts to help make multi-tasking easy" IDS_SETTING_DESCRIPTION "Create window layouts to help make multi-tasking easy"
IDS_SETTING_DESCRIPTION_SHIFTDRAG "On: Hold Shift key or any non-primary mouse button to enable zones while dragging" IDS_SETTING_DESCRIPTION_SHIFTDRAG "On: Hold Shift key or any non-primary mouse button to enable zones while dragging"
IDS_SETTING_DESCRIPTION_OVERRIDE_SNAP_HOTKEYS "Override Windows Snap hotkeys (win+arrow) to move windows between zones" IDS_SETTING_DESCRIPTION_OVERRIDE_SNAP_HOTKEYS "Override Windows Snap hotkeys (win+arrow) to move windows between zones"
IDS_SETTING_DESCRIPTION_DISPLAYCHANGE_MOVEWINDOWS "Keep windows in their zones when the screen resolution changes" IDS_SETTING_DESCRIPTION_DISPLAYCHANGE_MOVEWINDOWS "Keep windows in their zones when the screen resolution changes"
IDS_SETTING_DESCRIPTION_ZONESETCHANGE_MOVEWINDOWS "During zone layout changes, windows assigned to a zone will match new size/positions" IDS_SETTING_DESCRIPTION_ZONESETCHANGE_MOVEWINDOWS "During zone layout changes, windows assigned to a zone will match new size/positions"
IDS_SETTING_DESCRIPTION_VIRTUALDESKTOPCHANGE_MOVEWINDOWS "Keep windows pinned to multiple desktops in the same zone when the active desktop changes" IDS_SETTING_DESCRIPTION_VIRTUALDESKTOPCHANGE_MOVEWINDOWS "Keep windows pinned to multiple desktops in the same zone when the active desktop changes"
IDS_SETTING_DESCRIPTION_ZONESETCHANGE_FLASHZONES "Flash zones when the active FancyZones layout changes" IDS_SETTING_DESCRIPTION_ZONESETCHANGE_FLASHZONES "Flash zones when the active FancyZones layout changes"
IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR "Zone Highlight Color (Default #0078D7)" IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR "Zone Highlight Color (Default #0078D7)"
IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN "Follow mouse cursor instead of focus when launching editor in a multi screen environment" IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN "Follow mouse cursor instead of focus when launching editor in a multi screen environment"
IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS "Move newly created windows to their last known zone" IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS "Move newly created windows to their last known zone"
IDS_SETTING_LAUNCH_EDITOR_LABEL "Zone configuration" IDS_SETTING_LAUNCH_EDITOR_LABEL "Zone configuration"
IDS_SETTING_LAUNCH_EDITOR_BUTTON "Edit zones" IDS_SETTING_LAUNCH_EDITOR_BUTTON "Edit zones"
IDS_SETTING_LAUNCH_EDITOR_DESCRIPTION "To launch the zone editor, select the Edit zones button below or press the zone editor hotkey anytime" IDS_SETTING_LAUNCH_EDITOR_DESCRIPTION "To launch the zone editor, select the Edit zones button below or press the zone editor hotkey anytime"
IDS_SETTING_LAUNCH_EDITOR_HOTKEY_LABEL "Configure the zone editor hotkey" IDS_SETTING_LAUNCH_EDITOR_HOTKEY_LABEL "Configure the zone editor hotkey"
IDS_SETTING_EXCLCUDED_APPS_DESCRIPTION "To exclude an application from snapping to zones add its name here (one per line)" IDS_SETTING_EXCLCUDED_APPS_DESCRIPTION "To exclude an application from snapping to zones add its name here (one per line)"
IDS_SETTINGS_HIGHLIGHT_OPACITY "Zone Highlight Opacity (%)" IDS_SETTINGS_HIGHLIGHT_OPACITY "Zone Highlight Opacity (%)"
IDS_FANCYZONES L"FancyZones"
END END
1 VERSIONINFO 1 VERSIONINFO

View File

@ -1,16 +1,17 @@
#define IDS_SETTING_DESCRIPTION_SHIFTDRAG 101 #define IDS_SETTING_DESCRIPTION_SHIFTDRAG 101
#define IDS_SETTING_DESCRIPTION_OVERRIDE_SNAP_HOTKEYS 102 #define IDS_SETTING_DESCRIPTION_OVERRIDE_SNAP_HOTKEYS 102
#define IDS_SETTING_DESCRIPTION_DISPLAYCHANGE_MOVEWINDOWS 103 #define IDS_SETTING_DESCRIPTION_DISPLAYCHANGE_MOVEWINDOWS 103
#define IDS_SETTING_DESCRIPTION_ZONESETCHANGE_MOVEWINDOWS 104 #define IDS_SETTING_DESCRIPTION_ZONESETCHANGE_MOVEWINDOWS 104
#define IDS_SETTING_DESCRIPTION_ZONESETCHANGE_FLASHZONES 105 #define IDS_SETTING_DESCRIPTION_ZONESETCHANGE_FLASHZONES 105
#define IDS_SETTING_DESCRIPTION_VIRTUALDESKTOPCHANGE_MOVEWINDOWS 106 #define IDS_SETTING_DESCRIPTION_VIRTUALDESKTOPCHANGE_MOVEWINDOWS 106
#define IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR 107 #define IDS_SETTING_DESCRIPTION_ZONEHIGHLIGHTCOLOR 107
#define IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS 108 #define IDS_SETTING_DESCRIPTION_APPLASTZONE_MOVEWINDOWS 108
#define IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN 109 #define IDS_SETTING_DESCRIPTION_USE_CURSORPOS_EDITOR_STARTUPSCREEN 109
#define IDS_SETTING_DESCRIPTION 110 #define IDS_SETTING_DESCRIPTION 110
#define IDS_SETTING_LAUNCH_EDITOR_LABEL 111 #define IDS_SETTING_LAUNCH_EDITOR_LABEL 111
#define IDS_SETTING_LAUNCH_EDITOR_BUTTON 112 #define IDS_SETTING_LAUNCH_EDITOR_BUTTON 112
#define IDS_SETTING_LAUNCH_EDITOR_DESCRIPTION 113 #define IDS_SETTING_LAUNCH_EDITOR_DESCRIPTION 113
#define IDS_SETTING_LAUNCH_EDITOR_HOTKEY_LABEL 114 #define IDS_SETTING_LAUNCH_EDITOR_HOTKEY_LABEL 114
#define IDS_SETTING_EXCLCUDED_APPS_DESCRIPTION 115 #define IDS_SETTING_EXCLCUDED_APPS_DESCRIPTION 115
#define IDS_SETTINGS_HIGHLIGHT_OPACITY 116 #define IDS_SETTINGS_HIGHLIGHT_OPACITY 116
#define IDS_FANCYZONES 117