Expose hotkeys to localisation.
Allows the Settings > Hotkeys screen to be localised, including hotkey decriptions, groups and contexts. The hotkey names are exposed to localisation via KeycodeExts. Hotkey modifiers are similarly exposed via ModifersExts. The Settings > Input screen has a Zoom Modifier dropdown, which shows the localised modifier name. The --check-yaml utility command is taught to recognise all hotkey translation, so it can validate their usage.
This commit is contained in:
@@ -91,16 +91,16 @@ namespace OpenRA
|
||||
var ret = KeycodeExts.DisplayString(Key);
|
||||
|
||||
if (Modifiers.HasModifier(Modifiers.Shift))
|
||||
ret = "Shift + " + ret;
|
||||
ret = $"{ModifiersExts.DisplayString(Modifiers.Shift)} + {ret}";
|
||||
|
||||
if (Modifiers.HasModifier(Modifiers.Alt))
|
||||
ret = "Alt + " + ret;
|
||||
ret = $"{ModifiersExts.DisplayString(Modifiers.Alt)} + {ret}";
|
||||
|
||||
if (Modifiers.HasModifier(Modifiers.Ctrl))
|
||||
ret = "Ctrl + " + ret;
|
||||
ret = $"{ModifiersExts.DisplayString(Modifiers.Ctrl)} + {ret}";
|
||||
|
||||
if (Modifiers.HasModifier(Modifiers.Meta))
|
||||
ret = (Platform.CurrentPlatform == PlatformType.OSX ? "Cmd + " : "Meta + ") + ret;
|
||||
ret = $"{ModifiersExts.DisplayString(Modifiers.Meta)} + {ret}";
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user