Index: trunk/extensions/Asksql/Asksql_body.php |
— | — | @@ -1,22 +1,17 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -if (!defined('MEDIAWIKI')) |
| 4 | +if (!defined('MEDIAWIKI')) { |
5 | 5 | exit; |
| 6 | +} |
6 | 7 | |
| 8 | +/** Load up the internationalization stuff */ |
7 | 9 | global $wgMessageCache; |
| 10 | +require_once( 'Asksql.i18n.php' ); |
| 11 | +foreach( efAsksqlMessages() as $lang => $messages ) { |
| 12 | + $wgMessageCache->addMessages( $messages, $lang ); |
| 13 | +} |
8 | 14 | |
9 | | -$wgMessageCache->addMessage('asksql', 'SQL query'); |
10 | | -$wgMessageCache->addMessage('asksqltext', "Use the form below to make a direct query of the |
11 | | -database. |
12 | | -Use single quotes ('like this') to delimit string literals. |
13 | | -This can often add considerable load to the server, so please use |
14 | | -this function sparingly."); |
15 | | -$wgMessageCache->addMessage('sqlislogged', 'Please note that all queries are logged.'); |
16 | | -$wgMessageCache->addMessage('sqlquery', 'Enter query'); |
17 | | -$wgMessageCache->addMessage('querybtn', 'Submit query'); |
18 | | -$wgMessageCache->addMessage('selectonly', 'Only read-only queries are allowed.'); |
19 | | -$wgMessageCache->addMessage('querysuccessful', 'Query successful'); |
20 | | - |
| 15 | +/** Main class that define a new special page*/ |
21 | 16 | class SpecialAsksql extends SpecialPage { |
22 | 17 | |
23 | 18 | function SpecialAsksql() { |
— | — | @@ -34,7 +29,7 @@ |
35 | 30 | $wgOut->permissionRequired( 'asksql' ); |
36 | 31 | return; |
37 | 32 | } |
38 | | - |
| 33 | + |
39 | 34 | if( $wgRequest->wasPosted() ) { |
40 | 35 | $query = $wgRequest->getVal( 'wpSqlQuery' ); |
41 | 36 | $action = $wgRequest->getVal( 'action' ); |
Index: trunk/extensions/Asksql/Asksql.i18n.php |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Internationalisation file for CountEdits extension |
| 6 | + * |
| 7 | + * @package MediaWiki |
| 8 | + * @subpackage Extensions |
| 9 | + * @author Bertrand Grondin <bertrand.grondin@tiscali.fr> |
| 10 | + */ |
| 11 | + |
| 12 | +function efAsksqlMessages() { |
| 13 | + $messages = array( |
| 14 | + |
| 15 | +/* English (Rob Church) */ |
| 16 | +'en' => array( |
| 17 | + 'asksql' => 'SQL query', |
| 18 | + 'asksqltext' => "Use the form below to make a direct query of the |
| 19 | +database. |
| 20 | +Use single quotes ('like this') to delimit string literals. |
| 21 | +This can often add considerable load to the server, so please use |
| 22 | +this function sparingly.", |
| 23 | + 'sqlislogged' => 'Please note that all queries are logged.', |
| 24 | + 'sqlquery' => 'Enter query', |
| 25 | + 'querybtn' => 'Submit query', |
| 26 | + 'selectonly' => 'Only read-only queries are allowed.', |
| 27 | + 'querysuccessful' => 'Query successful',), |
| 28 | + |
| 29 | +/*French (Bertrand Grondin) */ |
| 30 | +'fr' => array( |
| 31 | + 'asksql' => 'Requête SQL', |
| 32 | + 'asksqltext' => "Utilisez ce formulaire pour faire une requête directe dans la base de donnée. |
| 33 | +Utilisez les apostrophes ('comme ceci') pour les chaînes de caractères. Ceci peut souvent surcharger le serveur. Aussi, utilisez cette fonction avec parcimonie.", |
| 34 | + 'sqlislogged' => 'Notez bien que toutes les requêtes sont journalisées.', |
| 35 | + 'sqlquery' => 'Entrez la requête', |
| 36 | + 'querybtn' => 'Soumettre la requête', |
| 37 | + 'selectonly' => 'Seules, les requêtes en lectures seules sont permises.', |
| 38 | + 'querysuccessful' => 'La requête a été exécutée avec succès.',), |
| 39 | + ); |
| 40 | + |
| 41 | + return $messages; |
| 42 | +} |
| 43 | + |
| 44 | +?> |
Property changes on: trunk/extensions/Asksql/Asksql.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 45 | + native |