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 installin your terminal. - Create Open AI account and get your access token from here https://chat.openai.com/api/auth/session.
- Rename
example.envto.envand setOPENAI_ACCESS_TOKENto your access token. - Run
main.pyusingpoetry run python src/main.py PATH_TO_YOUR_JSON_PACKin your terminal wherePATH_TO_YOUR_JSON_PACKis the path your localization pack.
- Address Bad translations for long text
- Address malformed json response
- Address rate limits (add another endpoint?)