A collection of useful tools dedicated to making i18n works easier for Mount & Blade II: Bannerlord mod creators.
MIT License
English | | Trke
[!IMPORTANT]
Only Windows supported. For detail, see node-steam-library and winreg.
A collection of useful tools dedicated to making i18n works easier for Mount & Blade II: Bannerlord mod creators.
First make sure that the Node is installed on the computer and the installation path exists in the operating system or user environment variable.
Install this cli through NPM in any terminal (cmd/bash/powershell/...).
npm install bannerlord-helper --global
Run the help command to check whether the cli is installed successfully.
bh -h
bh <command> [options]
Commands:
bh search [keywords] Search mods on Nexusmod [aliases: browse]
bh info Retrieve local module details and update information
[aliases: query]
bh identifier Populate and fix translation flags for local mods
[aliases: ident]
bh generate Generate translation template files for local module
s [aliases: gen]
bh translate Translate the translation template files for local m
odules [aliases: trans]
bh external Translate local modules to plug-in translation modul
es [aliases: ext]
bh language [codeOrName] Show list of supported languages [aliases: lang]
bh completion generate completion script
Options:
--engine translation engine (Default by microsoft)
[string] [choices: "microsoft", "google", "deeplx"] [default: "microsoft"]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Examples:
$ bh -h View command line help information
$ bh language -h View help information for the langua
ge command
$ bh [command] -h View help information for the specif
ied command
$ bh [command] --engine google Use Google Translate Engine
$ bh [command] --engine deeplx Translate using Deeplx
Name | Default | Description |
---|---|---|
DEEPLX_PORT | 1188 | Local service port of DeepLX |
DEEPLX_TOKEN | - | Access token to protect your API |
Name | Type | Abbr | Required | Choices | Default | Description |
---|---|---|---|---|---|---|
engine | string | - | No | "microsoft", "google", "deeplx" | "microsoft" | translation engine (Default by microsoft) |
help | boolean | h | No | - | - | Show help |
version | boolean | v | No | - | - | Show version number |
Alias: browse
Search mods on
Nexusmod
Option | Type | Abbr | Required | Default | Description |
---|---|---|---|---|---|
keywords | string | k | Yes | - | Module name keyword |
language | string | l | No | "EN" | Translate language codes for Nexusmod mod list names |
Example
$ bh search "ButterLib"
: Show details of the Butter Lib module on Nexusmod in the terminal$ bh search "" --language="cns"
: Use Simplified Chinese to search for modules and translate the search$ bh search "Diplomacia" --language="sp" --engine="google"
: Find and translate modules in Spanish via Google$ bh browse -k Diplomacy -l tr
: Use aliases to simplify command linesAlias: query
Query local module details and update information
Option | Type | Abbr | Required | Default | Description |
---|---|---|---|---|---|
language | string | l | No | "EN" | Translate language codes for local mod list names |
reset | boolean | r | No | false | Reindex selected mods linked to Nexusmod |
Example
$ bh info --language="cns"
: Translate search result names using Simplified Chinese$ bh view -l cns
: Use aliases to simplify command linesAlias: ident
Populate and fix translation flags for local mods
Option | Type | Abbr | Required | Default | Description |
---|---|---|---|---|---|
language | string | l | No | "EN" | Translate language codes for local mod list names |
Example
$ bh identifier --language="cns"
: Translate search result names using Simplified Chinese$ bh ident -l cns
: Use aliases to simplify command linesAlias: gen
Generate translation template files for local modules
Option | Type | Abbr | Required | Default | Description |
---|---|---|---|---|---|
language | string | l | No | "EN" | Translate language codes for local mod list names |
to | string | t | No | "EN" | Target language code (the language of the source file text) |
force | boolean | - | No | false | Clear existing files and regenerate templates |
Example
$ bh generate
: Generate a translation English template and export it to the Languages root directory$ bh generate -to="tr"
: Generate translation Turkish template and export to Languages/TR directory$ bh generate -to="chinese simplified"
: Generate a translation Simplified Chinese template and export it to the$ bh gen -t cns
: Use aliases to simplify command linesAlias: trans
Translate the translation template files for local modules
Option | Type | Abbr | Required | Default | Description |
---|---|---|---|---|---|
to | string | t | Yes | - | target language code |
from | string | f | No | "EN" | Source text language code |
prefix | string | p | No | - | Add a prefix to each translated text |
force | string | - | No | false | Clear existing files and re-translate |
Example
$ bh translate --to="cns"
: Translate the English translation template in the Languages root directory into$ bh translate --from="cns" --to="Japanese"
: Translate the Simplified Chinese template in the Languages/CNs$ bh translate --to="cns" --prefix="[CNS]"
: Translate the English template into Simplified Chinese and generate it$ bh translate --to="cns" --force
: Clear the Languages/CNs directory and translate the English template into$ bh trans -f en -t cns -p [CNS]
: Use aliases to simplify command linesAlias: ext
Translate local modules to plug-in translation modules
Option | Type | Abbr | Required | Default | Description |
---|---|---|---|---|---|
to | string | t | Yes | - | target language code |
from | string | f | No | "EN" | Source text language code |
prefix | string | p | No | - | Add a prefix to each translated text |
force | string | - | No | false | Clear existing files and re-translate |
Example
$ bh external --to="cns"
: Translate the source file into a Simplified Chinese template and export it to the$ bh external --to="cns" --prefix="[CNS]"
: Translate the source file into Simplified Chinese, export it to the$ bh external --to="cns" --force
: Clear the ../Module Name CNs/ModuleData directory, translate the source files into$ bh ext -f en -t cns -p [CNS]
: Use aliases to simplify command linesAlias: lang
Show list of supported languages
Option | Type | Abbr | Required | Default | Description |
---|---|---|---|---|---|
code-or-name | string | - | No | - | Language code or language name |
Example
$ bh language
: Show details of the Butter Lib module on Nexusmod in the terminal$ bh language cns
: View the language names and localized names of language code CNs$ bh lang
: Use aliases to simplify command linesLanguage Name | Native Name | ISO-639-1 | ISO-3166-1 (Alpha-2) | file |
---|---|---|---|---|
English | - | en | US | src/locale/en-US.ts |
German | Deutsch | de | DE | src/locale/de-DE.ts |
Spanish | Espaol | es | ES | src/locale/es-ES.ts |
French | Franais | fr | FR | src/locale/fr-FR.ts |
Italian | Italiano | it | IT | src/locale/it-IT.ts |
Japanese | ja | JP | src/locale/ja-JP.ts | |
Korean | ko | KR | src/locale/ko-KR.ts | |
Polish | Polski | pl | PL | src/locale/pl-PL.ts |
Portuguese | Portugus | pt | PT | src/locale/pt-PT.ts |
Russian | ru | RU | src/locale/ru-RU.ts | |
Turkish | Trke | tr | TR | src/locale/tr-TR.ts |
Chinese Simplified | zh | CN | src/locale/zh-CN.ts | |
Chinese Traditional | zh | TW | src/locale/zh-TW.ts |
Contributions via Pull Requests or Issues are welcome.
This project is licensed under the MIT License. See the LICENSE file for details.