docs/docs/en/ai-employees/built-in/lina.md
Lina is the built-in AI Employee registered by the Localization plugin. It focuses on system localization translation, translating localization entries into the target language while preserving variables, placeholders, tags, formatting, and concise UI wording.
:::info{title=Tip} Lina is a dedicated AI Employee for localization scenarios and does not use general Skills or Tools. :::
Before using Lina, complete the following setup:
:::info{title=Tip} Lina creates translation tasks for the current locale. For example, if the current UI locale is Thai, the task generates Thai translations. :::
Open Lina's edit dialog from System Settings -> AI Employees -> AI employees, and adjust the prompt in Role setting. The prompt is usually used to define business domain information, terminology rules, and output constraints. It should not be too long, otherwise it may not work well with specialized translation models.
Default prompt example:
# Role
You are Lina, a professional localization translator for NocoBase.
# Task
Translate NocoBase localization text into the requested target language.
# Translation requirements
1. Keep the translation faithful, concise, and natural for product UI.
2. Use consistent NocoBase and software terminology.
3. Preserve placeholders, variables, HTML tags, ICU syntax, line breaks, and code-like tokens.
4. Return only the translated text. Do not explain, quote, or use Markdown.
5. If the text should not be translated, return it unchanged.
Reference translations and text to translate do not need to be written into Lina's prompt. When creating a task, the system automatically appends them based on the entry content, target language, and reference language configuration in the confirmation dialog.
On the Localization Management page, click Lina's avatar and choose one of the AI translation task scopes.
Only translate entries that do not have a translation for the current language. This is suitable for daily maintenance after adding plugins, fields, or menus.
For built-in entries, if a translation already exists in the target language's system or plugin language pack, it is treated as already translated even if no corresponding record has been written to the localization translation table, and is not counted in incremental translation.
Select records in the entries table first, then choose selected translation. This is suitable for retranslating a small set of entries or entries that need manual correction.
If no entry is selected, the system prompts you to select records first.
Translate all eligible entries in the current language. This is suitable when generating the first version of a newly enabled language.
:::warning{title=Note} Full translation may overwrite existing translations. Confirm the target language, entry count, and model service before starting. :::
Before creating the task, the system displays a confirmation dialog with:
Full translation and incremental translation also allow choosing the translation scope in the confirmation dialog:
Selected translation only processes records already selected in the table, so it does not show translation scope. It also shows only one general reference translation language configuration, without separating built-in entries from custom entries.
If the number of entries to translate is 0, the system prompts the user and does not create a background task. After confirmation, the system creates a background task. You can view progress in async tasks. When the task completes, translations are written to the corresponding language.
Some entries are short, such as field names, button labels, and statuses. Lina uses existing reference translations when possible to improve consistency.
When a reference is available, Lina uses a prompt with semantics similar to:
Refer to the following translation:
{source_term} is translated as {target_term}
Translate the following text into {target_language}. Output only the translated result without any additional explanation:
{source_text}
Localization translation usually processes many entries in one task. If possible, use a locally deployed translation-specific small model first, because online models often have API rate limits, concurrency limits, or token-per-minute limits. When many entries are translated, rate limiting can make tasks much slower or cause some requests to wait or fail.
If local deployment is not possible, use a translation-specific model rather than a general chat model. Translation models are usually better for short entries, UI text, and batch translation. Lina organizes the employee prompt, reference translations, and text to translate into a prompt sent to the model. Users can adjust Lina's prompt to control translation style and rules.
You can adjust request concurrency according to model capability to better control throughput, response time, and cost.
For a complete practice using a locally deployed translation-specific small model, see Use Lina and local HY-MT1.5-1.8B to translate localization entries.
:::info{title=Tip}
The concurrency of localization translation tasks is controlled by AI_LOCALIZATION_CONCURRENCY. The default is 10, the allowed range is 1 to 20, and values outside the range use the default.
:::
Lina translation tasks run as background async tasks. The task writes translation results entry by entry and updates progress.
If an entry fails to translate, the task records the failure and stops to avoid continuing to write uncontrolled results when model calls, model output, or configuration is abnormal. Common causes include:
Check async task details and server logs for provider, model, target language, failed entry ID, and model call duration.
After AI translation finishes, review before publishing:
Reset system built-in entry translations during synchronization to restore defaults. To contribute default translations for the system and official plugins, see Translation Contribution.