Expose mod.yaml content to localisation.#21601
Conversation
7c4bac6 to
bd86d78
Compare
PunkPun
left a comment
There was a problem hiding this comment.
ra crashes on startup
Exception of type `System.NullReferenceException`: Object reference not set to an instance of an object.
at OpenRA.TranslationProvider.GetString(String key, IDictionary`2 args) in /GitHub/OpenRA/OpenRA.Game/TranslationProvider.cs:line 41
at OpenRA.ExternalMods.Register(Manifest mod, String launchPath, IEnumerable`1 launchArgs, ModRegistration registration) in /GitHub/OpenRA/OpenRA.Game/ExternalMods.cs:line 126
bd86d78 to
29f45c1
Compare
This seems to be relted to external mod registrations. I've removed the "Title" field since we may not be able to provide the translated title - as we haven't loaded the translations. This means |
6ffa62a to
caed592
Compare
|
Mod registrations are local to the current computer, so its fine to take the current language and write localised strings directly into the metadata. |
|
Okay it's good that the text will match. However that still leaves the problem with the mod not being loaded, thus no translations, thus no ability to write out the translated title anyway. |
OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentPromptLogic.cs
Outdated
Show resolved
Hide resolved
caed592 to
7429f3c
Compare
If WordWrap is enabled, the wrapping must be applied before any TextAlign is applied, or the final position will be incorrect. Introduce a IncreaseHeightToFitCurrentText to make such WordWrap labels easier to use, and apply to CreditsLogic.
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.
7429f3c to
37d2d35
Compare
That looks like a local merge error. I've rebased onto bleed if that is helpful. |
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.