[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:
Arjun Balgovind
2020-09-08 11:51:24 -07:00
committed by GitHub
parent cd906b0a6f
commit 8ea8db7994
22 changed files with 206 additions and 1625 deletions

View File

@@ -72,7 +72,7 @@ namespace Microsoft.Plugin.Indexer
}
catch (Exception e)
{
var message = "Fail to set text in clipboard";
var message = Properties.Resources.Microsoft_plugin_indexer_clipboard_failed;
LogException(message, e);
_context.API.ShowMsg(message);
return false;
@@ -177,7 +177,7 @@ namespace Microsoft.Plugin.Indexer
}
catch (Exception e)
{
var message = $"Fail to open file at {record.Path}";
var message = $"{Properties.Resources.Microsoft_plugin_indexer_folder_open_failed} {record.Path}";
LogException(message, e);
_context.API.ShowMsg(message);
return false;

View File

@@ -119,7 +119,7 @@ namespace Microsoft.Plugin.Indexer
Result r = new Result();
r.Title = searchResult.Title;
r.SubTitle = "Search: " + path;
r.SubTitle = Properties.Resources.Microsoft_plugin_indexer_subtitle_header + ": " + path;
r.IcoPath = path;
r.ToolTipData = new ToolTipData(toolTipTitle, toolTipText);
r.Action = c =>
@@ -138,7 +138,7 @@ namespace Microsoft.Plugin.Indexer
catch (Win32Exception)
{
var name = $"Plugin: {_context.CurrentPluginMetadata.Name}";
var msg = "Can't Open this file";
var msg = Properties.Resources.Microsoft_plugin_indexer_file_open_failed;
_context.API.ShowMsg(name, msg, string.Empty);
hide = false;
}
@@ -210,14 +210,14 @@ namespace Microsoft.Plugin.Indexer
// Set the Plugin Title
public string GetTranslatedPluginTitle()
{
return "Windows Indexer Plugin";
return Properties.Resources.Microsoft_plugin_indexer_plugin_name;
}
// TODO: Localize the string
// Set the plugin Description
public string GetTranslatedPluginDescription()
{
return "Returns files and folders";
return Properties.Resources.Microsoft_plugin_indexer_plugin_description;
}
public List<ContextMenuResult> LoadContextMenus(Result selectedResult)

View File

@@ -60,6 +60,15 @@ namespace Microsoft.Plugin.Indexer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Fail to set text in clipboard.
/// </summary>
public static string Microsoft_plugin_indexer_clipboard_failed {
get {
return ResourceManager.GetString("Microsoft_plugin_indexer_clipboard_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copy path (Ctrl+C).
/// </summary>
@@ -87,6 +96,24 @@ namespace Microsoft.Plugin.Indexer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Can&apos;t open this file.
/// </summary>
public static string Microsoft_plugin_indexer_file_open_failed {
get {
return ResourceManager.GetString("Microsoft_plugin_indexer_file_open_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Fail to open folder at.
/// </summary>
public static string Microsoft_plugin_indexer_folder_open_failed {
get {
return ResourceManager.GetString("Microsoft_plugin_indexer_folder_open_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name.
/// </summary>
@@ -123,6 +150,24 @@ namespace Microsoft.Plugin.Indexer.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Returns files and folders.
/// </summary>
public static string Microsoft_plugin_indexer_plugin_description {
get {
return ResourceManager.GetString("Microsoft_plugin_indexer_plugin_description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Windows Indexer Plugin.
/// </summary>
public static string Microsoft_plugin_indexer_plugin_name {
get {
return ResourceManager.GetString("Microsoft_plugin_indexer_plugin_name", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Run as administrator (Ctrl+Shift+Enter).
/// </summary>
@@ -131,5 +176,14 @@ namespace Microsoft.Plugin.Indexer.Properties {
return ResourceManager.GetString("Microsoft_plugin_indexer_run_as_administrator", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Search.
/// </summary>
public static string Microsoft_plugin_indexer_subtitle_header {
get {
return ResourceManager.GetString("Microsoft_plugin_indexer_subtitle_header", resourceCulture);
}
}
}
}

View File

@@ -141,4 +141,22 @@
<data name="Microsoft_plugin_indexer_disable_warning_in_settings" xml:space="preserve">
<value>Click to go to Windows Search settings to fix.</value>
</data>
<data name="Microsoft_plugin_indexer_clipboard_failed" xml:space="preserve">
<value>Fail to set text in clipboard</value>
</data>
<data name="Microsoft_plugin_indexer_file_open_failed" xml:space="preserve">
<value>Can't open this file</value>
</data>
<data name="Microsoft_plugin_indexer_folder_open_failed" xml:space="preserve">
<value>Fail to open folder at</value>
</data>
<data name="Microsoft_plugin_indexer_plugin_description" xml:space="preserve">
<value>Returns files and folders</value>
</data>
<data name="Microsoft_plugin_indexer_plugin_name" xml:space="preserve">
<value>Windows Indexer Plugin</value>
</data>
<data name="Microsoft_plugin_indexer_subtitle_header" xml:space="preserve">
<value>Search</value>
</data>
</root>