i18n_node.i18n.inc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @file
  4. * Internationalization (i18n) hooks
  5. */
  6. /**
  7. * Implements hook_i18n_object_info().
  8. */
  9. function i18n_node_i18n_object_info() {
  10. $info['node_type'] = array(
  11. 'title' => t('Node type'),
  12. 'key' => 'type',
  13. 'load callback' => 'node_type_get_type',
  14. 'placeholders' => array(
  15. '%node_type' => 'type',
  16. ),
  17. 'edit path' => 'admin/structure/types/manage/%node_type',
  18. 'translate tab' => 'admin/structure/types/manage/%node_type/translate',
  19. // We can easily list all these objects
  20. 'list callback' => 'node_type_get_types',
  21. // Metadata for string translation
  22. 'string translation' => array(
  23. 'textgroup' => 'node',
  24. 'type' => 'type',
  25. 'properties' => array(
  26. 'name' => t('Name'),
  27. 'title_label' => t('Title label'),
  28. 'description' => t('Description'),
  29. 'help' => t('Help text'),
  30. ),
  31. 'translate path' => 'admin/structure/types/manage/%node_type/translate/%i18n_language',
  32. )
  33. );
  34. return $info;
  35. }
  36. /**
  37. * Implements hook_i18n_string_info()
  38. */
  39. function i18n_node_i18n_string_info() {
  40. $groups['node'] = array(
  41. 'title' => t('Node types'),
  42. 'description' => t('Content type names, descriptions, help texts.'),
  43. //'format' => TRUE, // This group has strings with format (block body)
  44. 'list' => TRUE, // This group can list all strings
  45. );
  46. return $groups;
  47. }