MultiLangLib
v0.1.0Shared translation library for Captain of Industry mods.
- Source code
- https://github.com/max2605/MultiLangLib
MultiLangLib – shared translations for mods
MultiLangLib is a translation library for Captain of Industry. It is primarily intended for mod developers and provides other mods with a shared, easy-to-use API for multilingual text.
The library loads translations matching the language selected in the game, supports an English fallback, and displays an unambiguous key when an entry is missing. This makes incomplete translations easy to find without making a mod unusable because of a single missing text.
Note for players: MultiLangLib does not add buildings, recipes, or gameplay mechanics on its own. It is a library used by other mods. If an installed mod lists MultiLangLib as a dependency, MultiLangLib must also be installed and enabled in the Mod Manager.
Features
- automatically follows the language selected in Captain of Industry
- loads language files directly from the directory of each consumer mod
- supports English or another configurable fallback language
- accepts simple JSON objects and the established COI array format
- formats placeholders such as
{0}using the active language culture - includes a debug mode that displays complete translation keys instead of text
- logs missing or invalid entries without unnecessarily breaking UI calls
- requires no Harmony patches or access to private engine data
Installation for players
- Extract the release archive directly into
%APPDATA%\Captain of Industry\Mods. - Confirm that
MultiLangLib.dllis located underMods\MultiLangLib\. - Enable MultiLangLib and the mod that depends on it in the Mod Manager.
- Start the game.
The resulting directory should begin like this:
%APPDATA%\Captain of Industry\Mods\MultiLangLib\
├── MultiLangLib.dll
├── manifest.json
├── config.json
└── lang\
For mod developers
A consumer mod declares MultiLangLib>=0.1.0 as a dependency, references the shared DLL, and stores its texts under lang\<language>.json. The following calls are then available, among others:
string title = Lang.Get("multilanglib.MyMod.window.title");
LocStrFormatted label = Lang.Localized("multilanglib.MyMod.window.title");
string greeting = Lang.Format("multilanglib.MyMod.welcome", playerName);
The included MODDER_GUIDE_EN.md explains the complete integration. A buildable sample is available in the source project under examples/ExampleConsumer.
Compatibility
- MultiLangLib 0.1.0
- tested with Captain of Industry 0.8.6c (Build 612)
- target platform: .NET Framework 4.8
The Captain of Industry modding API is experimental. Compatibility should therefore be verified again after game updates.
License
MultiLangLib is distributed under the MIT License.
No announcements yet.
No changelog available for this mod.
This mod has no dependencies.
- Truck Parking (TruckParking)
- Highway Roads (GroundRoads)
- UNMA – Universelle Nachrichten-Meldeanlage (UNMA)