Add a translation language is a WordPress ability from TranslatePress — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Add a translation language
WriteAdd a new translation language to TranslatePress, subject to the current license's language limit.
Requires the TranslatePress plugin on WordPress 6.9+ (or the Abilities API feature plugin). All abilities require the current user to have the 'manage_options' capability.
What it does
This ability adds a single translation language to TranslatePress by reusing the plugin's own settings sanitization path (TRP_Settings::sanitize_settings()), so it behaves identically to adding a language through the setup wizard. It validates the supplied language_code against TranslatePress's recognized locale list, rejects languages that are already configured, and enforces the same secondary-language limit used by the UI — free installs get 1 additional language, while a valid Pro license raises the cap via the trp_secondary_languages filter. An optional slug can be supplied for the language's URL path; if omitted, TranslatePress derives one from the language code. On success it returns the newly added code and the full updated list of translation languages.
See it in action
You ask your AI assistant
"Add French (fr_FR) as a new translation language for my TranslatePress site."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| language_code | string | Yes | WordPress locale code (e.g. fr_FR, de_DE). |
| slug | string | No | Optional URL slug. Defaults to the ISO language code if omitted. |
Returns
An object with the added language code and the full array of configured translation language codes after the addition.
Permission
The current user must have the 'manage_options' capability; otherwise the ability returns a 403 WP_Error.
More TranslatePress abilities
Enable Automatic Translation
Turns on TranslatePress's Automatic Translation, optionally selecting which translation engine to use.
List available language codes
Return the full catalog of locale codes TranslatePress recognizes, each with its English name.
List configured languages
Retrieve the languages currently configured in TranslatePress, including which is the default and which are published.
Remove a translation language
Remove a configured translation language from TranslatePress.
Set the default language
Promote an already-configured language to be TranslatePress's site default.
Set TranslatePress license key
Save a TranslatePress license key and trigger a live validation check against TranslatePress's licensing servers.