ParserInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Translate\Inline;
  7. /**
  8. * Processes the content with the inline translation replacement so the inline translate JavaScript code will work.
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface ParserInterface
  14. {
  15. /**
  16. * Regular Expression for detected and replace translate
  17. */
  18. const REGEXP_TOKEN = '\{\{\{(.*?)\}\}\{\{(.*?)\}\}\{\{(.*?)\}\}\{\{(.*?)\}\}\}';
  19. /**
  20. * Parse and save edited translation
  21. *
  22. * @param array $translateParams
  23. * @return $this
  24. */
  25. public function processAjaxPost(array $translateParams);
  26. /**
  27. * Replace html body with translation wrapping.
  28. *
  29. * @param string $body
  30. * @return string
  31. */
  32. public function processResponseBodyString($body);
  33. /**
  34. * Returns the body content that is being parsed.
  35. *
  36. * @return string
  37. */
  38. public function getContent();
  39. /**
  40. * Sets the body content that is being parsed passed upon the passed in string.
  41. *
  42. * @param string $content
  43. * @return void
  44. */
  45. public function setContent($content);
  46. /**
  47. * Set flag about parsed content is Json
  48. *
  49. * @param bool $flag
  50. * @return $this
  51. */
  52. public function setIsJson($flag);
  53. }