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:
@@ -37,7 +37,9 @@ namespace OpenRA.Mods.Common.Lint
|
||||
return expr != null ? expr.Variables : Enumerable.Empty<string>();
|
||||
}
|
||||
|
||||
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>))
|
||||
if (type.IsGenericType &&
|
||||
(type.GetGenericTypeDefinition() == typeof(Dictionary<,>) ||
|
||||
type.GetGenericTypeDefinition() == typeof(IReadOnlyDictionary<,>)))
|
||||
{
|
||||
// Use an intermediate list to cover the unlikely case where both keys and values are lintable.
|
||||
var dictionaryValues = new List<string>();
|
||||
@@ -60,6 +62,9 @@ namespace OpenRA.Mods.Common.Lint
|
||||
"Dictionary<string, T> (LintDictionaryReference.Keys)",
|
||||
"Dictionary<T, string> (LintDictionaryReference.Values)",
|
||||
"Dictionary<T, IEnumerable<string>> (LintDictionaryReference.Values)",
|
||||
"IReadOnlyDictionary<string, T> (LintDictionaryReference.Keys)",
|
||||
"IReadOnlyDictionary<T, string> (LintDictionaryReference.Values)",
|
||||
"IReadOnlyDictionary<T, IEnumerable<string>> (LintDictionaryReference.Values)",
|
||||
"BooleanExpression", "IntegerExpression"
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user