You are here

public function StringDatabaseStorage::createTranslation in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/locale/src/StringDatabaseStorage.php \Drupal\locale\StringDatabaseStorage::createTranslation()

Creates a string translation object bound to this storage but not saved.

Parameters

array $values: (optional) Array with initial values. Defaults to empty array.

Return value

\Drupal\locale\TranslationString New string translation object.

Overrides StringStorageInterface::createTranslation

File

core/modules/locale/src/StringDatabaseStorage.php, line 232

Class

StringDatabaseStorage
Defines a class to store localized strings in the database.

Namespace

Drupal\locale

Code

public function createTranslation($values = []) {
  return new TranslationString($values + [
    'storage' => $this,
    'is_new' => TRUE,
  ]);
}