Skip to content

KimPlaybit2/Localization-Editor-SC2-KSP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Localization-Editor-SC2-KSP

A localization editor for StarCraft II maps and mods.
Opens GameStrings.txt,ObjectStrings.txt,TriggerStrings.txt files, translates them into selected languages, and automatically saves them into the correct .SC2Data/LocalizedData directory structure.


Download the latest version from:

https://github.com/vlencmanissc-dotcom/Localization-Editor-SC2-KSP/releases

Simple Installation (Recommended)

1. Install the editor

Download the latest version from GitHub Releases:

https://github.com/vlencmanissc-dotcom/Localization-Editor-SC2-KSP/releases

Run the installer:

LocalizationEditor-Setup-1.1.1exe

After installation, launch the editor normally.


2. Enable auto-translation with Docker (optional)

Auto-translation requires LibreTranslate.

Install Docker Desktop for Windows:

https://www.docker.com/products/docker-desktop/

Download the Windows AMD64 version.

During installation:

  • enable Use WSL 2 instead of Hyper-V
  • leave Windows Containers disabled

After installation:

  1. Restart your computer
  2. Start Docker Desktop
  3. Wait until Docker shows that it is running

3. Start LibreTranslate

Open Release ZIP/docker and run:

start-libretranslate.bat

The batch file starts LibreTranslate for you through Docker Compose. No separate LibreTranslate program installation is required in this mode.

This will start LibreTranslate at:

http://127.0.0.1:5000

4. First start note

On the first start Docker will download:

  • LibreTranslate container
  • translation models

LibreTranslate will also download the required language models during the first start.

The first start can take a few minutes. That is normal.

Only these languages are loaded:

en, ru, de, es, fr, it, pl, pt, ko, zh, zt

5. Check that the server works

Open in your browser:

http://127.0.0.1:5000/languages

If you see JSON with languages, the translation server is running correctly.

The application expects LibreTranslate at:

http://127.0.0.1:5000

If LibreTranslate is not running, auto-translation will not work.

Manual Installation (Advanced)

Use this method if you do not want to use Docker or if you want to run LibreTranslate manually.

Optional: Start LibreTranslate with Docker from the command line

Use this if you want Docker, but prefer command-line commands instead of the batch file. This is also the preferred manual strategy if you do not want to install LibreTranslate as a local program.

From the project root directory, run:

cd "Release ZIP/docker"
docker compose -f docker-compose.yml up -d

To view the startup logs:

docker compose -f docker-compose.yml logs -f libretranslate

When the server is ready, the logs will contain a line like:

Listening at: http://[::]:5000

To stop the container later:

docker compose -f docker-compose.yml down

1. Java (JDK 17+)

Download JDK 17 or newer from:

Check your Java version:

java -version

2. Maven (3.8+ recommended)

Download Maven from:

After downloading, follow the installation guide:

Check your Maven version:

mvn -v

3. Python (Optional – only for auto-translation)

Required only if you want to use LibreTranslate.

Recommended Python versions: 3.11 or 3.12

Very new Python versions (for example 3.14+) may produce dependency warnings with LibreTranslate.

Download Python from:
https://www.python.org/downloads/

On Windows, make sure to check "Add Python to PATH" during installation.


Windows Additional Requirement

LibreTranslate requires Microsoft Visual C++ Redistributable (x64).

Download and install:
https://aka.ms/vs/17/release/vc_redist.x64.exe


Install OnnxRuntime (Required)

LibreTranslate requires ONNX Runtime to execute translation models.

Install ONNX Runtime:

python -m pip install onnxruntime==1.24.1

If you need to reinstall:

python -m pip uninstall onnxruntime -y
python -m pip install onnxruntime==1.24.1

You can verify the installed version with:

python -c "import onnxruntime as ort; print(ort.__version__)"

⚠ If you see a warning that the Scripts directory is not on PATH (for example Python311\Scripts), either add it to PATH or run libretranslate.exe directly from that folder.


Install LibreTranslate

Use this section only if you want to run LibreTranslate without Docker. If you use docker-compose.yml, skip this section.

python -m pip install --upgrade pip

python -m pip install "wheel==0.45.1"

python -m pip install libretranslate

Fix requests dependency (important)

LibreTranslate currently requires a specific version of requests.

Install the compatible version:

python -m pip install requests==2.31.0

Start LibreTranslate server

Start the LibreTranslate server using the following command:

First start (downloads translation models):

