mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
[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
This commit is contained in:
14
src/modules/shortcut_guide/LocProject.json
Normal file
14
src/modules/shortcut_guide/LocProject.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"Projects": [
|
||||
{
|
||||
"LanguageSet": "Azure_Languages",
|
||||
"LocItems": [
|
||||
{
|
||||
"SourceFile": "src\\modules\\shortcut_guide\\Resources.resx",
|
||||
"CopyOption": "LangIDOnName",
|
||||
"OutputPath": "src\\modules\\shortcut_guide"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
174
src/modules/shortcut_guide/Resources.resx
Normal file
174
src/modules/shortcut_guide/Resources.resx
Normal file
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Setting_Description_Press_Time" xml:space="preserve">
|
||||
<value>How long to press the Windows key before showing the Shortcut Guide (ms)</value>
|
||||
</data>
|
||||
<data name="Setting_Description_Overlay_Opacity" xml:space="preserve">
|
||||
<value>Opacity of the Shortcut Guide's overlay background (%)</value>
|
||||
</data>
|
||||
<data name="Setting_Description_Theme" xml:space="preserve">
|
||||
<value>Choose Shortcut Guide overlay color</value>
|
||||
</data>
|
||||
<data name="Setting_Description_Theme_Light" xml:space="preserve">
|
||||
<value>Light</value>
|
||||
</data>
|
||||
<data name="Setting_Description_Theme_Dark" xml:space="preserve">
|
||||
<value>Dark</value>
|
||||
</data>
|
||||
<data name="Setting_Description_Theme_System" xml:space="preserve">
|
||||
<value>System default app mode</value>
|
||||
</data>
|
||||
<data name="Settings_Description" xml:space="preserve">
|
||||
<value>Shows a help overlay with Windows shortcuts when the Windows key is pressed.</value>
|
||||
</data>
|
||||
<data name="Shortcut_Guide" xml:space="preserve">
|
||||
<value>Shortcut Guide</value>
|
||||
</data>
|
||||
<data name="No_Action" xml:space="preserve">
|
||||
<value>No action</value>
|
||||
</data>
|
||||
<data name="Restore" xml:space="preserve">
|
||||
<value>Restore</value>
|
||||
</data>
|
||||
<data name="Snap_Right" xml:space="preserve">
|
||||
<value>Snap right</value>
|
||||
</data>
|
||||
<data name="Snap_Left" xml:space="preserve">
|
||||
<value>Snap left</value>
|
||||
</data>
|
||||
<data name="Snap_Upper_Right" xml:space="preserve">
|
||||
<value>Snap upper right</value>
|
||||
</data>
|
||||
<data name="Snap_Upper_Left" xml:space="preserve">
|
||||
<value>Snap upper left</value>
|
||||
</data>
|
||||
<data name="Snap_Lower_Right" xml:space="preserve">
|
||||
<value>Snap lower right</value>
|
||||
</data>
|
||||
<data name="Snap_Lower_Left" xml:space="preserve">
|
||||
<value>Snap lower left</value>
|
||||
</data>
|
||||
<data name="Minimize" xml:space="preserve">
|
||||
<value>Minimize</value>
|
||||
</data>
|
||||
<data name="Maximize" xml:space="preserve">
|
||||
<value>Maximize</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "keyboard_state.h"
|
||||
#include "shortcut_guide.h"
|
||||
#include "trace.h"
|
||||
#include "resource.h"
|
||||
#include "Generated Files/resource.h"
|
||||
#include <common/common.h>
|
||||
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
13
src/modules/shortcut_guide/resource.base.h
Normal file
13
src/modules/shortcut_guide/resource.base.h
Normal file
@@ -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
|
||||
//////////////////////////////
|
||||
@@ -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
|
||||
BIN
src/modules/shortcut_guide/shortcut_guide.base.rc
Normal file
BIN
src/modules/shortcut_guide/shortcut_guide.base.rc
Normal file
Binary file not shown.
@@ -2,7 +2,6 @@
|
||||
#include "shortcut_guide.h"
|
||||
#include "target_state.h"
|
||||
#include "trace.h"
|
||||
#include "resource.h"
|
||||
|
||||
#include <common/common.h>
|
||||
#include <common/settings_objects.h>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <interface/powertoy_module_interface.h>
|
||||
#include "overlay_window.h"
|
||||
|
||||
#include "resource.h"
|
||||
#include "Generated Files/resource.h"
|
||||
|
||||
#include <common/LowlevelKeyboardEvent.h>
|
||||
|
||||
|
||||
Binary file not shown.
@@ -11,6 +11,9 @@
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 . resource.base.h resource.h shortcut_guide.base.rc shortcut_guide.rc" />
|
||||
</Target>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}</ProjectGuid>
|
||||
@@ -104,7 +107,8 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="overlay_window.h" />
|
||||
<ClInclude Include="keyboard_state.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="Generated Files/resource.h" />
|
||||
<None Include="resource.base.h" />
|
||||
<ClInclude Include="shortcut_guide.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="target_state.h" />
|
||||
@@ -127,11 +131,15 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="shortcut_guide.rc" />
|
||||
<ResourceCompile Include="Generated Files/shortcut_guide.rc" />
|
||||
<None Include="shortcut_guide.base.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources.resx" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200729.8\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
<ClInclude Include="trace.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
<ClInclude Include="Generated Files/resource.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -50,13 +50,25 @@
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{d7932c11-20ad-4625-adbc-0780ea5e308d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="shortcut_guide.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
<Filter Include="Generated Files">
|
||||
<UniqueIdentifier>{41a2f27e-76b5-4799-94c3-90a33a71786b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources.resx">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="shortcut_guide.base.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="resource.base.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Generated Files/shortcut_guide.rc">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user