Configuration

To enable the AI translation feature, you need to follow these steps:

Install the languine package:

npx languine@latest init

Create your translation file

Start by adding a key to your source file, for example if you choose to use en.json as your source file, add a key to it.

locales/en.json
{
	"welcome": "Welcome to our application!",
	"user": {
		"greeting": "Hi, {{name}}!",
		"profile": {
			"title": "Your profile",
			"edit": "Edit profile"
		}
	},
	"notifications": {
		"messages": "You have {{count}} new message(s).",
		"empty": "No new notifications."
	}
}

Now you can translate your code.

Run the following command to translate your content and follow the instructions:

npx languine@latest translate

After that you will have a new file with the translations, for example locales/fr.json.