Overview

Translate Kirby pages, files, and site content from PHP – the same pipeline the Panel uses, exposed as a public API.

Translate Kirby pages, files, and site content from PHP – CLI commands, hooks, custom controllers, batch scripts. The same pipeline the Panel uses, exposed as a public API.

Components

Translator

The entry point. Build one for any model, then copy or translate content with a single method call.

Strategies

Pluggable translation backends. Built-in: DeepL, Copilot AI, callable. Implement Strategy to plug in any service.

Global Helpers

// Build a Translator for any model
$translator = translator($page);

// Translate a single string with the configured strategy
echo translate('Hello', 'de', 'en');

Equivalent without the helpers:

use JohannSchopplich\ContentTranslator\Translator;

$translator = new Translator($page);
echo Translator::translateText('Hello', 'de', 'en');
Continue with the Translator reference for the full method list.