Skip to content

A python script to generate localization json files for Valheim modding.

Notifications You must be signed in to change notification settings

jneb802/valheim_GPT_Localization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Valheim GPT Localization Script

This repository contains a quick and easy Python script to generate localizations using GPT. The output is a folder of JSON files that are compatible with both Jotunn and Blaxxun-boop's LocalizationManager. The script uses the gpt-3.5-turbo-1106 GPT model.

Requirements and dependencies

  1. Python >=3.7.1
  2. GPT api key
  3. openai python library
  4. python-dotenv python library

How to Install and Run

  1. Clone this repository to your local device.
  2. Install dependencies:
    • pip install openai
    • pip install python-dotenv
  3. Sign up for a GPT API key here.
  4. Create an .env file in the root directory.
  5. In your .env file, enter your API key as OPENAI_API_KEY='your_api_key'.
  6. In the root directory, replace English_yourModNameHere.json with your base language JSON file.
  7. In the valheimLocalization.py file, change the 'English_yourModNameHere.json' argument to the file name of your base language JSON file.
  8. In the valheimLocalization.py file, change the 'ExampleMod' argument to your mod name.
  9. Run the file valheimLocalization.py
  10. A new folder titled 'Translations' will be created in your projects root directory.

You can generate localizations for many languages or just one. In valheimLocalization.py, the list valheim_languages contains all the languages supported by Valheim. Adjust this list to select which languages to generate. For a single language, modify the list to include only that language. To add more languages, append them to the list.

About

A python script to generate localization json files for Valheim modding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages