r42943 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42942‎ | r42943 | r42944 >
Date:21:06, 31 October 2008
Author:grondin
Status:old
Tags:
Comment:
*Adding another internationalization messages
*Adding aliases file
*Correcting somes messages in i18n file
Modified paths:
  • /trunk/extensions/RecordAdmin/SpecialRecordAdmin.18n.php (modified) (history)
  • /trunk/extensions/RecordAdmin/SpecialRecordAdmin.alias.php (added) (history)
  • /trunk/extensions/RecordAdmin/SpecialRecordAdmin.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/SpecialRecordAdmin.18n.php
@@ -1,11 +1,15 @@
22 <?php
3 -#Internationalisation message file of Record Admin extension
4 -
 3+/*Internationalisation message file of Record Admin extension
 4+* Created by Bertrand GRONDIN
 5+*
 6+* @addtogroup Extensions
 7+*
 8+*/
59 $messages=array();
610
711 $messages['en'] = array (
812 'recordadmin' => 'Record Administration',
9 - 'recordadmin-desc' => 'A special page for finding and editing record articles using a form',
 13+ 'recordadmin-desc' => 'A special page for finding and editing record pages using a form',
1014 'recordadmin-select' => 'Select the type of record to search for ',
1115 'recordadmin-newsearch' => 'New $1 search',
1216 'recordadmin-newrecord' => 'Select another record type',
@@ -29,12 +33,15 @@
3034 'recordadmin-buttonsave' => 'Save',
3135 'recordadmin-noform' => 'There is no form associated with "$1" records!',
3236 'recordadmin-createlink' => 'click <a href=$1>here</a> to create one',
33 - 'recordadmin-newcreated' => 'New $type created from public form',
 37+ 'recordadmin-newcreated' => 'New $1 created from public form',
 38+ 'recordadmin-summary-typecreated' => 'New $1 created',
 39+ 'recordadmin-viewlink' => '(<a href="$1">view</a>)',
 40+ 'recordadmin-editlink' => '<a href="$1").">edit</a>',
3441 );
3542
3643 $messages['fr'] = array (
3744 'recordadmin' => 'Gestion des enregistrements',
38 - 'recordadmin-desc' => 'Une page spéciale pour trouver et modifier l’enregistrement des articles par l’utilisation d’un formulaire',
 45+ 'recordadmin-desc' => 'Une page spéciale pour trouver et modifier l’enregistrement des pages par l’utilisation d’un formulaire',
3946 'recordadmin-select' => 'Sélectionner le type d’enregistrement à rechercher pour',
4047 'recordadmin-newsearch' => 'Nouvelle recherche $1',
4148 'recordadmin-newrecord' => 'Sélectionner un autre type d’enregistrement',
@@ -57,4 +64,8 @@
5865 'recordadmin-buttonsave' => 'Sauvegarder',
5966 'recordadmin-noform' => 'Il n’y a aucun formulaire avec l’enregistrement « $1 » !',
6067 'recordadmin-createlink' => 'cliquez <a href=$1>ici</a> pour en créer un',
 68+ 'recordadmin-newcreated' => 'Nouveau $1 créé à partir d’un formulaire public',
 69+ 'recordadmin-summary-typecreated' => 'Nouveau $1 de créer',
 70+ 'recordadmin-viewlink' => 'voir',
 71+ 'recordadmin-editlink' => 'modifier',
6172 );
Index: trunk/extensions/RecordAdmin/SpecialRecordAdmin.alias.php
@@ -0,0 +1,15 @@
 2+<?php
 3+/**Internationalization aliases for RecordAdmin extension
 4+*
 5+* @addtogroup Extensions
 6+*/
 7+
 8+$aliases = array();
 9+
 10+$aliases['en'] = array(
 11+ RecordAdmin => array(RecordAdmin),
 12+);
 13+
 14+$aliases['fr'] = array(
 15+ RecordAdmin => array(GérerEnregistrement),
 16+);
