Page MenuHomePhabricator

Names given to system messages should follow a single naming covention
Closed, DeclinedPublic

Description

...We have names-with-hyphens, names_with_underscores, nameswithoutanyseparator, and perhaps more! I don't think I should give a reason why having them all in a single format is better.

I know why every single developer would avoid changing current messages to make all of them follow one writing method (except for fixing the code in lots of places, there is the issue of wikis which use texts other than that on the message file, and even fixing Wikimedia wikis will be a big trouble).

However, I don't see a reason why we shouldn't decide a single format to be used for "newly created" messages.

Please advise


Version: unspecified
Severity: enhancement

Details

Reference
bz12131

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:56 PM
bzimport set Reference to bz12131.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

We should probably go with whatever is most prevalent now. I generally use hyphens, they're more readable in the code, but underscores translate to spaces in the UI and so are perhaps more readable there.

I'm glad there is a reply to this one! Anyways, the most prevalent way is to simply put the words next to each other (likethisone) which I don't really like.

Avoid spaces/underscores; where word separators are desired, use the hyphen (-).

Is there a way to anounce this (other than bugzilla and its counterpart mailing list), so developers would know about the standard you suggested here, brion? (I'm also thinking of updating MediaWiki.org)

Dropping a note on wikitech-l maybe?

Thank you Brion; I sent the email.

Now that we have a standard for our newly created messages, we can discuss about generalizing it to already in-use messages too. I suggest we should define the problems and then find the solutions for them.

These are the problems I see in changing the name of previously created system messages to make them use hyphens:

The whole code should be scanned and all instances of calling that message should be updated. This is sometimes more than a simple find and replace, because some message names do not appear in the code obviously, but are called by using some variables (things like wgMsg( $var . "_blah" ); )

Extensions should also be scanned. (Such changes may break some extensions which are not maintained through our subversion system. I'm not sure if this is our problem to fix those independent extensiosn too.)

Some local wikis use MediaWiki namespace to define other translations for the messages. A typical example is the delete reason dropdown list, which is usually changed on local wikis.

Before proceding to solutions for the above, are there any other difficulties which I've missed?

Don't get angry but Bug 12362 is a similar problem.

Why to get angry? The problems are more "related" rather than "similar" I think. They don't depend on each other or duplicated each other, so they can be discussed separately on different bugs.

The rules and guidelines for naming should be written down, and somewhat forced for new messages. Renaming existing messages causes more harm than good if done on large scale.

Per previous comments, not making large global changes to get everything consistent. Guidelines are at [[mw:Localisation#Adding_new_messages]] which I just reviewed and updated a bit. We are planning to start paying more attention to following these guidelines in the localisation team, and we will be more picky during code review.

WONTFIX is the most appropriate solution, even though it doesn't look all that friendly :).