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

Write
TranslatePress Content & Tools translatepress/add-language

Add 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.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.