Hi,
While reading a bug pointed by the i18n triage https://bugzilla.wikimedia.org/show_bug.cgi?id=16026, Happy-melon says "A more general bug (which might well exist, I didn't check thoroughly) would be "ALL MediaWiki messages should be either plaintext or accept wikimarkup."
So I had the idea of censusing the wfMsg calls in the MW code and try to detect which ones accept wikimarkup or other dialects (it depends of the wfMsg function and of the parameters of that function). So I wrote yesterday a Python script to census the wfMsg calls in one side and the messages in another side. The latter is not very useful in fact but the former gives some interesting results.
I’ve done some statistics about the wfMsg calls on http://www.mediawiki.org/wiki/WfMsg_statistics. There are also the raw data and the link to the script (output to CSV).
If you find it useful I would be happy, but it was also an exercise for extracting and manipulating data.
Seb35
On 18 September 2011 17:38, Seb35 seb35wikipedia@gmail.com wrote:
Hi,
While reading a bug pointed by the i18n triage https://bugzilla.wikimedia.org/show_bug.cgi?id=16026, Happy-melon says "A more general bug (which might well exist, I didn't check thoroughly) would be "ALL MediaWiki messages should be either plaintext or accept wikimarkup."
So I had the idea of censusing the wfMsg calls in the MW code and try to detect which ones accept wikimarkup or other dialects (it depends of the wfMsg function and of the parameters of that function). So I wrote yesterday a Python script to census the wfMsg calls in one side and the messages in another side. The latter is not very useful in fact but the former gives some interesting results.
I’ve done some statistics about the wfMsg calls on http://www.mediawiki.org/wiki/WfMsg_statistics. There are also the raw data and the link to the script (output to CSV).
You should also include ->addWikiMsg ->wrapWikiMsg and perhaps ->addWikiMsgArray since they are the third major group of message functions after wfMsg* and wfMessage.
In the most used messages is 'nbbytes', is that typo from nbytes?
We can see that wfMsgWikiHtml is the first of wfMsg* functions that is nicely getting phased out, just as we want to.
-Niklas
Seb35 wrote:
Hi,
While reading a bug pointed by the i18n triage https://bugzilla.wikimedia.org/show_bug.cgi?id=16026, Happy-melon says "A more general bug (which might well exist, I didn't check thoroughly) would be "ALL MediaWiki messages should be either plaintext or accept wikimarkup."
So I had the idea of censusing the wfMsg calls in the MW code and try to detect which ones accept wikimarkup or other dialects (it depends of the wfMsg function and of the parameters of that function).
*And* where it is used. A wfMsg() function echoed to the screen would accept html (very bad), passed to Html::element, would be plaintext, and passed to the parser in a recursive invocation by a tag extension, would accept wikitext.
I don't think it is feasible to automatically determine which kind of output is accepted by a given message, despite of it being really cool.
(...)
If you find it useful I would be happy, but it was also an exercise for extracting and manipulating data.
Well, it's not completely useless :) and sure it was a practical exercise.
On 18/09/11 16:38, Seb35 wrote: <snip>
So I had the idea of censusing the wfMsg calls in the MW code and try to detect which ones accept wikimarkup or other dialects (it depends of the wfMsg function and of the parameters of that function). So I wrote yesterday a Python script to census the wfMsg calls in one side and the messages in another side.
We probably want to have that python script in /trunk/tools/code-utils/
http://svn.wikimedia.org/viewvc/mediawiki/trunk/tools/code-utils/
Wed, 21 Sep 2011 08:17:31 +0200, Ashar Voultoiz hashar+wmf@free.fr wrote:
On 18/09/11 16:38, Seb35 wrote:
<snip> > So I had the idea of censusing the wfMsg calls in the MW code and try to > detect which ones accept wikimarkup or other dialects (it depends of the > wfMsg function and of the parameters of that function). So I wrote > yesterday a Python script to census the wfMsg calls in one side and the > messages in another side.
We probably want to have that python script in /trunk/tools/code-utils/
http://svn.wikimedia.org/viewvc/mediawiki/trunk/tools/code-utils/
I would be glad if it could go there. I don’t have an svn account so could someone put it there? (I updated author and license in the svn toolserver file.)
Sébastien
Seb35 wrote:
Wed, 21 Sep 2011 08:17:31 +0200, Ashar Voultoizhashar+wmf@free.fr wrote:
On 18/09/11 16:38, Seb35 wrote:
<snip> > So I had the idea of censusing the wfMsg calls in the MW code and try to > detect which ones accept wikimarkup or other dialects (it depends of the > wfMsg function and of the parameters of that function). So I wrote > yesterday a Python script to census the wfMsg calls in one side and the > messages in another side.
We probably want to have that python script in /trunk/tools/code-utils/
http://svn.wikimedia.org/viewvc/mediawiki/trunk/tools/code-utils/
I would be glad if it could go there. I don’t have an svn account so could someone put it there? (I updated author and license in the svn toolserver file.)
Sébastien
I can add it for you, but where does it live?
Thu, 22 Sep 2011 17:35:56 +0200, Platonides platonides@gmail.com wrote:
I can add it for you, but where does it live?
https://svn.toolserver.org/svnroot/seb35/mediawiki/read_wfMsgCalls.py
Thank you!
Sébastien
Seb35 wrote:
Thu, 22 Sep 2011 17:35:56 +0200, Platonidesplatonides@gmail.com wrote:
I can add it for you, but where does it live?
https://svn.toolserver.org/svnroot/seb35/mediawiki/read_wfMsgCalls.py
Thank you!
Sébastien
Sorry, I had missed your mail. I've imported it now. http://svn.wikimedia.org/viewvc/mediawiki/trunk/tools/code-utils/read_wfMsgC...
mediawiki-i18n@lists.wikimedia.org