views_plugin_localization_test.inc

Definition of views_plugin_localization_test.

File

tests/views_plugin_localization_test.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_plugin_localization_test.
  5. */
  6. /**
  7. * A stump localisation plugin which has static variables to cache the input.
  8. */
  9. class views_plugin_localization_test extends views_plugin_localization {
  10. /**
  11. * Store the strings which was translated.
  12. */
  13. var $translated_strings;
  14. /**
  15. * Return the string and take sure that the test can find out whether the
  16. * string got translated.
  17. */
  18. function translate_string($string, $keys = array(), $format = '') {
  19. $this->translated_strings[] = $string;
  20. return $string . "-translated";
  21. }
  22. /**
  23. * Store the export strings.
  24. */
  25. function export($source) {
  26. if (!empty($source['value'])) {
  27. $this->export_strings[] = $source['value'];
  28. }
  29. }
  30. /**
  31. * Return the stored strings for the simpletest.
  32. */
  33. function get_export_strings() {
  34. return $this->export_strings;
  35. }
  36. }