Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | List of all members
eZ\Publish\API\Repository\TranslationService Interface Reference

Interface for a translation service. More...

## Public Member Functions
| translate (Translation $translation, $locale)
| Translate. More...
| translateString ($translation, $locale)
| Translate string. More...

## Detailed Description

Interface for a translation service.

Implement this to use translation backends like Symfony2 Translate, gettext or ezcTranslation.

Call the translation method with the current target locale from your templates, for example.

Definition at line 20 of file TranslationService.php.

## Member Function Documentation

## ◆ translate()

eZ\Publish\API\Repository\TranslationService::translate | ( | Translation | $translation,
|  |  | $locale
| ) |  |

Translate.

Translate a Translation value object.

Parameters

  Translation | $translation |
  string | $locale |

Returns
  string

## ◆ translateString()

eZ\Publish\API\Repository\TranslationService::translateString | ( |  | $translation,
|  |  | $locale
| ) |  |

Translate string.

Translate a string. Strings could be useful for the simplest cases. Usually you will always use Translation value objects for this.

Parameters

  string | $translation |
  string | $locale |

Returns
  string

The documentation for this interface was generated from the following file:

- TranslationService.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.