On 03/28/2010 05:06 PM, Niklas Laxström wrote:
(2) The primary entry point is Message::key(). The
syntax is little
more verbose than wfMsg*'s, but much more readable imho. Do we want to
use even short wrapper for the entry point? If yes, how should it be
called? For example _() (often used in Gettext projects) and
Msg::key() have been suggested.
The "::key" function seems to just be noise, could the current
"third"
parameter be moved to the front.
Message::parse( 'welcome-to' )->params( $wgSitename );
I suppose it's possible that someone might want to render the same
message with the same parameters in several ways, but I can't think of
many use-cases.
With any code like this I worry that someone might try:
$msg = Message::key( 'example' );
$nicemsg = $msg->params( 'nice' );
$nastymsg = $msg->params( 'nasty' );
echo $nicemsg->text();
echo $nastymsg->text();
Which will break unexpectedly, but perhaps that is livable with.
(3) Anything else with regards to the documentation,
the code or other issues.
The names of the methods are somewhat confusing and it'd be nice if they
were consistent.
(language/inContentLanguage), (parse/text/plain/escaped/parseAsBlock)
perhaps (inLanguage/inContentLanguage) and
(html/text/wikitext/htmlentities/htmlblock)
The current documentation uses {{-transformation a lot, which is hard to
pronounce - is it just parsing, or something else?
* As a side effect interface message status is unconditionally
* turned off.
What does that mean?
Conrad