Compare commits

...

1 Commits

Author SHA1 Message Date
Shawn Yuan
ec52676864 Fix localization issue
Signed-off-by: Shawn Yuan <shuaiyuan@microsoft.com>
2025-08-26 14:40:00 +08:00
4 changed files with 14 additions and 9 deletions

View File

@@ -548,18 +548,14 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
}
}
if (conflictingModules.Count > 0)
var moduleNames = conflictingModules.ToArray();
if (string.Equals(moduleNames[0], "System", StringComparison.OrdinalIgnoreCase))
{
var moduleNames = conflictingModules.ToArray();
var conflictMessage = moduleNames.Length == 1
? $"Conflict detected with {moduleNames[0]}"
: $"Conflicts detected with: {string.Join(", ", moduleNames)}";
c.ConflictMessage = conflictMessage;
c.ConflictMessage = ResourceLoaderInstance.ResourceLoader.GetString("SysHotkeyConflictTooltipText");
}
else
{
c.ConflictMessage = "Conflict detected with unknown module";
c.ConflictMessage = ResourceLoaderInstance.ResourceLoader.GetString("InAppHotkeyConflictTooltipText");
}
c.HasConflict = true;

View File

@@ -64,7 +64,7 @@
IsTabStop="{Binding ElementName=ShortcutContentControl, Path=IsWarningAltGr, Mode=OneWay}"
Severity="Warning" />
<InfoBar
Title="Hotkey Conflict"
x:Uid="WarningShortcutConflict"
IsClosable="False"
IsOpen="{Binding ElementName=ShortcutContentControl, Path=HasConflict, Mode=OneWay}"
IsTabStop="{Binding ElementName=ShortcutContentControl, Path=HasConflict, Mode=OneWay}"

View File

@@ -2691,6 +2691,12 @@ Right-click to remove the key combination, thereby deactivating the shortcut.</v
<value>Shortcuts with **Ctrl** and **Alt** may remove functionality from some international keyboards, because **Ctrl** + **Alt** = **Alt Gr** in those keyboards.</value>
<comment>The ** sequences are used for text formatting of the key names. Don't remove them on translation.</comment>
</data>
<data name="WarningShortcutConflict.Title" xml:space="preserve">
<value>Shortcut conflict</value>
</data>
<data name="WarningShortcutConflict.ToolTipService.ToolTip" xml:space="preserve">
<value>A conflict has been detected for this shortcut.</value>
</data>
<data name="FancyZones_SpanZonesAcrossMonitors.Description" xml:space="preserve">
<value>All monitors must have the same DPI scaling and will be treated as one large combined rectangle which contains all monitors</value>
</data>

View File

@@ -145,6 +145,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
// Get current hotkey settings (fresh from file) using the accessor's getter
module.HotkeySettings = hotkeyAccessor.Value;
module.HotkeySettings.ConflictDescription = isSystemConflict
? ResourceLoaderInstance.ResourceLoader.GetString("SysHotkeyConflictTooltipText")
: ResourceLoaderInstance.ResourceLoader.GetString("InAppHotkeyConflictTooltipText");
// Set header using localization key
module.Header = GetHotkeyLocalizationHeader(module.ModuleName, module.HotkeyID, hotkeyAccessor.LocalizationHeaderKey);