Skip to content

Automagically translate your i18n JSON files into multiple languages using OpenAI's API!

License

Notifications You must be signed in to change notification settings

seofernando25/i18n-openai-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

i18n-openai-translate 🌍🔀📚

🤖 Automagically translate your i18n JSON files into multiple languages using OpenAI's API! 🌐

⚠️ NOT FOR PRODUCTION


🚀 Features

  • 🌍 Translate en.json into multiple languages (fr.json, es.json, etc.)
  • 💾 Saves directly into your i18n folder.
  • ⚙️ Easy to configure.
  • 🚫 No more manual translations!

🛠 Installation

Use npm to install i18n-openai-translate.

npm install -g i18n-openai-translate

⚙️ Usage

Simply run the following command inside your i18n folder:

i18n-openai-translate  -i en.json --to fr

📝 Configuration

You can set up your OpenAI API Key by setting the OPENAI_API_KEY environment variable.

Here are the usage flags for the program:

--help: Shows the help message for the program.
--version: Shows the version number of the program.
-f, --from: Specifies the language to translate from.
-t, --to: Specifies the language to translate to.
-l, --languages: Specifies the languages to translate to as an array.
-c, --ctx: Specifies additional context to use.
-s, --save: Specifies whether to save the output to a file or stdout.
-p, --pretty: Specifies whether to pretty print the output.
-i, --input: Specifies the input file to translate, which is required.

🔒 License

This project is GPLv2 licensed.

About

Automagically translate your i18n JSON files into multiple languages using OpenAI's API!

Resources

License

Stars

Watchers

Forks

Packages

No packages published