function tmgmt_ensure_keys_string in Translation Management Tool 7
Converts keys array to string key.
There are three conventions for data keys in use. This function accepts each of it an ensures a sting keys.
Parameters
$key: The key can be either be an array containing the keys of a nested array hierarchy path or a string.
Delimiter to be use in the keys string. Default is ']['.:
Return value
Keys string.
5 calls to tmgmt_ensure_keys_string()
- TMGMTFileformatXLIFF::processForExport in translators/
file/ tmgmt_file.format.xliff.inc - Helper function to process the source text.
- TMGMTFileformatXLIFF::validateImport in translators/
file/ tmgmt_file.format.xliff.inc - Validates that the given file is valid and can be imported.
- TMGMTJobItem::addTranslatedDataRecursive in entity/
tmgmt.entity.job_item.inc - Recursively writes translated data to the data array of a job item.
- TMGMTJobItem::dataItemRevert in entity/
tmgmt.entity.job_item.inc - Reverts data item translation to the latest existing revision.
- TMGMTRemoteController::loadByLocalData in controller/
tmgmt.controller.remote.inc - Loads remote mappings based on local data.
File
- ./
tmgmt.module, line 1392 - Main module file for the Translation Management module.
Code
function tmgmt_ensure_keys_string($key, $delimiter = TMGMT_ARRAY_DELIMITER) {
if (is_array($key)) {
$key = implode($delimiter, $key);
}
return $key;
}