function i18n_string_multiple in Internationalization 7
Translate / update multiple strings
Parameters
$strings: Array of name => string pairs
3 calls to i18n_string_multiple()
- i18n_string_remove in i18n_string/
i18n_string.module - Remove source and translations for user defined string.
- i18n_string_translation_update in i18n_string/
i18n_string.module - Update / create translation for a certain source.
- i18n_string_update in i18n_string/
i18n_string.module - Update / create translation source for user defined strings.
File
- i18n_string/
i18n_string.module, line 552 - Internationalization (i18n) package - translatable strings.
Code
function i18n_string_multiple($operation, $name, $strings, $options = array()) {
$result = array();
// Strings may be an array of properties, we need to shift it
if ($operation == 'remove') {
$strings = array_flip($strings);
}
foreach ($strings as $key => $string) {
list($textgroup, $context) = i18n_string_context($name, $key);
array_unshift($context, $textgroup);
$result[$key] = call_user_func('i18n_string_' . $operation, $context, $string, $options);
}
return $result;
}