Three languages and automatic translation
Three languages and automatic translation
UzDef CMS supports Russian, Uzbek, and English. A translation is stored separately and never changes the original. If no translation exists, visitors see the original text.
Translate a page with Google
Use the RU / UZ / EN switch in the header. If the open post, page, or item has no saved version in the selected language, Google automatically translates it in the browser. There is no separate list of Google languages: only the three languages supported by UzDef are used. This translation is not saved in the CMS. JavaScript and access to Google’s service are required; widget availability depends on Google.
Translate and save content in UzDef
This is an optional feature of the API translation plugin. It is disabled by default so requests are not sent to paid APIs without the administrator’s consent. The administrator can enable it under Translator, configure a provider, and add an API key. Visitors can then click “Translate this page now” in the missing-translation notice. UzDef stores the machine translation as a separate version.
To translate content automatically the first time it is opened, enable Translator → Translate on first view. Use bulk translation in the same section to prepare many items at once.
Choose a provider
To enable translations saved in the CMS, open Translator in the admin panel, enable the API plugin, and choose a provider:
- Google Cloud Translation — configure Cloud Translation Basic and enter an API key. Instructions are below. Under the current pricing, the first 500,000 characters per month are free; additional use may be billed. Google pricing.
- Yandex Translate — create an API key for a service account with translation permission. Instructions are below. The service charges based on the number of characters. Yandex pricing.
- Anthropic or an OpenAI-compatible service — translates using your instructions and glossary; a paid API key is usually required.
Keys are stored on the server only. Set a monthly character limit for Google and Yandex; the initial value is 100,000 characters per provider. The CMS limit caps the amount sent, but does not replace spending limits and settings in the provider account. Test connection performs a sample translation.
Get a Google Cloud Translation key
- Open the Google Cloud Console and create a project or select an existing one.
- Link a billing account to the project. Google requires billing to be enabled for Cloud Translation, even if your usage stays within the free allowance.
- Find and enable Cloud Translation API in the API Library. The CMS uses the Basic (v2) edition.
- Open APIs & Services → Credentials, click Create credentials → API key.
- Open the new key’s settings. Under API restrictions, select only Cloud Translation API and save. This prevents the key from being used with other Google APIs.
- Copy the key and paste it into UzDef under Translator → Google Cloud Translation → API key. Save the settings and click Test connection.
Details: set up Cloud Translation · create and restrict API keys.
Get a Yandex Translate key
- Open the Yandex Cloud console and select a cloud and folder. Make sure a billing account is linked to the cloud.
- In the folder, open Identity and Access Management → Service accounts and create or select a service account.
- Grant that account the
ai.translate.userrole on the required folder. - Open the service account page and choose Create new key → Create API key. If the console asks for a scope, select
yc.ai.translate.execute. Create the key and copy its secret immediately; it cannot be displayed again later. - In UzDef, select Translator → Yandex Translate, enter the key, and save. The folder ID can usually be left blank for a service-account key. If the connection test requests it, copy the folder ID from the Yandex Cloud console and enter it there.
- Click Test connection.
Details: create a service-account API key · translation role · API key authentication.
Get an Anthropic or OpenAI key
Anthropic (Claude)
- Sign in to or register at the Claude Console.
- Open API keys, click Create key, and set a name and expiration date.
- Copy the secret as soon as it is created; it is shown in full only once. Configure billing in the Claude Console to use the API. A Claude chat subscription does not provide API access.
- In UzDef, select Translator → Anthropic, enter the key, save the settings, and test the connection.
Details: official Claude API key guide.
OpenAI
- Sign in to the OpenAI API Platform and select the project the CMS will use.
- Open API keys and create a new secret key for the project.
- Copy the key immediately. Make sure API billing is configured for the project and that it can use the required models.
- In UzDef, select Translator → OpenAI, enter the key, save the settings, and test the connection.
Details: find your OpenAI API key · manage API Platform projects.
For an OpenAI-compatible service, create the key in that service’s account. Enter its compatible API address in Base URL and specify a supported model.
The API translator code and its plugin.json description are in content/plugins/paid-translator/. You can enable it or download it as a ZIP from Plugins. Its settings and API key stay in content/ai_settings.json on the site server and are not included in the ZIP.
Do not send an API key in chat or publish it on the site. Enter it only in UzDef settings; it will be hidden after saving.
Translation options
- In the content form — click the translation button for the required language, review the result, and save it.
- Bulk — under Translator, translate items without a completed language version, as well as the site name, menu, and categories.
- Automatically — enable translation when content is saved.
- On view — enable translation the first time an item is opened in another language. This uses the provider’s quota.
Translations are saved as separate versions and do not overwrite a manual translation without an explicit command. Automatic versions are marked in the admin panel.
Formatting and terminology
During machine translation, links, code fragments, HTML tags, and template variables are protected. The configurable glossary is applied to Anthropic and OpenAI-compatible models; direct Google and Yandex APIs use their own translation systems.
Add common terms to the Glossary field as source term = preferred translation, one per line.