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/**
12 * CGettextFile is the base class for representing a Gettext message file.
13 *
14 * @author Qiang Xue <qiang.xue@gmail.com>
15 * @package system.i18n.gettext
16 * @since 1.0
17 */
18abstract class CGettextFile extends CComponent
19{
20	/**
21	 * Loads messages from a file.
22	 * @param string $file file path
23	 * @param string $context message context
24	 * @return array message translations (source message => translated message)
25	 */
26	abstract public function load($file,$context);
27	/**
28	 * Saves messages to a file.
29	 * @param string $file file path
30	 * @param array $messages message translations (message id => translated message).
31	 * Note if the message has a context, the message id must be prefixed with
32	 * the context with chr(4) as the separator.
33	 */
34	abstract public function save($file,$messages);
35}
36