Property changes on: trunk/extensions/RecordAdmin/SpecialRecordAdmin.alias.php
___________________________________________________________________
Added: svn:eol-style
117 + native
Index: trunk/extensions/RecordAdmin/SpecialRecordAdmin.php
@@ -10,17 +10,18 @@
1111
1212 if (!defined('MEDIAWIKI')) die('Not an entry point.');
1313
14 -define('RECORDADMIN_VERSION','0.2, 2008-10-31');
 14+define('RECORDADMIN_VERSION','0.2.1, 2008-10-31');
1515
1616 $wgRecordAdminCategory = 'Records'; # Category which contains the templates used as records and having corresponding forms
1717 $wgRecordAdminUseNamespaces = false; # Whether record articles should be in a namespace of the same name as their type
1818 $dir = dirname(__FILE__) . '/';
1919 $wgExtensionMessagesFiles['RecordAdmin'] = $dir . 'SpecialRecordAdmin.18n.php';
 20+$wgExtensionAliasesFiles['RecordAdmin'] = $dir . 'SpecialRecordAdmin.alias.php';
2021 $wgExtensionFunctions[] = 'wfSetupRecordAdmin';
2122
2223 $wgExtensionCredits['specialpage'][] = array(
2324 'name' => 'Record administration',
24 - 'author' => '[http://www.organicdesign.co.nz/nad User:Nad]',
 25+ 'author' => '[http://www.organicdesign.co.nz/nad User:Nad], Bertrand GRONDIN',
2526 'description' => 'A special page for finding and editing record articles using a form',
2627 'descriptionmsg' => 'recordadmin-desc',
2728 'url' => 'http://www.organicdesign.co.nz/Extension:SpecialExample',
@@ -39,7 +40,6 @@
4041 var $guid = '';
4142
4243 function __construct() {
43 - wfLoadExtensionMessages ('RecordAdmin');
4444 # Name to use for creating a new record either via RecordAdmin or a public form
4545 # todo: should add a hook here for custom default-naming
4646 $this->guid = strftime('%Y%m%d', time()).'-'.substr(strtoupper(uniqid()), -5);
@@ -59,6 +59,7 @@
6060 */
6161 function execute($param) {
6262 global $wgOut, $wgRequest, $wgRecordAdminCategory, $wgRecordAdminUseNamespaces;
 63+ wfLoadExtensionMessages ('RecordAdmin');
6364 $this->setHeaders();
6465 $type = $wgRequest->getText('wpType') or $type = $param;
6566 $record = $wgRequest->getText('wpRecord');
@@ -124,7 +125,7 @@
125126
126127 # Attempt to create the article
127128 $article = new Article($t);
128 - $summary = "[[Special:RecordAdmin/$type|RecordAdmin]]: New $type created";
 129+ $summary = "[[Special:RecordAdmin/$type|RecordAdmin]]:".wfMsg('recordadmin-summary-typecreated');
129130 $text = '';
130131 foreach ($posted as $k => $v) if ($v) {
131132 if ($this->types[$k] == 'bool') $v = 'yes';
@@ -218,8 +219,8 @@
219220 $t = $r[0];
220221 $k = $r[1];
221222 $stripe = $stripe ? '' : ' class="stripe"';
222 - $table .= "<tr$stripe><td class='col1'>(<a href='".$t->getLocalURL()."'>view</a>)";
223 - $table .= "(<a href='".$title->getLocalURL("wpType=$type&wpRecord=$k")."'>edit</a>)</td>\n";
 223+ $table .= "<tr$stripe><td class='col1'>(<a href='".$t->getLocalURL()."'>".wfMsg('recordadmin-viewlink')."</a>)";
 224+ $table .= "(<a href='".$title->getLocalURL("wpType=$type&wpRecord=$k")."'>".wfMsg('recordadmin-editlink')."</a>)</td>\n";
224225 $table .= "<td class='col2'>$ts</td>\n";
225226 $i = 0;
226227 foreach (array_keys($this->types) as $k) {

Status & tagging log