You are here

function hook_lingotek_config_object_document_upload in Lingotek Translation 3.6.x

Same name and namespace in other branches
  1. 8.2 lingotek.api.php \hook_lingotek_config_object_document_upload()
  2. 4.0.x lingotek.api.php \hook_lingotek_config_object_document_upload()
  3. 3.0.x lingotek.api.php \hook_lingotek_config_object_document_upload()
  4. 3.1.x lingotek.api.php \hook_lingotek_config_object_document_upload()
  5. 3.2.x lingotek.api.php \hook_lingotek_config_object_document_upload()
  6. 3.3.x lingotek.api.php \hook_lingotek_config_object_document_upload()
  7. 3.4.x lingotek.api.php \hook_lingotek_config_object_document_upload()
  8. 3.5.x lingotek.api.php \hook_lingotek_config_object_document_upload()
  9. 3.7.x lingotek.api.php \hook_lingotek_config_object_document_upload()
  10. 3.8.x lingotek.api.php \hook_lingotek_config_object_document_upload()

Act on the data extracted from a config object before it is uploaded to Lingotek.

Parameters

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

string $config_name: The simple configuration name.

Related topics

1 function implements hook_lingotek_config_object_document_upload()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

lingotek_test_lingotek_config_object_document_upload in tests/modules/lingotek_test/lingotek_test.module
Implements hook_lingotek_content_object_translation_upload().
1 invocation of hook_lingotek_config_object_document_upload()
LingotekConfigTranslationService::uploadConfig in src/LingotekConfigTranslationService.php
Uploads a document to the Lingotek service.

File

./lingotek.api.php, line 194
Hooks provided by the Lingotek module.

Code

function hook_lingotek_config_object_document_upload(array &$data, $config_name) {

  // Encode all [tokens].
  $yaml = Yaml::encode($data);
  $yaml = preg_replace_callback('/\\[([a-z][^]]+)\\]/', function ($matches) {
    return '[***' . base64_encode($matches[1]) . '***]';
  }, $yaml);
  $data = Yaml::decode($yaml);
}