add Bannerlord translation archieves installer and new mod translation type #181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.