Toolsets for GoldSrc BSP Localization.
BSPLocalizationToolsCore: shared localization library.BSPLocalizationToolsCLI: command line wrapper.BSPLocalizationTools: Avalonia GUI wrapper.
dotnet run --project src\BSPLocalizationToolsCLI -- `
"-bsp=tests\maps\pizza_ya_san1.bsp" `
"-outlang=schinese" `
"-promptfile=path\to\prompt.md" `
"-llm_model=gpt-5.5" `
"-llm_apikey=<key>"Output will be written next to the pizza_ya_san1.bsp as pizza_ya_san1_dictionary_schinese.csv which can be loaded by CaptionMod.
-bsp=<path>: required BSP file.-outlang=<lang>: optional target language, defaults toschinese.-promptfile=<path>: optional UTF-8 custom translation prompt. When omitted, the tool looks next to the BSP for<map>_prompt_<outlang>.md, then<map>_prompt.md, before falling back to the built-in prompt.-llm_model=<model>orBSPL10N_LLM_MODEL.-llm_apikey=<key>orBSPL10N_LLM_APIKEY.-llm_baseurl=<url>orBSPL10N_LLM_BASEURL.-llm_temperature=<value>orBSPL10N_LLM_TEMPERATURE.-llm_effort=<effort>orBSPL10N_LLM_EFFORT, defaults tomedium.-llm_fake_as=codexorBSPL10N_LLM_FAKE_AS=codex.
The tool loads a .env file from the current directory or any parent directory before reading
environment variables. Command line arguments override environment variables, and existing
process environment variables override values from .env.
The GUI reads and writes .env next to the running tool by default. Prompt configuration is stored
as a prompt file path; prompt text remains in a UTF-8 .md file.
Example .env:
BSPL10N_LLM_MODEL=gpt-5.5
BSPL10N_LLM_APIKEY=<key>
BSPL10N_LLM_BASEURL=https://api.openai.com/v1
BSPL10N_LLM_EFFORT=medium
BSPL10N_DEFAULT_OUTLANG=schinese
BSPL10N_DEFAULT_PROMPTFILE=path\to\prompt.mdRun the Avalonia app from src\BSPLocalizationTools.
The Translate tab supports selecting one or more .bsp files, starting or canceling translation, and viewing per-file progress and logs.
The Settings tab loads and saves LLM and prompt path settings to .env.
CSV output is always written as UTF-8 with BOM.
Use Windows x64 with the .NET 10 SDK. Publishing the GUI and CLI as Native AOT additionally requires the Visual Studio 2022 Desktop development with C++ workload (MSVC linker) and a Windows SDK.
From the repository root:
dotnet restore BSPLocalizationTools.slnx
dotnet test BSPLocalizationTools.slnx -c Release
dotnet run --project src\BSPLocalizationTools # Avalonia GUI
dotnet run --project src\BSPLocalizationToolsCLI -- "-bsp=path\to\map.bsp" # CLIBoth executables are published as self-contained Native AOT programs, so the target machine does not need the .NET runtime. Native AOT cannot fold Avalonia's native backends into the executable, so the GUI ships as the executable plus its native libraries:
dotnet publish src\BSPLocalizationTools\BSPLocalizationTools.csproj -c Release -r win-x64 -o out\GUI
dotnet publish src\BSPLocalizationToolsCLI\BSPLocalizationToolsCLI.csproj -c Release -r win-x64 -o out\CLI