php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容

源代码在线查看: class.messageformatter.html

软件大小: 3633 K
上传用户: fengkuangyidao
关键词: php PHP 文档 实际应用
下载地址: 免注册下载 普通下载 VIP

相关代码

												 				  The MessageFormatter class				  				 				 				 Normalizer::normalize				 MessageFormatter::create				 intl				 PHP Manual								 The MessageFormatter class				 								 								  				  				   Introduction				   				    MessageFormatter is a concrete class that enables users to produce				    concatenated, language-neutral messages. The methods supplied in this				    class are used to build all the messages that are seen by end users.				   				   				    The MessageFormatter class assembles messages from various fragments (such				    as text fragments, numbers, and dates) supplied by the program. Because of				    the MessageFormatter class, the program does not need to know the order of				    the fragments. The class uses the formatting specifications for the				    fragments to assemble them into a message that is contained in a single				    string within a resource bundle. For example, MessageFormatter enables you				    to print the phrase "Finished printing x out of y files..." in a manner				    that still allows for flexibility in translation.				   				   				    Previously, an end user message was created as a sentence and handled as a				    string. This procedure created problems for localizers because the				    sentence structure, word order, number format and so on are very different				    from language to language. The language-neutral way to create messages				    keeps each part of the message separate and provides keys to the data.				    Using these keys, the MessageFormatter class can concatenate the parts of				    the message, localize them, and display a well-formed string to the end				    user.				   				   				    MessageFormatter takes a set of objects, formats them, and then inserts				    the formatted strings into the pattern at the appropriate places. Choice				    formats can be used in conjunction with MessageFormatter to handle				    plurals, match numbers, and select from an array of items. Typically, the				    message format will come from resources and the arguments will be				    dynamically set at runtime.				   				  				  								  				   Class synopsis								   				   				    				     MessageFormatter				    								    				    				     				      MessageFormatter				     				     {				    								    /* Methods */				    				    MessageFormatter::__construct				    ( string $locale				   , string $pattern				   )								    				   MessageFormatter				    MessageFormatter::create				    ( string $locale				   , string $pattern				   )								   static				   string				    MessageFormatter::formatMessage				    ( string $locale				   , string $pattern				   , array $args				   )								   string				    MessageFormatter::format				    ( array $args				   )								   integer				    MessageFormatter::getErrorCode				    ( void				   )								   string				    MessageFormatter::getErrorMessage				    ( void				   )								   string				    MessageFormatter::getLocale				    ( void				   )								   string				    MessageFormatter::getPattern				    ( void				   )								   static				   array				    MessageFormatter::parseMessage				    ( string $locale				   , string $value				   )								   array				    MessageFormatter::parse				    ( string $value				   )								   boolean				    MessageFormatter::setPattern				    ( string $pattern				   )								   }				   								  								  				   See Also				   				    				     				      » 				       ICU formatting documentation				      				     				     				      » 				       ICU message formatting description				      				     				     				      » ICU message formatters				     				     				      » ICU choice formatters				     				    				   				  				 								 																																																																																																																																																																																																																Table of ContentsMessageFormatter::create 鈥			

相关资源