CGettextFile.php 1017 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * CGettextFile class file.
  4. *
  5. * @author Qiang Xue <qiang.xue@gmail.com>
  6. * @link http://www.yiiframework.com/
  7. * @copyright 2008-2013 Yii Software LLC
  8. * @license http://www.yiiframework.com/license/
  9. */
  10. /**
  11. * CGettextFile is the base class for representing a Gettext message file.
  12. *
  13. * @author Qiang Xue <qiang.xue@gmail.com>
  14. * @package system.i18n.gettext
  15. * @since 1.0
  16. */
  17. abstract class CGettextFile extends CComponent
  18. {
  19. /**
  20. * Loads messages from a file.
  21. * @param string $file file path
  22. * @param string $context message context
  23. * @return array message translations (source message => translated message)
  24. */
  25. abstract public function load($file,$context);
  26. /**
  27. * Saves messages to a file.
  28. * @param string $file file path
  29. * @param array $messages message translations (message id => translated message).
  30. * Note if the message has a context, the message id must be prefixed with
  31. * the context with chr(4) as the separator.
  32. */
  33. abstract public function save($file,$messages);
  34. }