mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PowerToys Run] Remove unused wox resources and move hardcoded strings to resx file (#6181)
* Removed xaml files, added resx file and removed references for PowerLauncher project * Added resx file for wox.plugin * Moved Calculator resources to resx * Migrated resources for Folder and Indexer plugins * Migrated resources for Program and Shell plugin * Migrated resources for URI and Window Walker * Removed GetTranslation, tests need to be refactored * Removed internationalization classes * Removed Wox.Core.Resource references * Fixed Programs plugin tests * Fixed tests * Removed language xaml files from installer * Added locProject.json files * Fixed resource not found error * Remove unused strings from PowerLauncher * Removed all unused strings * Reverted addition of resx file for Wox.Plugin * Added more resources for Folder plugin * Added resources for Folder and Indexer plugin * Added resources for Program, Shell, Uri and WW plugins * Changed string from Wox to PT Run * managed common files
This commit is contained in:
@@ -83,14 +83,14 @@ namespace Microsoft.Plugin.Shell
|
||||
{
|
||||
if (m.Key == cmd)
|
||||
{
|
||||
result.SubTitle = "Shell: " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value);
|
||||
result.SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value);
|
||||
return null;
|
||||
}
|
||||
|
||||
var ret = new Result
|
||||
{
|
||||
Title = m.Key,
|
||||
SubTitle = "Shell: " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value),
|
||||
SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value),
|
||||
IcoPath = IconPath,
|
||||
Action = c =>
|
||||
{
|
||||
@@ -109,7 +109,7 @@ namespace Microsoft.Plugin.Shell
|
||||
{
|
||||
Title = cmd,
|
||||
Score = 5000,
|
||||
SubTitle = "Shell: " + Properties.Resources.wox_plugin_cmd_execute_through_shell,
|
||||
SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + Properties.Resources.wox_plugin_cmd_execute_through_shell,
|
||||
IcoPath = IconPath,
|
||||
Action = c =>
|
||||
{
|
||||
@@ -127,7 +127,7 @@ namespace Microsoft.Plugin.Shell
|
||||
.Select(m => new Result
|
||||
{
|
||||
Title = m.Key,
|
||||
SubTitle = "Shell: " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value),
|
||||
SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value),
|
||||
IcoPath = IconPath,
|
||||
Action = c =>
|
||||
{
|
||||
@@ -215,14 +215,14 @@ namespace Microsoft.Plugin.Shell
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
var name = "Plugin: Shell";
|
||||
var message = $"Command not found: {e.Message}";
|
||||
var name = "Plugin: " + Properties.Resources.wox_plugin_cmd_plugin_name;
|
||||
var message = $"{Properties.Resources.wox_plugin_cmd_command_not_found}: {e.Message}";
|
||||
_context.API.ShowMsg(name, message);
|
||||
}
|
||||
catch (Win32Exception e)
|
||||
{
|
||||
var name = "Plugin: Shell";
|
||||
var message = $"Error running the command: {e.Message}";
|
||||
var name = "Plugin: " + Properties.Resources.wox_plugin_cmd_plugin_name;
|
||||
var message = $"{Properties.Resources.wox_plugin_cmd_command_failed}: {e.Message}";
|
||||
_context.API.ShowMsg(name, message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,15 +60,6 @@ namespace Microsoft.Plugin.Shell.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Always run as administrator.
|
||||
/// </summary>
|
||||
public static string wox_plugin_cmd_always_run_as_administrator {
|
||||
get {
|
||||
return ResourceManager.GetString("wox_plugin_cmd_always_run_as_administrator", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to this command has been executed {0} times.
|
||||
/// </summary>
|
||||
@@ -78,6 +69,24 @@ namespace Microsoft.Plugin.Shell.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error running the command.
|
||||
/// </summary>
|
||||
public static string wox_plugin_cmd_command_failed {
|
||||
get {
|
||||
return ResourceManager.GetString("wox_plugin_cmd_command_failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Command not found.
|
||||
/// </summary>
|
||||
public static string wox_plugin_cmd_command_not_found {
|
||||
get {
|
||||
return ResourceManager.GetString("wox_plugin_cmd_command_not_found", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to execute command through command shell.
|
||||
/// </summary>
|
||||
@@ -88,16 +97,7 @@ namespace Microsoft.Plugin.Shell.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Do not close Command Prompt after command execution.
|
||||
/// </summary>
|
||||
public static string wox_plugin_cmd_leave_cmd_open {
|
||||
get {
|
||||
return ResourceManager.GetString("wox_plugin_cmd_leave_cmd_open", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Allows to execute system commands from Wox. Commands should start with >.
|
||||
/// Looks up a localized string similar to Allows to execute system commands from PowerToys Run. Commands should start with >.
|
||||
/// </summary>
|
||||
public static string wox_plugin_cmd_plugin_description {
|
||||
get {
|
||||
@@ -114,15 +114,6 @@ namespace Microsoft.Plugin.Shell.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Replace Win+R.
|
||||
/// </summary>
|
||||
public static string wox_plugin_cmd_relace_winr {
|
||||
get {
|
||||
return ResourceManager.GetString("wox_plugin_cmd_relace_winr", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Run as administrator (Ctrl+Shift+Enter).
|
||||
/// </summary>
|
||||
@@ -131,14 +122,5 @@ namespace Microsoft.Plugin.Shell.Properties {
|
||||
return ResourceManager.GetString("wox_plugin_cmd_run_as_administrator", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Run as different user.
|
||||
/// </summary>
|
||||
public static string wox_plugin_cmd_run_as_different_user {
|
||||
get {
|
||||
return ResourceManager.GetString("wox_plugin_cmd_run_as_different_user", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,23 +117,11 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="wox_plugin_cmd_relace_winr" xml:space="preserve">
|
||||
<value>Replace Win+R</value>
|
||||
</data>
|
||||
<data name="wox_plugin_cmd_leave_cmd_open" xml:space="preserve">
|
||||
<value>Do not close Command Prompt after command execution</value>
|
||||
</data>
|
||||
<data name="wox_plugin_cmd_always_run_as_administrator" xml:space="preserve">
|
||||
<value>Always run as administrator</value>
|
||||
</data>
|
||||
<data name="wox_plugin_cmd_run_as_different_user" xml:space="preserve">
|
||||
<value>Run as different user</value>
|
||||
</data>
|
||||
<data name="wox_plugin_cmd_plugin_name" xml:space="preserve">
|
||||
<value>Shell</value>
|
||||
</data>
|
||||
<data name="wox_plugin_cmd_plugin_description" xml:space="preserve">
|
||||
<value>Allows to execute system commands from Wox. Commands should start with ></value>
|
||||
<value>Allows to execute system commands from PowerToys Run. Commands should start with ></value>
|
||||
</data>
|
||||
<data name="wox_plugin_cmd_cmd_has_been_executed_times" xml:space="preserve">
|
||||
<value>this command has been executed {0} times</value>
|
||||
@@ -144,4 +132,10 @@
|
||||
<data name="wox_plugin_cmd_run_as_administrator" xml:space="preserve">
|
||||
<value>Run as administrator (Ctrl+Shift+Enter)</value>
|
||||
</data>
|
||||
<data name="wox_plugin_cmd_command_failed" xml:space="preserve">
|
||||
<value>Error running the command</value>
|
||||
</data>
|
||||
<data name="wox_plugin_cmd_command_not_found" xml:space="preserve">
|
||||
<value>Command not found</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user