diff --git a/framework/yii/console/controllers/MessageController.php b/framework/yii/console/controllers/MessageController.php index 418062a..715fb5c 100644 --- a/framework/yii/console/controllers/MessageController.php +++ b/framework/yii/console/controllers/MessageController.php @@ -115,6 +115,13 @@ class MessageController extends Controller } } + /** + * Extracts messages from a file + * + * @param string $fileName name of the file to extract messages from + * @param string $translator name of the function used to translate messages + * @return array + */ protected function extractMessages($fileName, $translator) { echo "Extracting messages from $fileName...\n"; @@ -135,6 +142,15 @@ class MessageController extends Controller return $messages; } + /** + * Writes messages into file + * + * @param array $messages + * @param string $fileName name of the file to write to + * @param boolean $overwrite if existing file should be overwritten without backup + * @param boolean $removeOld if obsolete translations should be removed + * @param boolean $sort if translations should be sorted + */ protected function generateMessageFile($messages, $fileName, $overwrite, $removeOld, $sort) { echo "Saving messages to $fileName..."; diff --git a/framework/yii/helpers/base/HtmlPurifier.php b/framework/yii/helpers/base/HtmlPurifier.php index 70fb6bd..799dabf 100644 --- a/framework/yii/helpers/base/HtmlPurifier.php +++ b/framework/yii/helpers/base/HtmlPurifier.php @@ -16,6 +16,13 @@ namespace yii\helpers\base; */ class HtmlPurifier { + /** + * Passes markup through HTMLPurifier making it safe to output to end user + * + * @param string $content + * @param array|null $config + * @return string + */ public static function process($content, $config = null) { $purifier=\HTMLPurifier::instance($config); diff --git a/framework/yii/helpers/base/Markdown.php b/framework/yii/helpers/base/Markdown.php index 2e14da5..3e69015 100644 --- a/framework/yii/helpers/base/Markdown.php +++ b/framework/yii/helpers/base/Markdown.php @@ -37,6 +37,13 @@ class Markdown */ protected static $markdown; + /** + * Converts markdown into HTML + * + * @param string $content + * @param array $config + * @return string + */ public static function process($content, $config = array()) { if (static::$markdown === null) { diff --git a/framework/yii/i18n/GettextMessageSource.php b/framework/yii/i18n/GettextMessageSource.php index 0eb7cb3..5e29487 100644 --- a/framework/yii/i18n/GettextMessageSource.php +++ b/framework/yii/i18n/GettextMessageSource.php @@ -31,6 +31,15 @@ class GettextMessageSource extends MessageSource */ public $useBigEndian = false; + /** + * Loads the message translation for the specified language and category. + * Child classes should override this method to return the message translations of + * the specified language and category. + * @param string $category the message category + * @param string $language the target language + * @return array the loaded messages. The keys are original messages, and the values + * are translated messages. + */ protected function loadMessages($category, $language) { $messageFile = Yii::getAlias($this->basePath) . '/' . $language . '/' . $this->catalog;