views_plugin_localization_test.inc 920 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. public $translated_strings;
  14. /**
  15. * Return the string and take sure that the test can find out whether the
  16. * string got translated.
  17. */
  18. public 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. public 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. public function get_export_strings() {
  34. return $this->export_strings;
  35. }
  36. }