On 03/29/2010 10:36 AM, Niklas Laxström wrote:
On 28 March 2010 23:57, Conrad Irwin conrad.irwin@googlemail.com wrote:
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)
Perhaps language could be inLanguage. I don't really like (html/text/wikitext/htmlentities/htmlblock) because it emphasizes the output format, not what has been done to the string. I reiterate the meanings here so that is easier to give suggestions.
- parse: parsed wikitext
- text: plain text with for working plural and grammar
- escaped: same as previous but already escaped for html output
- plain: the raw message text for special uses, like Special:Allmessages
- parseAsBlock: normal parsing, not going to be used a lot since there
is OutputPage::addWikiMsg
The problem I have with these is that you must internally be "parsing" to get text() and escaped(), both text() and plain() output plain text. And escaped() doesn't make it clear why it is being escaped. The coding conventions mention using verb phrases for functions, so perhaps all my suggestions should be parseToX or getX instead of just X.
That said, providing there's a summary somewhere, the naming of functions doesn't really matter.
Conrad