i18n_test.module 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @file
  4. * Helper module for testing i18n
  5. */
  6. // Add some multilingual variables, override existing ones from settings so
  7. // we have a known list and we don't need any addition to the settings file for testing i18n
  8. _i18n_test_variable_init();
  9. /**
  10. * Implements hook_init()
  11. */
  12. function i18n_test_init() {
  13. // We just implement this hook so this one is loaded always on bootstap
  14. }
  15. /**
  16. * Set default multilingual variables and add any others defined by testing scripts
  17. *
  18. * More variables can be added using 'i18n_variables_test';
  19. */
  20. function _i18n_test_variable_init() {
  21. global $conf;
  22. $conf['i18n_variables'] = array_merge(array('site_name', 'site_frontpage'), variable_get('i18n_variables_test', array()));
  23. }
  24. /**
  25. * Implements hook_i18n_string_info()
  26. */
  27. function i18n_test_i18n_string_info() {
  28. $groups['test'] = array(
  29. 'title' => t('Test'),
  30. 'description' => t('Translatable menu items: title and description.'),
  31. 'format' => FALSE, // This group doesn't have strings with format
  32. 'refresh callback' => 'i18n_test_i18n_string_refresh',
  33. );
  34. return $groups;
  35. }
  36. /**
  37. * Locale refresh
  38. */
  39. function i18n_test_i18n_string_refresh() {
  40. return TRUE;
  41. }