libretranslate --load-only en,ru,de,es,fr,it,pl,pt,ko,zh,zt --update-models

Later starts:

libretranslate --load-only en,ru,de,es,fr,it,pl,pt,ko,zh,zt

If libretranslate command exists but server still does not become ready, start via Python module directly (recommended fallback):

python -m libretranslate.main --host 127.0.0.1 --port 5000 --disable-web-ui

If everything is correct, you should see:

Running on http://127.0.0.1:5000

The application expects LibreTranslate running at:

http://127.0.0.1:5000

If LibreTranslate is not running, auto-translation will not work. Test LibreTranslate (Optional) You can test the translation server with:

curl -X POST http://127.0.0.1:5000/translate -H "Content-Type: application/json" -d "{\"q\":\"Hello world\",\"source\":\"en\",\"target\":\"de\"}"

Expected output example:

{
"translatedText": "Hallo Welt"
}

Troubleshooting (Windows)

If startup fails with an error similar to:

FileExistsError ... C:\Users\<user>\.config\argos-translate

then argos-translate path is broken (file exists where directory is expected).

PowerShell fix:

$cfg = "$env:USERPROFILE\.config\argos-translate"
if (Test-Path $cfg -PathType Leaf) { Remove-Item $cfg -Force }
New-Item -ItemType Directory -Path $cfg -Force | Out-Null

Then start LibreTranslate again and verify:

http://127.0.0.1:5000/languages

Run with Maven

From the project root directory (where pom.xml is located), run:

mvn clean javafx:run

If needed:

mvn exec:java -Dexec.mainClass=lv.lenc.AppLauncher

Run the CLI on Windows

From the project root:

run-cli.bat check-missing "C:\Maps\MyMap\enUS.SC2Data\LocalizedData\GameStrings.txt"

JSON output for automation:

run-cli.bat check-missing "C:\Maps\MyMap\enUS.SC2Data\LocalizedData\GameStrings.txt" --json

Or directly through PowerShell:

powershell -ExecutionPolicy Bypass -File .\scripts\run-cli.ps1 check-missing "C:\Maps\MyMap\enUS.SC2Data\LocalizedData\GameStrings.txt" --json

Build a single-file CLI jar

From the project root:

mvn -DskipTests package

This produces an executable CLI jar:

target/Localization_Editor_SC2_KSP-1.1.1-cli.jar

You can run it from any folder (including a different repo):

java -jar C:\git-repo\Localization-Editor-SC2-KSP\target\Localization_Editor_SC2_KSP-1.1.1-cli.jar check-missing "C:\Maps\MyMap\enUS.SC2Data\LocalizedData\GameStrings.txt" --json

Register a global command on Windows

You can install a command shim so the CLI appears in your terminal command list (PATH), for example as sc2loc.

From the project root:

powershell -ExecutionPolicy Bypass -File .\scripts\install-cli-command.ps1 -Mode script

Then run from any folder:

sc2loc check-missing "C:\Maps\MyMap\enUS.SC2Data\LocalizedData\GameStrings.txt" --json

Optional custom command name:

powershell -ExecutionPolicy Bypass -File .\scripts\install-cli-command.ps1 -CommandName lenc-loc

Export a portable CLI package zip

You can build a distributable zip that contains:

  • LocalizationCli.jar
  • run-cli.bat
  • install-cli-command.bat
  • install-cli-command.ps1

Build it from the project root:

powershell -ExecutionPolicy Bypass -File .\scripts\build-cli-package.ps1

This produces:

dist/LocalizationCli-Package.zip

After extracting the zip, install the command with:

install-cli-command.bat

Then run from any folder:

sc2loc --help
sc2loc check-missing "C:\Maps\MyMap\enUS.SC2Data\LocalizedData\GameStrings.txt" --json

What it reports

The CLI currently reports:

  • missing locale files for sibling .SC2Data/LocalizedData folders
  • missing keys in one language compared with the others
  • blank or null-like values
  • malformed lines without =
  • duplicate keys inside one file

Exit codes

  • 0: no issues found
  • 1: warnings or errors found
  • 2: usage or input error
  • 3: unexpected runtime failure

Build (Optional)

To compile the project:

mvn clean package

About

A localization editor for StarCraft II maps and mods. Opens GameStrings.txt files, translates them into selected languages, and automatically saves them into the correct SC2Data directory structure.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 89.7%
  • CSS 8.8%
  • PowerShell 1.3%
  • Batchfile 0.2%