function lingotek_test_lingotek_config_object_translation_presave in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.0.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.1.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.2.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.3.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.4.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.5.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.6.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.7.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
- 3.8.x tests/modules/lingotek_test/lingotek_test.module \lingotek_test_lingotek_config_object_translation_presave()
Implements hook_lingotek_content_object_translation_presave().
File
- tests/
modules/ lingotek_test/ lingotek_test.module, line 112 - Provides a fake Lingotek API endpoint and other help for testing purposes.
Code
function lingotek_test_lingotek_config_object_translation_presave(array &$data, $config_name) {
if ($config_name === 'lingotek_test_config_object.settings') {
// Replace Gatos with Perros.
$data['lingotek_test_config_object.settings']['property_3'] = str_replace('Gatos', 'Perros', $data['lingotek_test_config_object.settings']['property_3']);
$data['lingotek_test_config_object.settings']['property_5'] = str_replace('Gatos', 'Perros', $data['lingotek_test_config_object.settings']['property_5']);
}
}