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:
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
.Where(t => t.Name.EndsWith("Info", StringComparison.InvariantCulture) && t.IsSubclassOf(typeof(TraitInfo)))
|
||||
.ToDictionary(
|
||||
t => t.Name[..^4],
|
||||
t => t.GetFields().Where(f => f.HasAttribute<FluentReferenceAttribute>()).Select(f => f.Name).ToArray())
|
||||
t => Utility.GetFields(t).Where(Utility.HasAttribute<FluentReferenceAttribute>).Select(f => f.Name).ToArray())
|
||||
.Where(t => t.Value.Length > 0)
|
||||
.ToDictionary(t => t.Key, t => t.Value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user