Skip to main content
Release version: βversion

Auto-translate content with AI on save

Overview

Kuroco's AI post-processing lets you run AI operations automatically whenever content is saved. This tutorial shows you how to set up automatic translation: when you save a Japanese body text, AI translates it into English and writes the result to a separate English field.

What you'll learn

Prerequisites

  • A Kuroco site is already created

1. Create a content definition

Create a content definition with a source (Japanese) field and a target (English) field.

Click Content structure, then click Add.

Image from Gyazo

Fill in the form as follows.

FieldValue
Content structure nameTranslation test

Then add the following extended fields.

SlugField nameField type
body_jaBody (Japanese)Textarea
body_enBody (English)Textarea

Image from Gyazo

Click Add to save the content definition.

2. Configure AI post-processing

Open the content definition you just created and click AI post-processing in the left sidebar.

Image from Gyazo

Enable AI post-processing

Turn on the Enable toggle under AI post-processing.

Image from Gyazo

Add a rule

Click Add rule and configure it as follows.

FieldValue
PromptSee below
Execution timingOn create / update
Creation statusPublished

Example prompt:

Translate the Japanese text in the body_ja field into natural English and write it to the body_en field. Return only the translation, with no explanation or preamble.
Also, translate the English text in the body_en field into natural Japanese and write it to the body_ja field. Return only the translation, with no explanation or preamble.
caution

Because this prompt is bidirectional, saving content when body_en is empty may cause the AI to overwrite body_ja with the result of "translating empty text." For one-directional use (Japanese → English only), remove the second sentence of the prompt.

Image from Gyazo

Click Update to save the settings.

3. Verify the result

Create a new content entry from the content definition you configured.

Click Content structure, then click List under Translation test. Click Add.

Image from Gyazo

Enter Japanese text in the Body (Japanese) field and click Add.

FieldExample value
Body (Japanese)Kuroco is a headless content management system.

Image from Gyazo

After saving, open the content detail view. Confirm that the Body (English) field has been filled in automatically by AI.

Image from Gyazo

You have now completed the AI auto-translation setup.


Support

If you have any other questions, please contact us or check out Our Slack Community.