mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Settings][KBM]Fix "All Apps" localization (#22097)
This commit is contained in:
@@ -386,6 +386,10 @@
|
|||||||
<value>Shortcuts</value>
|
<value>Shortcuts</value>
|
||||||
<comment>Keyboard Manager remap keyboard header</comment>
|
<comment>Keyboard Manager remap keyboard header</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="KeyboardManager_All_Apps_Description" xml:space="preserve">
|
||||||
|
<value>All Apps</value>
|
||||||
|
<comment>Should be the same as EditShortcuts_AllApps from keyboard manager editor</comment>
|
||||||
|
</data>
|
||||||
<data name="Shortcuts.Header" xml:space="preserve">
|
<data name="Shortcuts.Header" xml:space="preserve">
|
||||||
<value>Shortcuts</value>
|
<value>Shortcuts</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
|||||||
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
|
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
|
||||||
using Microsoft.PowerToys.Settings.UI.Library.ViewModels.Commands;
|
using Microsoft.PowerToys.Settings.UI.Library.ViewModels.Commands;
|
||||||
using Microsoft.PowerToys.Settings.Utilities;
|
using Microsoft.PowerToys.Settings.Utilities;
|
||||||
|
using Windows.ApplicationModel.Resources;
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||||
{
|
{
|
||||||
@@ -167,6 +168,17 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
|
|
||||||
public static List<AppSpecificKeysDataModel> CombineShortcutLists(List<KeysDataModel> globalShortcutList, List<AppSpecificKeysDataModel> appSpecificShortcutList)
|
public static List<AppSpecificKeysDataModel> CombineShortcutLists(List<KeysDataModel> globalShortcutList, List<AppSpecificKeysDataModel> appSpecificShortcutList)
|
||||||
{
|
{
|
||||||
|
string allAppsDescription = "All Apps";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ResourceLoader resourceLoader = ResourceLoader.GetForViewIndependentUse();
|
||||||
|
allAppsDescription = resourceLoader.GetString("KeyboardManager_All_Apps_Description");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError("Couldn't get translation for All Apps mention in KBM page.", ex);
|
||||||
|
}
|
||||||
|
|
||||||
if (globalShortcutList == null && appSpecificShortcutList == null)
|
if (globalShortcutList == null && appSpecificShortcutList == null)
|
||||||
{
|
{
|
||||||
return new List<AppSpecificKeysDataModel>();
|
return new List<AppSpecificKeysDataModel>();
|
||||||
@@ -177,11 +189,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
}
|
}
|
||||||
else if (appSpecificShortcutList == null)
|
else if (appSpecificShortcutList == null)
|
||||||
{
|
{
|
||||||
return globalShortcutList.ConvertAll(x => new AppSpecificKeysDataModel { OriginalKeys = x.OriginalKeys, NewRemapKeys = x.NewRemapKeys, TargetApp = "All Apps" }).ToList();
|
return globalShortcutList.ConvertAll(x => new AppSpecificKeysDataModel { OriginalKeys = x.OriginalKeys, NewRemapKeys = x.NewRemapKeys, TargetApp = allAppsDescription }).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return globalShortcutList.ConvertAll(x => new AppSpecificKeysDataModel { OriginalKeys = x.OriginalKeys, NewRemapKeys = x.NewRemapKeys, TargetApp = "All Apps" }).Concat(appSpecificShortcutList).ToList();
|
return globalShortcutList.ConvertAll(x => new AppSpecificKeysDataModel { OriginalKeys = x.OriginalKeys, NewRemapKeys = x.NewRemapKeys, TargetApp = allAppsDescription }).Concat(appSpecificShortcutList).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user