mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
[Localization] Migrate resources to resx for PowerRename (#6112)
* Added localization code to pipeline and created one LocProject json for Settings * Fixed typo * Reordered nuget source * Moved nuget install to restore step * Added FZ.rc file to LocProj * Added FZ resx file and modified rc file * Fixed file names * Changed to check folder for LocProject files * Updated folder * Changed directory * Changed to src directory * Changed language set and name format, removed rc file localization * Added all projects with resx/resw files * Added newline to end of file * Removed nuget source as it is not used * Updated comments * Updated keyboard manager to use resx file * Tweaked resources.resx and added it to project files * Added comments and added in string table to resx script * Remove change from bad merge * Fix syntax error in convert stringtable * Changed file type to None * Migrated color picker's resources * Migrated resources for Microsoft.Launcher * Migrated resources for fancy zones * Revert fancyzones changes * Migrated resources for ImageResizer and modified script to add language specific code * Added try catch and checks for modification to avoid unnecessary file creation * Changed tab insertion to 4 spaces to avoid mixed file types in rc file * Migrated resources for power preview project * Added LocProject.json file for 5 projects * added resgen exception check * Moved non-localizable strings out of resx for powerpreview * Move out hardcoded strings from dialog box and set them at runtime from string table * Migrated resources for powerrename * Added locproj * Added missing ImageBase extern declaration * Added build script in UWP UI project since PowerRenameExt is not referenced * Resolved merge conflicts
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "pch.h"
|
||||
#include "resource.h"
|
||||
#include "Generated Files/resource.h"
|
||||
#include "PowerRenameUI.h"
|
||||
#include "dpi_aware.h"
|
||||
#include <commctrl.h>
|
||||
@@ -9,13 +9,9 @@
|
||||
#include <thread>
|
||||
#include <trace.h>
|
||||
|
||||
extern HINSTANCE g_hInst;
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
int g_rgnMatchModeResIDs[] = {
|
||||
IDS_ENTIREITEMNAME,
|
||||
IDS_NAMEONLY,
|
||||
IDS_EXTENSIONONLY
|
||||
};
|
||||
extern HINSTANCE g_hInst;
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -599,6 +595,9 @@ INT_PTR CPowerRenameUI::_DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
void CPowerRenameUI::_OnInitDlg()
|
||||
{
|
||||
// Load text in the dialog controls
|
||||
_InitDlgText();
|
||||
|
||||
m_hwndLV = GetDlgItem(m_hwnd, IDC_LIST_PREVIEW);
|
||||
|
||||
m_listview.Init(m_hwndLV);
|
||||
@@ -652,6 +651,39 @@ void CPowerRenameUI::_OnInitDlg()
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
void UpdateDlgControl(HWND dlg, int item_id, int string_id)
|
||||
{
|
||||
HWND control = GetDlgItem(dlg, item_id);
|
||||
SetWindowText(control, GET_RESOURCE_STRING(string_id).c_str());
|
||||
}
|
||||
|
||||
void CPowerRenameUI::_InitDlgText()
|
||||
{
|
||||
// load strings
|
||||
SetWindowText(m_hwnd, GET_RESOURCE_STRING(IDS_APP_TITLE).c_str());
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_USEREGEX, IDS_USE_REGEX);
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_CASESENSITIVE, IDS_CASE_SENSITIVE);
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_MATCHALLOCCURENCES, IDS_MATCH_ALL);
|
||||
UpdateDlgControl(m_hwnd, IDC_TRANSFORM_UPPERCASE, IDS_MAKE_UPPERCASE);
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_EXCLUDEFILES, IDS_EXCLUDE_FILES);
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_EXCLUDEFOLDERS, IDS_EXCLUDE_FOLDERS);
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_EXCLUDESUBFOLDERS, IDS_EXCLUDE_SUBFOLDER);
|
||||
UpdateDlgControl(m_hwnd, IDC_TRANSFORM_LOWERCASE, IDS_MAKE_LOWERCASE);
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_ENUMITEMS, IDS_ENUMERATE_ITEMS);
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_NAMEONLY, IDS_ITEM_NAME_ONLY);
|
||||
UpdateDlgControl(m_hwnd, IDC_CHECK_EXTENSIONONLY, IDS_ITEM_EXTENSION_ONLY);
|
||||
UpdateDlgControl(m_hwnd, IDC_TRANSFORM_TITLECASE, IDS_MAKE_TITLECASE);
|
||||
UpdateDlgControl(m_hwnd, ID_RENAME, IDS_RENAME_BUTTON);
|
||||
UpdateDlgControl(m_hwnd, ID_ABOUT, IDS_HELP_BUTTON);
|
||||
UpdateDlgControl(m_hwnd, IDCANCEL, IDS_CANCEL_BUTTON);
|
||||
UpdateDlgControl(m_hwnd, IDC_SEARCH_FOR, IDS_SEARCH_FOR);
|
||||
UpdateDlgControl(m_hwnd, IDC_REPLACE_WITH, IDS_REPLACE_WITH);
|
||||
UpdateDlgControl(m_hwnd, IDC_STATUS_MESSAGE, IDS_ITEMS_SELECTED);
|
||||
UpdateDlgControl(m_hwnd, IDC_OPTIONSGROUP, IDS_OPTIONS);
|
||||
UpdateDlgControl(m_hwnd, IDC_PREVIEWGROUP, IDS_PREVIEW);
|
||||
UpdateDlgControl(m_hwnd, IDC_SEARCHREPLACEGROUP, IDS_RENAME_CRITERIA);
|
||||
}
|
||||
|
||||
void CPowerRenameUI::_OnCommand(_In_ WPARAM wParam, _In_ LPARAM lParam)
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
|
||||
Reference in New Issue
Block a user