Skip to content

Configuration ​

Merge settings under Translate in config/app.php or config/app_local.php. The plugin does not automatically load config/app.example.php; that file lists the available settings and a sample admin gate.

php
'Translate' => [
    'noComments' => true,
    'plurals' => 2,
    'pluralExpression' => 'n != 1',
],
SettingPurpose
adminAccessClosure receiving the current request; literal true admits the caller to Admin controllers. Unset denies access, including in debug mode.
adminBackUrl, adminBackLabelOptional link from the admin header back to your application.
noCommentsOmit references, flags and comments when dumping PO files.
plurals, pluralExpressionGettext plural count and expression written into exported catalogs. These must match the target language.
engineEngine class or ordered list of classes implementing EngineInterface.
defaultLocaleDefault locale used by translation forms.
layoutOverride the backend layout; the built-in layout is Translate.simple.
editorEnable reference editing in the backend where supported.
showCodeReferencestrue shows source links in both interfaces; false hides links; null shows links only in the backend.
onlineRepoUrlSource repository URL prefix used by the reference viewer, such as https://github.com/example/app/blob/main/.
flagsFlag-image format used by the language switcher.
iconMapAdmin icon-name mapping merged into Icon.map.
shadowTableSuffixSuffix used when generating TranslateBehavior shadow tables; defaults to _translations.
localesLocale choices for the TranslateBehavior interface; null enables detection.
disableAuditLogDisable optional AuditStash logging on translation tables.

The schema stores content and plural_2. Languages needing additional plural forms require an application migration adding plural_3 through the number configured in Translate.plurals, up to six. Change the expression alongside the count and verify the generated PO headers.

Optional integrations ​

The plugin does not currently ship a Queue import job. Data provides an optional Languages association when that plugin is loaded. The legacy languagesTable and usersTable example keys are not read by the current plugin. AuditStash records translation changes when installed and enabled. BootstrapUI supplies an alternative form helper when installed; the built-in layout loads its CSS and JavaScript from CDNs. See Layout for local assets and CSP considerations.

The plugin inherits the host application’s AppController. Its admin gate supplements application authentication and callbacks; it does not replace them.

Released under the MIT License.