Skip to content

Kirby 5.0.4

$file->translation()

Returns a single translation by language code If no code is specified the current translation is returned

$file->translation(string|null $languageCode = null): Kirby\Content\Translation

Parameters

Name Type Default
$languageCode stringornull null

Return type

Kirby\Content\Translation

This method modifies the existing $file object it is applied to and returns it again.

Exceptions

Type Description
Kirby\Exception\NotFoundException If the language does not exist

Parent class

Kirby\Cms\File inherited from Kirby\Cms\ModelWithContent