Expose mod.yaml content to localisation.
Mod metadata, load screens and mod content is all now sourced from ftl files, allowing these items to be translated. Translations are now initialized as part of ModData creation, as currently they are made available too late for the usage we need here. The "modcontent" mod learns a new parameter for "Content.TranslationFile" - this allows a mod to provide the path of a translation file to the mod which it can load. This allows mods such as ra, cnc, d2k, ts to own the translations for their ModContent, yet still make them accessible to the modcontent mod. CheckFluentReference learns to validate all these new fields to ensure translations have been set.
This commit is contained in:
@@ -182,13 +182,13 @@ namespace OpenRA.Network
|
||||
if (external != null && external.Version == Version)
|
||||
{
|
||||
// Use external mod registration to populate the section header
|
||||
ModTitle = external.Title;
|
||||
ModTitle = external.Id;
|
||||
}
|
||||
else if (Game.Mods.TryGetValue(Mod, out var mod))
|
||||
{
|
||||
// Use internal mod data to populate the section header, but
|
||||
// on-connect switching must use the external mod plumbing.
|
||||
ModTitle = mod.Metadata.Title;
|
||||
ModTitle = mod.Metadata.TitleTranslated;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -199,7 +199,7 @@ namespace OpenRA.Network
|
||||
.FirstOrDefault(m => m.Id == Mod);
|
||||
|
||||
if (guessMod != null)
|
||||
ModTitle = guessMod.Title;
|
||||
ModTitle = guessMod.Id;
|
||||
else
|
||||
ModTitle = $"Unknown mod: {Mod}";
|
||||
}
|
||||
@@ -222,7 +222,7 @@ namespace OpenRA.Network
|
||||
Map = server.Map.Uid;
|
||||
Mod = manifest.Id;
|
||||
Version = manifest.Metadata.Version;
|
||||
ModTitle = manifest.Metadata.Title;
|
||||
ModTitle = manifest.Metadata.TitleTranslated;
|
||||
ModWebsite = manifest.Metadata.Website;
|
||||
ModIcon32 = manifest.Metadata.WebIcon32;
|
||||
Protected = !string.IsNullOrEmpty(server.Settings.Password);
|
||||
|
||||
Reference in New Issue
Block a user