From 15938a12be41450492f79646fb7cc66bf85aa4bb Mon Sep 17 00:00:00 2001 From: Arjun Balgovind <32061677+arjunbalgovind@users.noreply.github.com> Date: Mon, 24 Aug 2020 17:49:28 -0700 Subject: [PATCH] [Localization] Migrate resources to resx for Shortcut Guide (#6104) * 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 * Migrated shortcut guide resources to resx * Added LocProject.json --- src/modules/shortcut_guide/LocProject.json | 14 ++ src/modules/shortcut_guide/Resources.resx | 174 ++++++++++++++++++ src/modules/shortcut_guide/overlay_window.cpp | 2 +- src/modules/shortcut_guide/resource.base.h | 13 ++ src/modules/shortcut_guide/resource.h | 32 ---- .../shortcut_guide/shortcut_guide.base.rc | Bin 0 -> 2288 bytes src/modules/shortcut_guide/shortcut_guide.cpp | 1 - src/modules/shortcut_guide/shortcut_guide.h | 2 +- src/modules/shortcut_guide/shortcut_guide.rc | Bin 4122 -> 0 bytes .../shortcut_guide/shortcut_guide.vcxproj | 12 +- .../shortcut_guide.vcxproj.filters | 26 ++- 11 files changed, 232 insertions(+), 44 deletions(-) create mode 100644 src/modules/shortcut_guide/LocProject.json create mode 100644 src/modules/shortcut_guide/Resources.resx create mode 100644 src/modules/shortcut_guide/resource.base.h delete mode 100644 src/modules/shortcut_guide/resource.h create mode 100644 src/modules/shortcut_guide/shortcut_guide.base.rc delete mode 100644 src/modules/shortcut_guide/shortcut_guide.rc diff --git a/src/modules/shortcut_guide/LocProject.json b/src/modules/shortcut_guide/LocProject.json new file mode 100644 index 0000000000..3ae183d254 --- /dev/null +++ b/src/modules/shortcut_guide/LocProject.json @@ -0,0 +1,14 @@ +{ + "Projects": [ + { + "LanguageSet": "Azure_Languages", + "LocItems": [ + { + "SourceFile": "src\\modules\\shortcut_guide\\Resources.resx", + "CopyOption": "LangIDOnName", + "OutputPath": "src\\modules\\shortcut_guide" + } + ] + } + ] +} diff --git a/src/modules/shortcut_guide/Resources.resx b/src/modules/shortcut_guide/Resources.resx new file mode 100644 index 0000000000..dd305d7917 --- /dev/null +++ b/src/modules/shortcut_guide/Resources.resx @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + How long to press the Windows key before showing the Shortcut Guide (ms) + + + Opacity of the Shortcut Guide's overlay background (%) + + + Choose Shortcut Guide overlay color + + + Light + + + Dark + + + System default app mode + + + Shows a help overlay with Windows shortcuts when the Windows key is pressed. + + + Shortcut Guide + + + No action + + + Restore + + + Snap right + + + Snap left + + + Snap upper right + + + Snap upper left + + + Snap lower right + + + Snap lower left + + + Minimize + + + Maximize + + \ No newline at end of file diff --git a/src/modules/shortcut_guide/overlay_window.cpp b/src/modules/shortcut_guide/overlay_window.cpp index b778902832..40e340375c 100644 --- a/src/modules/shortcut_guide/overlay_window.cpp +++ b/src/modules/shortcut_guide/overlay_window.cpp @@ -6,7 +6,7 @@ #include "keyboard_state.h" #include "shortcut_guide.h" #include "trace.h" -#include "resource.h" +#include "Generated Files/resource.h" #include extern "C" IMAGE_DOS_HEADER __ImageBase; diff --git a/src/modules/shortcut_guide/resource.base.h b/src/modules/shortcut_guide/resource.base.h new file mode 100644 index 0000000000..b2361e1dd9 --- /dev/null +++ b/src/modules/shortcut_guide/resource.base.h @@ -0,0 +1,13 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ShortcutGuide.rc + +////////////////////////////// +// Non-localizable + +#define FILE_DESCRIPTION "PowerToys ShortcutGuide" +#define INTERNAL_NAME "ShortcutGuide" +#define ORIGINAL_FILENAME "ShortcutGuide.dll" + +// Non-localizable +////////////////////////////// diff --git a/src/modules/shortcut_guide/resource.h b/src/modules/shortcut_guide/resource.h deleted file mode 100644 index c0b7cd69aa..0000000000 --- a/src/modules/shortcut_guide/resource.h +++ /dev/null @@ -1,32 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by ShortcutGuide.rc - -////////////////////////////// -// Non-localizable - -#define FILE_DESCRIPTION "PowerToys ShortcutGuide" -#define INTERNAL_NAME "ShortcutGuide" -#define ORIGINAL_FILENAME "ShortcutGuide.dll" - -// Non-localizable -////////////////////////////// - -#define IDS_SETTING_DESCRIPTION_PRESS_TIME 101 -#define IDS_SETTING_DESCRIPTION_OVERLAY_OPACITY 102 -#define IDS_SETTING_DESCRIPTION_THEME 103 -#define IDS_SETTING_DESCRIPTION_THEME_LIGHT 104 -#define IDS_SETTING_DESCRIPTION_THEME_DARK 105 -#define IDS_SETTING_DESCRIPTION_THEME_SYSTEM 106 -#define IDS_SETTINGS_DESCRIPTION 107 -#define IDS_SHORTCUT_GUIDE 108 -#define IDS_NO_ACTION 109 -#define IDS_RESTORE 110 -#define IDS_SNAP_RIGHT 111 -#define IDS_SNAP_LEFT 112 -#define IDS_SNAP_UPPER_RIGHT 113 -#define IDS_SNAP_UPPER_LEFT 114 -#define IDS_SNAP_LOWER_RIGHT 115 -#define IDS_SNAP_LOWER_LEFT 116 -#define IDS_MINIMIZE 117 -#define IDS_MAXIMIZE 118 diff --git a/src/modules/shortcut_guide/shortcut_guide.base.rc b/src/modules/shortcut_guide/shortcut_guide.base.rc new file mode 100644 index 0000000000000000000000000000000000000000..68bc93d49c7447ad3d0ac92f12e1d08782372a96 GIT binary patch literal 2288 zcmb`HTaVIE5Xa})#P2}h#ZAn@uKQwQOklZawzLf`Y!cnVJ90e=fg&m1HW33}q%8d6JP7o0`3|Wzp5YvGGm)tV$@6#L|_ze3U@?(vb$I zb=JOk@`;m(Z(C}dc&tywVB@usILs0;C5Dsn#b}CngLV(kI(VRd`h0z9veMfoJCEC} zL}7Q{&)uj_h^>G)yK+zbdClzYG5r*?3363h_|@hg$%FAUg14r@*T41dP%`Cmykn@3 zM-8~{VsSq*r>i`q*7MROayujQqm#N7`5_fNw#Xxsn<@3Mj}>5FQS{%3<(TiI;ajWX zk<&MFo6(4=kPyFBt7+uxU|5ti`iPin++`(ivE2pZfmdz&*ic_;SZf(f-4(V^4VwY^ zQjUxGv8K+o^CqB9iF|}cLNxPj_c*;{*4*vB)r#D~&|BU+`OLQnR+*=OpUO+a;LX5W z(WM1>g^Y4)wXWo~kxaPPuC&v@$<&a%LSl&Sz;x+|DE4D?UOne?D%GRrJUmnGi!h^e zV1eaCe!}H|-H3Db=^p0VWU0!zcD2u{jovZr)2cofpWjVdpl<=N}6q3nGvWR zauSkv+qLJT^+0peERT}yTb)(0LG-u%lSY#NXL-}ASsR=L&Sp90bkf8y)iIoT7jfrd zePV2DjuvD`*_%)W>%IJhWJdXF$p;WMM}a~9d)9)jUF`~uB+Z%bTrC7!6pc*l$IYno zt0DwZ>wH5+tg*L`lb@phYW-L( #include diff --git a/src/modules/shortcut_guide/shortcut_guide.h b/src/modules/shortcut_guide/shortcut_guide.h index 4adeed0687..1af0b06b51 100644 --- a/src/modules/shortcut_guide/shortcut_guide.h +++ b/src/modules/shortcut_guide/shortcut_guide.h @@ -2,7 +2,7 @@ #include #include "overlay_window.h" -#include "resource.h" +#include "Generated Files/resource.h" #include diff --git a/src/modules/shortcut_guide/shortcut_guide.rc b/src/modules/shortcut_guide/shortcut_guide.rc deleted file mode 100644 index 73b0f9a3a7505a9550bdeecf6429b3983277bba8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4122 zcmb`K*={076o$`rq`X6mQIxS1+00~aB1Mr{Z8U6Rb0#+}f;Ti6TVUcO51-`wt0?zk zz{W(VUDefR{m)Xz|NisNrZ%^U&1_{Cc4?9QY>)2j!tU5D?bvSY7yH(}vFEe}Tfnn~ za>Z`KUetxH)W>{3;nCj-T(|u0(0^ioz`H=w)V(KCq_=Ma>siCvcFL|~Wouf^=_s?F zx-X)O*1v{T;fZ-_&=1y}F{d@oDo$3{op+EKTbC1k5s#=_yhV6%hAofmX3nN-b`R_# zyI*^~bSF0swet*Sk$vU#FTVfIdIgtoitz8o$rR>Zp6Bkn^9AxJAo&30DeH6{k@ujq zw4*hyZ}qZcBmC-tUCF-SX$QYcpwYnRFK8@qa&KcSm|}r!zr%9*{IZSTW1r}K6lX~B zzDwFyJYDc@h0hmIy|?cU_GLh9YEN;hIP~tYK^X7GGH;`@Q1M+Hh;Cw048jfKcLuIP zwF#crSorWiYN!&qo_%)mtDwCAX^K_XH_k$hrG@bRomu@jKEAfeXS_7#yrZxnbVVxq574wG_rgZ`g%+1O0piEq&d5g z*?F!|yHl6dNwr_%-SH0Z&ZwXss8wvp-OR@ezO?jhwx(sj-tH#opTB6g`p_d->}z*g z`Zl}MvR|^hMYP*IT7P@W-WHLb^W5_Mjg{M?)gotp-M~GzKQr9wRW}M1-eFVh>Ufs=_OCFrZ!J4q{wmDFZ z$hjt#3Ht)bXl~Y|Hs@Auv);ODluZ?oYZ0Xq=bG`pkhL<*F*=Nr;)=l3dU%qFY;@DSwh4wSQK0 z(WpFMxp^atT)vAQDt%Kfw(pFx64 + + + 15.0 {A46629C4-1A6C-40FA-A8B6-10E5102BB0BA} @@ -104,7 +107,8 @@ - + + @@ -127,11 +131,15 @@ - + + + + + diff --git a/src/modules/shortcut_guide/shortcut_guide.vcxproj.filters b/src/modules/shortcut_guide/shortcut_guide.vcxproj.filters index 73c727557a..4ee893ee3b 100644 --- a/src/modules/shortcut_guide/shortcut_guide.vcxproj.filters +++ b/src/modules/shortcut_guide/shortcut_guide.vcxproj.filters @@ -36,8 +36,8 @@ Header Files - - Header Files + + Generated Files @@ -50,13 +50,25 @@ {d7932c11-20ad-4625-adbc-0780ea5e308d} - - - - Resource Files - + + {41a2f27e-76b5-4799-94c3-90a33a71786b} + + + Resource Files + + + Resource Files + + + Header Files + + + + + Generated Files + \ No newline at end of file