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
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');