mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[Localization] Move PowerToys Run string resources from xaml files to resx (#6165)
* 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 * Reverted addition of resx file for Wox.Plugin
This commit is contained in:
@@ -18,7 +18,6 @@ using Microsoft.PowerToys.Telemetry;
|
||||
using PowerLauncher.Helper;
|
||||
using PowerLauncher.Storage;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Core.Resource;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Hotkey;
|
||||
using Wox.Infrastructure.Storage;
|
||||
@@ -42,7 +41,6 @@ namespace PowerLauncher.ViewModel
|
||||
private readonly UserSelectedRecord _userSelectedRecord;
|
||||
private readonly TopMostRecord _topMostRecord;
|
||||
private readonly object _addResultsLock = new object();
|
||||
private readonly Internationalization _translator = InternationalizationManager.Instance;
|
||||
private readonly System.Diagnostics.Stopwatch _hotkeyTimer = new System.Diagnostics.Stopwatch();
|
||||
|
||||
private string _queryTextBeforeLeaveResults;
|
||||
@@ -419,8 +417,8 @@ namespace PowerLauncher.ViewModel
|
||||
var results = new List<Result>();
|
||||
foreach (var h in _history.Items)
|
||||
{
|
||||
var title = _translator.GetTranslation("executeQuery");
|
||||
var time = _translator.GetTranslation("lastExecuteTime");
|
||||
var title = Properties.Resources.executeQuery;
|
||||
var time = Properties.Resources.lastExecuteTime;
|
||||
var result = new Result
|
||||
{
|
||||
Title = string.Format(CultureInfo.InvariantCulture, title, h.Query),
|
||||
@@ -648,7 +646,7 @@ namespace PowerLauncher.ViewModel
|
||||
catch (Exception)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
string errorMsg = string.Format(CultureInfo.InvariantCulture, InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr);
|
||||
string errorMsg = string.Format(CultureInfo.InvariantCulture, Properties.Resources.registerHotkeyFailed, hotkeyStr);
|
||||
MessageBox.Show(errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Globalization;
|
||||
using Wox.Core.Resource;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Wox.Infrastructure.UserSettings;
|
||||
using Wox.Plugin;
|
||||
@@ -34,8 +33,6 @@ namespace PowerLauncher.ViewModel
|
||||
_storage.Save();
|
||||
}
|
||||
|
||||
private static Internationalization Translater => InternationalizationManager.Instance;
|
||||
|
||||
public string ActivatedTimes => string.Format(CultureInfo.InvariantCulture, Translater.GetTranslation("about_activate_times"), Settings.ActivateTimes);
|
||||
public string ActivatedTimes => string.Format(CultureInfo.InvariantCulture, Properties.Resources.about_activate_times, Settings.ActivateTimes);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user