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:
RoosterDragon
2024-09-23 19:58:33 +01:00
committed by Gustas
parent d1583e8587
commit bb17cfa179
36 changed files with 292 additions and 144 deletions

View File

@@ -1,9 +1,9 @@
Metadata:
Title: Tiberian Sun
Title: mod-title
Version: {DEV_VERSION}
Website: https://www.openra.net
WebIcon32: https://www.openra.net/images/icons/ts_32x32.png
WindowTitle: OpenRA - Tiberian Sun
WindowTitle: mod-windowtitle
PackageFormats: Mix
@@ -187,6 +187,7 @@ Translations:
common|languages/en.ftl
common|languages/chrome/en.ftl
common|languages/rules/en.ftl
ts|languages/en.ftl
ts|languages/chrome/en.ftl
ts|languages/rules/en.ftl
@@ -216,7 +217,6 @@ Hotkeys:
LoadScreen: LogoStripeLoadScreen
Image: ts|uibits/loadscreen.png
Text: Updating EVA installation..., Changing perspective...
ServerTraits:
LobbyCommands
@@ -312,31 +312,31 @@ GameSpeeds:
OrderLatency: 6
ModContent:
InstallPromptMessage: Tiberian Sun requires artwork and audio from the original game.\n\nQuick Install will automatically download this content (without music\nor videos) from a mirror of the 2012 Tiberian Sun freeware release.\n\nAdvanced Install includes options for copying the music, videos, and\nother content from an original game disc or digital installation.
InstallPromptMessage: modcontent-installprompt
QuickDownload: quickinstall
HeaderMessage: Game content may be extracted from the original game discs or an\nexisting digital install. OpenRA can also download the base game\nfiles from an online mirror of the 2012 freeware release of TS.
HeaderMessage: modcontent-header
Packages:
ContentPackage@tibsun:
Title: Base Game Files
Title: modcontent-package-basefiles
Identifier: tibsun
TestFiles: ^SupportDir|Content/ts/cache.mix, ^SupportDir|Content/ts/conquer.mix, ^SupportDir|Content/ts/isosnow.mix, ^SupportDir|Content/ts/isotemp.mix, ^SupportDir|Content/ts/local.mix, ^SupportDir|Content/ts/sidec01.mix, ^SupportDir|Content/ts/sidec02.mix, ^SupportDir|Content/ts/sno.mix, ^SupportDir|Content/ts/snow.mix, ^SupportDir|Content/ts/sounds.mix, ^SupportDir|Content/ts/speech01.mix, ^SupportDir|Content/ts/tem.mix, ^SupportDir|Content/ts/temperat.mix
Sources: tibsun, tfd, steam, origin
Required: true
Download: basefiles
ContentPackage@tibsun-music:
Title: Base Game Music
Title: modcontent-package-basemusic
Identifier: tibsun-music
TestFiles: ^SupportDir|Content/ts/scores.mix
Sources: tibsun, tfd, steam, origin
ContentPackage@fstorm:
Title: Firestorm Expansion Files
Title: modcontent-package-firestormfiles
Identifier: fstorm
TestFiles: ^SupportDir|Content/ts/firestorm/e01sc01.mix, ^SupportDir|Content/ts/firestorm/e01sc02.mix, ^SupportDir|Content/ts/firestorm/e01vox01.mix, ^SupportDir|Content/ts/firestorm/e01vox02.mix
Sources: tfd, steam, origin, fstorm
Required: true
Download: fstorm
ContentPackage@fstorm-music:
Title: Firestorm Expansion Music
Title: modcontent-package-firestormmusic
Identifier: fstorm-music
Sources: tfd, steam, origin, fstorm
TestFiles: ^SupportDir|Content/ts/firestorm/scores01.mix
@@ -348,6 +348,7 @@ ModContent:
ts|installer/steam.yaml
ts|installer/origin.yaml
ts|installer/tibsun.yaml
Translation: ts|languages/modcontent/en.ftl
DiscordService:
ApplicationId: 712713986558394399