You are here

public function WebformTranslationLingotekManager::configObjectTranslationPresave in Webform 6.x

Implements hook_lingotek_config_object_translation_presave().

Parameters

array &$data: Data returned from the Lingotek service when asking for the translation.

string $config_name: The simple configuration name.

Overrides WebformTranslationLingotekManagerInterface::configObjectTranslationPresave

See also

hook_lingotek_config_object_translation_presave().

File

src/WebformTranslationLingotekManager.php, line 171

Class

WebformTranslationLingotekManager
Defines a class to translate webform Lingotek integration.

Namespace

Drupal\webform

Code

public function configObjectTranslationPresave(array &$data, $config_name) {
  if ($config_name !== 'webform.settings') {
    return;
  }
  $this
    ->decodeTokens($data);
  $data['webform.settings']['test.types'] = Yaml::encode($data['webform.settings']['test.types']);
  $data['webform.settings']['test.names'] = Yaml::encode($data['webform.settings']['test.names']);
}