JohN100x1 / IsekaiLocalizer

ChatGPT Localization Tool for Pathfinder: Wrath of the Righteous Modding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IsekaiLocalizer

Tests Python Style

Create localization using ChatGPT. For an input LocalizationPack.json, the output will have null values filled using the translated English value. Currently only supports translation from English to the other languages.

Disclaimer: the results are from ChatGPT, so you may not get accurate results.

Example

Input LocalizationPack.json

{
  "LocalizedStrings": [
    {
      "Key": "714b99be4cc74d8ea02500d4c7cffa4e",
      "SimpleName": "$IsekaiProtagonistSpellbook.Name",
      "ProcessTemplates": false,
      "enGB": "Isekai Protagonist",
      "ruRU": null,
      "deDE": null,
      "frFR": null,
      "zhCN": null,
      "esES": null
    }
  ]
}

Output LocalizationPack.json

{
  "LocalizedStrings": [
    {
      "Key": "714b99be4cc74d8ea02500d4c7cffa4e",
      "SimpleName": "$IsekaiProtagonistSpellbook.Name",
      "ProcessTemplates": false,
      "enGB": "Isekai Protagonist",
      "ruRU": "Исекай Протагонист",
      "deDE": "Isekai-Protagonist",
      "frFR": "Protagoniste d'Isekai",
      "zhCN": "异世界主角",
      "esES": "Protagonista de Isekai"
    }
  ]
}

Usage

Requirements:

  1. Install dependencies using poetry install in your terminal.
  2. Create Open AI account and get your access token from here https://chat.openai.com/api/auth/session.
  3. Rename example.env to .env and set OPENAI_ACCESS_TOKEN to your access token.
  4. Run main.py using poetry run python src/main.py PATH_TO_YOUR_JSON_PACK in your terminal where PATH_TO_YOUR_JSON_PACK is the path your localization pack.

TODO

  • Address Bad translations for long text
  • Address malformed json response
  • Address rate limits (add another endpoint?)

About

ChatGPT Localization Tool for Pathfinder: Wrath of the Righteous Modding


Languages

Language:Python 100.0%