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.
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"
}
]
}
Requirements:
- Python 3.11 or above
- Poetry
- Install dependencies using
poetry install
in your terminal. - Create Open AI account and get your access token from here https://chat.openai.com/api/auth/session.
- Rename
example.env
to.env
and setOPENAI_ACCESS_TOKEN
to your access token. - Run
main.py
usingpoetry run python src/main.py PATH_TO_YOUR_JSON_PACK
in your terminal wherePATH_TO_YOUR_JSON_PACK
is the path your localization pack.
- Address Bad translations for long text
- Address malformed json response
- Address rate limits (add another endpoint?)