Skip to content

Conversation

@yurecz
Copy link

@yurecz yurecz commented Oct 25, 2025

Summary

Adds a dedicated installer and mod type for Bannerlord translation archives.
Detects translation files under ModuleData/Languages//language_data.xml.
Infers the target module folder when the archive lacks one; warns if unknown.
Displays detected languages in the Mods Details panel.

User Benefits

One‑click install for translation‑only zips (no manual merging).
Prevents broken installs by placing files under the correct module when possible.
Shows which languages a translation includes at a glance.
Works with common archive layouts from Nexus and community packs.

What It Supports

Modules/<ModuleId>/ModuleData/Languages/<lang>/...
/<ModuleId>/ModuleData/Languages/<lang>/...
ModuleData/Languages/<lang>/... (tries to infer from archive/Nexus metadata)

Behavior

New installer: bannerlord-translation-installer (priority 30).
New mod type: bannerlord-translation;
New attributes translationLanguages (array) and translationLanguagesText (string).

UI: “Translation Languages” shown in Mods Details.
If the module can’t be inferred, files are installed under ModuleData/ and a warning explains how to repack for best results.

Compatibility

Scoped to MB2 only; does not change existing module installs.
Only classifies as translation when language files are present and no SubModule.xml is found.
Backwards compatible: other archives continue using existing logic.

How To Test

Install a translation zip with Modules//ModuleData/Languages/... → installs under that module; languages listed in Details.
Install a translation zip with /ModuleData/Languages/... → auto‑targets ; languages listed.
Install a translation zip with only ModuleData/Languages/... → attempts to infer ; if not possible, warns and installs under ModuleData/.
Install a normal mod with SubModule.xml → not treated as translation; existing behavior unchanged.
Implementation Notes

Wires the installer/mod type in src/index.ts.
Adds translation logic in src/vortex/modTranslation.ts:
Language detection, payload filtering, path normalization, target inference, attributes, and notifications.

Changelog

Added: Dedicated installer for translation archives with language detection and Mods panel display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant