function hook_i18n_string_objects in Internationalization 7
List objects to collect translatable strings.
A module can provide either a list of translatable strings using hook_i18n_string_list() or it can provide a list of objects using hook_i18n_string_objects() from which the string list will be produced automatically. But not both.
Parameters
$type string: Object type
Return value
$objects array Associative array of objects indexed by object id
See also
i18n_menu_i18n_string_objects()
i18n_string_i18n_string_list()
4 functions implement hook_i18n_string_objects()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- i18n_block_i18n_string_objects in i18n_block/
i18n_block.i18n.inc - Implements hook_i18n_string_objects().
- i18n_menu_i18n_string_objects in i18n_menu/
i18n_menu.i18n.inc - Implements hook_i18n_string_objects()
- i18n_string_i18n_string_objects in i18n_string/
i18n_string.i18n.inc - Implements hook_i18n_string_objects().
- i18n_taxonomy_i18n_string_objects in i18n_taxonomy/
i18n_taxonomy.i18n.inc - Implements hook_i18n_string_objects()
1 invocation of hook_i18n_string_objects()
- i18n_string_object_type_string_list in i18n_string/
i18n_string.i18n.inc - Get object string list that are in this text group.
File
- i18n_string/
i18n_string.api.php, line 113 - API documentation file for String translation module.
Code
function hook_i18n_string_objects($type) {
if ($type == 'menu_link') {
// All menu items that have no language and are customized.
return db_select('menu_links', 'm')
->fields('m')
->condition('language', LANGUAGE_NONE)
->condition('customized', 1)
->execute()
->fetchAllAssoc('mlid', PDO::FETCH_ASSOC);
}
}