# How does it work?

The translation component follows a structured workflow to ensure that content, categories, and menu assignments are translated in the correct order and with the most reliable result possible.

Whenever content is saved in the source language or assigned to it, the system checks whether the item meets the required conditions for translation. This validation happens on category and menu item level to prevent incomplete or incorrect language relationships.

The infographic below illustrates the full translation workflow—from detecting eligible content, validating category and menu assignments, up to creating translated articles, categories, and menu items in the target language.

<figure><img src="/files/6fjlsZ5PXL7gfzr6uh9a" alt=""><figcaption></figcaption></figure>

#### 1. Initial setup

Before translations can start, three basic requirements must be configured:

* Define the source language and all target languages
* Create the multilingual menu structure for each language
* Add the API key for your translation service (for example OpenAI)

This setup ensures that the component knows where content originates from, where translations should be created, and which AI service should be used for generating translations.

#### 2. Content detection

The translation process starts whenever content is saved or assigned to the source language.

This applies to:

* Categories
* Menu items
* Articles that belong to a category assigned to the source language

Only content that matches these conditions is considered for automatic translation.

#### 3. Create mock items in target languages

Once valid source content is detected, the system first creates placeholder (mock) items in all configured target languages.

These mock items establish the correct Joomla language associations, menu relations, and category connections before the actual translation is generated.

This step is important to maintain a clean multilingual structure and avoid broken menu assignments.

#### 4. Add items to the translation queue

After the mock items are created, the items are added to the translation queue.

The queue manages all pending translation tasks and ensures that content is processed in the correct sequence.

For example, categories should be translated before articles that belong to them.

#### 5. Scheduled translation task

A Joomla scheduled task called **Translation Task** runs automatically once per minute by default.

This task checks whether items are waiting in the translation queue and starts the translation process.

The interval can be adjusted depending on your project requirements.

#### 6. Fetch AI-generated translations

The scheduled task sends the queued content to the configured AI translation service, such as OpenAI.

The service returns the translated content for:

* Titles
* Descriptions
* Full article content
* Meta information
* YOOtheme layouts

The component then prepares this translated content for saving.

#### 7. Save translated items

The system updates the previously created mock items with the translated content.

This means the placeholder items are converted into fully translated Joomla categories, articles, and menu items while keeping all language associations intact.

#### 8. Translation finished

Once completed, the translated items are saved and their publish state is applied based on the source item settings.

Depending on the original content configuration, translated items can be published or unpublished automatically.This completes the multilingual translation workflow.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://joomtastic.gitbook.io/joomtastic-docs/how-does-it-work.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
