Hello,
How can I drive these Language.php changes into my Wiki (running 1.4.0)?
I'm trying to encourage users to follow a certain format for the account-name creation (among other things), and these are the steps I'm taking thus far to do that.
-Matt
------- Language.php ------- 528c528 < 'loginprompt' => "You must have cookies enabled to log in to {{SITENAME}}.", ---
'loginprompt' => "You must have cookies enabled to log in to
{{SITENAME}}. Please follow the recommendations for account-name format found at [[Create_your_own_account]].", 615c615,616 < 'whitelistedittext' => 'You have to [[Special:Userlogin|login]] to edit pages.', ---
#'whitelistedittext' => 'You have to [[Special:Userlogin|login]] to edit
pages.',
'whitelistedittext' => 'You have to [[Create_your_own_account]] and/or
login to edit pages.', root@biz2tek 6:15pm [...mediawiki-1.4.0/languages] 31>
I forgot to mention:
At 4/19/2005 06:17 PM, Matthew England wrote:
Hello,
How can I drive these Language.php changes into my Wiki (running 1.4.0)?
These are not showing up immediate in my Wiki like the rest of the LocalSettings/DefaultSettings.php changes I've made. (I tried an Apache reload, too, and that didn't do anything...not that I expected it to.) Maybe this stuff is loaded in at database-initialization time? If so, what are my options?
Otherwise...I'm wondering how I might try to get this mission accomplished.
-Matt
I'm trying to encourage users to follow a certain format for the account-name creation (among other things), and these are the steps I'm taking thus far to do that.
-Matt
------- Language.php ------- 528c528 < 'loginprompt' => "You must have cookies enabled to log in to {{SITENAME}}.",
'loginprompt' => "You must have cookies enabled to log in to
{{SITENAME}}. Please follow the recommendations for account-name format found at [[Create_your_own_account]].", 615c615,616 < 'whitelistedittext' => 'You have to [[Special:Userlogin|login]] to edit pages.',
#'whitelistedittext' => 'You have to [[Special:Userlogin|login]] to
edit pages.',
'whitelistedittext' => 'You have to [[Create_your_own_account]] and/or
login to edit pages.', root@biz2tek 6:15pm [...mediawiki-1.4.0/languages] 31>
How can I drive these Language.php changes into my Wiki (running 1.4.0)?
There's a script you can run, maintenance/rebuildMessages.php or the like. But the best way would be to go and find the message you want to change on the Special:AllMessages page, then follow the link and change it there in the wiki database as is.
When you install MediaWiki, it copies the default Language.php settings into the database and ignores that Language.php file afterwards (except in 1.4.x there is an switch in DefaultSettings.php that tells it to just use the file and not the database).
Make sure you're adding settings to LocalSettings.php and not changing the DefaultSettings.php file. :)
Hínandil
Ok, I'm getting a lot of helpful input on how to do this (including the email below and some private emails not shown), but it's a bit piecemeal and not comprehensive.
While I'm trying to figure these things out from these various inputs, I wonder:
Is there a bona fide procedure somewhere in a wiki page, manual, handbook, etc that speaks to this?
-Matt
At 4/19/2005 06:30 PM, Hínandil wrote:
How can I drive these Language.php changes into my Wiki (running 1.4.0)?
There's a script you can run, maintenance/rebuildMessages.php or the like. But the best way would be to go and find the message you want to change on the Special:AllMessages page, then follow the link and change it there in the wiki database as is.
When you install MediaWiki, it copies the default Language.php settings into the database and ignores that Language.php file afterwards (except in 1.4.x there is an switch in DefaultSettings.php that tells it to just use the file and not the database).
Make sure you're adding settings to LocalSettings.php and not changing the DefaultSettings.php file. :)
Hínandil
On 4/20/05, Matthew England mengland@mengland.net wrote:
Ok, I'm getting a lot of helpful input on how to do this (including the email below and some private emails not shown), but it's a bit piecemeal and not comprehensive.
I don't know how to make it any more comprehensive. * the interface is translated and customised through named messages * each language has a file called LanguageXX.php containing the _initial_ values of these messages * on install, the appropriate language's messages are copied into the database, as pages on the wiki called MediaWiki:<messagename> * once copied, the messages can be editted in the same way as any other wiki page, as long as you are logged in with an account that has "sysop" privileges * changing the php files won't have any effect, because the software will look in the database instead * to help you find the right messages to change, you can go to the page Special:Allmessages (linked on the "Special pages" page as "All system messages") which displays the default and current versions of each message
There are other situations, and other ways of doing things, but if you just want to customise your interface, it really is a 4-step process: 1) make sure you're logged in, with "sysop" priveleges 2) visit path/to/your/wiki/Special:Allmessages 3) find the message you want to customise, and follow the link to the page for that message 4) edit that page
Is there a bona fide procedure somewhere in a wiki page, manual, handbook, etc that speaks to this?
http://meta.wikimedia.org/wiki/Help:Contents is the "official" help, but it's kind of rather bitty and "unfinished" in itself at the moment. http://meta.wikimedia.org/wiki/MediaWiki_localization covers the basics of this question.
On 4/20/05, Rowan Collins rowan.collins@gmail.com wrote:
- to help you find the right messages to change, you can go to the
page Special:Allmessages (linked on the "Special pages" page as "All system messages") which displays the default and current versions of each message
IMHO, a way to quickly find which opages have a non-default content would be very useful.
Juanma Barranquero wrote:
IMHO, a way to quickly find which opages have a non-default content would be very useful.
That's very easy. The ones which have been modified will be listed with a pink background in Special:Allmessages, making them very easy to find by skimming down the page.
Hínandil
On Apr 20, 2005, at 1:27pm, Hínandil wrote:
IMHO, a way to quickly find which opages have a non-default content would be very useful.
That's very easy. The ones which have been modified will be listed with a pink background in Special:Allmessages, making them very easy to find by skimming down the page.
I think perhaps he was suggesting a Special:Custommessages, to make it easier to find them and not have to worry about skipping by some with an accidental, double "page down". (I wonder how visible a pink background is to someone who is red colorblind?)
Given that the number of messages likely to be customized is relatively small and (probably) a relatively constant set (per wiki), and that the total number of messages is quite large, it would be nice to have an easy way to work with just the ones you have modified from the defaults.
John Blumel
On 4/20/05, John Blumel johnblumel@earthlink.net wrote:
(I wonder how visible a pink background is to someone who is red colorblind?)
Viewing a screencap in mono shows how it would look for worst-case colour perception (i.e. none at all). For special:allmessages, the difference in brightness is perceptable, but only just. I think the blue backgrounds should just be white, and the pink darkened a bit.
There's no clue at all for those using text browsers or screenreaders.
John Blumel (johnblumel@earthlink.net) [050421 04:00]:
On Apr 20, 2005, at 1:27pm, Hínandil wrote:
IMHO, a way to quickly find which opages have a non-default content would be very useful.
That's very easy. The ones which have been modified will be listed with a pink background in Special:Allmessages, making them very easy to find by skimming down the page.
I think perhaps he was suggesting a Special:Custommessages, to make it easier to find them and not have to worry about skipping by some with an accidental, double "page down". (I wonder how visible a pink background is to someone who is red colorblind?) Given that the number of messages likely to be customized is relatively small and (probably) a relatively constant set (per wiki), and that the total number of messages is quite large, it would be nice to have an easy way to work with just the ones you have modified from the defaults.
Mmm, yes. This is one of the things that I really, really like about FreeBSD: *every* startup setting is in /etc/defaults/rc.conf, and you never touch that, but everything you've changed is in /etc/rc.conf. It saves a tremendous amount of fiddling with obscure files in /etc. Would the same approach be useful in MediaWiki?
- d.
On 4/20/05, David Gerard fun@thingy.apana.org.au wrote:
Mmm, yes. This is one of the things that I really, really like about FreeBSD: *every* startup setting is in /etc/defaults/rc.conf, and you never touch that, but everything you've changed is in /etc/rc.conf. It saves a tremendous amount of fiddling with obscure files in /etc. Would the same approach be useful in MediaWiki?
Well, y'know, that's kind of how DefaultSettings.php and LocalSettings.php work - all the options are there in Default*, and you copy them to change in Local*.
Whether this could be done for the interface messages is kind of a different question - as long as having them in the database seems desirable, it would be wasteful to have to check the database, find nothing there, and then fill in from a default, every time a message needed retrieving. And having them in the database, editable in the wiki-way, does seem like a Good Thing in general.
But really, it's just a matter of presentation; if there were a "Special:CustomisedMessages" page which only showed what you'd changed, it could indeed complement Special:Allmessages, which shows the defaults, but also highlights how you've changed them.
On 20 Apr 2005, at 14:40, Rowan Collins wrote:
Whether this could be done for the interface messages is kind of a different question - as long as having them in the database seems desirable, it would be wasteful to have to check the database, find nothing there, and then fill in from a default, every time a message needed retrieving. And having them in the database, editable in the wiki-way, does seem like a Good Thing in general.
But really, it's just a matter of presentation; if there were a "Special:CustomisedMessages" page which only showed what you'd changed, it could indeed complement Special:Allmessages, which shows the defaults, but also highlights how you've changed them.
This doesn't seem difficult, from a schema point of view. All you need is a timestamp at which the language was loaded into the DB, and add a WHERE clause to restrict it to greater than that timestamp.
I haven't looked at SpecialAllmessages.php, but it would seem it could be parameterized right in there. Not sure where the "language files loaded" timestamp should go. It could probably even be file metadata for when /config was last touched -- but that raises all sorts of complications.
:::: Given an infinite source of energy, population growth still produces an inescapable problem. The problem of the acquisition of energy is replaced by the problem of its dissipation. -- Garrett Hardin :::: Jan Steinman http://www.Bytesmiths.com/Van
On 4/20/05, Jan Steinman Jan@bytesmiths.com wrote:
This doesn't seem difficult, from a schema point of view. All you need is a timestamp at which the language was loaded into the DB, and add a WHERE clause to restrict it to greater than that timestamp.
You're missing a crucial fact here - the Special:Allmessages code is *already* capable of making this distinction; it displays them with different background colours, but presumably it could also just hide one sort or the other. OK, so it's not a very "nice" way of doing it (it would require loading all the messages and then ignoring some) but it would involve changing very little code, and of course be no more load-ful than the existing page.
On Apr 20, 2005, at 6:11pm, Rowan Collins wrote:
This doesn't seem difficult, from a schema point of view. All you need is a timestamp at which the language was loaded into the DB, and add a WHERE clause to restrict it to greater than that timestamp.
You're missing a crucial fact here - the Special:Allmessages code is *already* capable of making this distinction; it displays them with different background colours, but presumably it could also just hide one sort or the other.
Yes, I think adding something like Rowan's JavaScript as show and hide options (similar to the HTML and PHP options currently there) would be a reasonable solution.
John Blumel
On 4/20/05, John Blumel johnblumel@earthlink.net wrote:
I think perhaps he was suggesting a Special:Custommessages, to make it easier to find them and not have to worry about skipping by some with an accidental, double "page down".
Yes, something like that. I have perhaps a dozen customized messages; it's easy to skip one by accident (and more so because light colors are not very visible on my current monitor).
On 4/20/05, Juanma Barranquero lekktu@gmail.com wrote:
IMHO, a way to quickly find which opages have a non-default content would be very useful.
As others have pointed out, they have a pink background. However, to make it even easier, I've written my very first (and consequently painfully hacked together) JavaScript bookmarklet, which should hide every row that's not pink. Just make a bookmark with this (should all be one line) as its target, and click it when you're on the Special:Allmessages page. (Tested on Mozilla only)
javascript:(function(){var foo=document.getElementsByTagName('tr'); for(i=0;i<foo.length;i++) {if(foo[i].bgColor!='#ffe2e2') {foo[i].parentNode.removeChild(foo[i]); i--;} };})();
Enjoy!
On Apr 20, 2005, at 2:24pm, Rowan Collins wrote:
As others have pointed out, they have a pink background. However, to make it even easier, I've written my very first (and consequently painfully hacked together) JavaScript bookmarklet, which should hide every row that's not pink. Just make a bookmark with this (should all be one line) as its target, and click it when you're on the Special:Allmessages page. (Tested on Mozilla only)
Well, that seems to work quite well on Firefox.
However, it's caused me to notice that non-standard messages don't show up under Special:Allmessages. For example, I've added to my LS file,
$wgNavigationLinks = array ( array( 'text'=>'mainpage', 'href'=>'mainpage' ), array( 'text'=>'portal', 'href'=>'portal-url' ), array( 'text'=>'currentevents', 'href'=>'currentevents-url' ), array( 'text'=>'recentchanges', 'href'=>'recentchanges-url' ), array( 'text'=>'randompage', 'href'=>'randompage-url' ), array( 'text'=>'help', 'href'=>'helppage' ), array( 'text'=>'sitesupport', 'href'=>'sitesupport-url' ), array( 'text'=>'sandbox', 'href'=>'sandbox-url' ), );
and set MediaWiki:Sandbox = Sandbox and MediaWiki:Sandbox-url = Project:Sandbox but neither of these messages show up on Special:Allmessages (MW v1.4.0). Apparently, it only shows those with Language.php entries.
John Blumel
On 4/20/05, Rowan Collins rowan.collins@gmail.com wrote:
As others have pointed out, they have a pink background. However, to make it even easier, I've written my very first (and consequently painfully hacked together) JavaScript bookmarklet, which should hide every row that's not pink.
Thanks, it works OK with Firefox.
Still, the hide/show idea that others have suggested seems like a nice addition for 1.4.2 or 1.5.0.
On 20 Apr 2005, at 08:57, Rowan Collins wrote:
- visit path/to/your/wiki/Special:Allmessages
Hey, cool! I've been crawling through MediaWiki:Thisandthat to get at these messages!
On a related note, is there a simple way to sort Special:Specialpages? I tried putting "sort($wgExtensionFunctions)" in LocalSettings.php, but that didn't seem to have any affect.
Is there a bona fide procedure somewhere in a wiki page, manual, handbook, etc that speaks to this?
http://meta.wikimedia.org/wiki/Help:Contents is the "official" help, but it's kind of rather bitty and "unfinished" in itself at the moment.
Of course, since it's a wiki, anyone who writes up a "bona fide procedure" is welcome to make it available to all... :-)
:::: The light at the end of the tunnel is a man with a flashlight yelling, "Go back! Go back!" -- Sol Stein :::: Jan Steinman http://www.Bytesmiths.com/Van
On 4/20/05, Matthew England mengland@mengland.net wrote:
How can I drive these Language.php changes into my Wiki (running 1.4.0)?
These are not showing up immediate in my Wiki like the rest of the LocalSettings/DefaultSettings.php changes I've made. (I tried an Apache reload, too, and that didn't do anything...not that I expected it to.) Maybe this stuff is loaded in at database-initialization time? If so, what are my options?
You've hit the nail on the head there. In order to make things *easier* to customise, all the interface strings are loaded into pages in the wiki at install time, so that anyone with sysop rights can edit them through the wiki itself. See http://meta.wikimedia.org/wiki/Help:MediaWiki_namespace
Basically, just add "MediaWiki:" to the name of the string you're trying to edit, and edit that page on your wiki - so, you need to edit the pages MediaWiki:Loginprompt and MediaWiki:Whitelistedittext Don't forget to do a hard-refresh if you think things aren't updating properly.
The best idea is to pretend that the LanguageXX.php files don't exist, and just use Special:Allmessages to find the string you want.
Quoting Rowan Collins, from the post of Wed, 20 Apr:
The best idea is to pretend that the LanguageXX.php files don't exist, and just use Special:Allmessages to find the string you want.
ok, and how about dumping back the translations on my site to a Lang file so I can upload it as a patch to the CVS? is there an automated way to do that please?
On 01/05/05, Ira Abramov lists-MediaWiki-l@ira.abramov.org wrote:
ok, and how about dumping back the translations on my site to a Lang file so I can upload it as a patch to the CVS? is there an automated way to do that please?
Yes - there's a link on the Special:Allmessages page labelled PHP, which takes you to ...?title=Special:Allmessages&ot=php That should produce the PHP code for the great big associative array with all the messages in.
mediawiki-l@lists.wikimedia.org