Karima Rafes has uploaded a new change for review. https://gerrit.wikimedia.org/r/71926
Change subject: add prefix linkedwiki- in the i18n files ...................................................................... add prefix linkedwiki- in the i18n files Change-Id: Ib04913a966e5fdbc3b6b1b22189d86f184c15523 --- M LinkedWiki.i18n.php M LinkedWiki.php M specialpages/SpecialSparqlQuery.i18n.php M specialpages/SpecialSparqlQuery.php 4 files changed, 42 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LinkedWiki refs/changes/26/71926/1 diff --git a/LinkedWiki.i18n.php b/LinkedWiki.i18n.php index 750093e..97f9f0b 100644 --- a/LinkedWiki.i18n.php +++ b/LinkedWiki.i18n.php @@ -2,14 +2,14 @@ $messages = array(); $messages['en'] = array( - 'test' => 'test', - 'date' => 'H:i:s m/d/Y', - 'refresh' => 'Refresh', - 'durate' => 'Durate of query', + 'linkedwiki-test' => 'test', + 'linkedwiki-date' => 'H:i:s m/d/Y', + 'linkedwiki-refresh' => 'Refresh', + 'linkedwiki-durate' => 'Durate of query', ); $messages['fr'] = array( - 'test' => 'test', - 'date' => 'H:i:s d/m/Y', - 'refresh' => 'Rafraîchir', - 'durate' => 'Durée du calcul', + 'linkedwiki-test' => 'test', + 'linkedwiki-date' => 'H:i:s d/m/Y', + 'linkedwiki-refresh' => 'Rafraîchir', + 'linkedwiki-durate' => 'Durée du calcul', ); diff --git a/LinkedWiki.php b/LinkedWiki.php index b2725d6..ab505df 100644 --- a/LinkedWiki.php +++ b/LinkedWiki.php @@ -44,6 +44,7 @@ //Classes $wgAutoloadClasses['SpecialSparqlQuery'] = $wgLinkedWikiSpecialPagesPath . '/SpecialSparqlQuery.php'; +$wgAutoloadClasses['SpecialExportCSV'] = $wgLinkedWikiSpecialPagesPath . '/SpecialExportCSV.php'; //Install extension //TODO $wgExtensionMessagesFiles['LinkedWiki'] = dirname( __FILE__ ) . '/LinkedWiki.i18n.php'; @@ -53,6 +54,9 @@ $wgExtensionAliasesFiles['SpecialSparqlQuery'] = $wgLinkedWikiSpecialPagesPath . '/SpecialSparqlQuery.alias.php'; $wgSpecialPages['SpecialSparqlQuery'] = array( 'SpecialSparqlQuery' ); $wgSpecialPageGroups['SpecialSparqlQuery'] = 'media'; + +#$wgSpecialPages['SpecialExportCSV'] = array( 'SpecialExportCSV' ); + //Add PARSER # Define a setup function @@ -292,7 +296,7 @@ if($footer != "NO"){ $str .= "|- style=\"font-size:80%\" align=\"right\"\n"; - $str .= "| colspan=\"".count($TableFormatTemplates )."\"|". efSparqlParserFunction_footer($rs['query_time'])."\n"; + $str .= "| colspan=\"".count($TableFormatTemplates )."\"|". efSparqlParserFunction_footer($rs['query_time'],$querySparqlWiki,$endpoint ,$classHeaders ,$headers)."\n"; } $str .= "|}\n"; @@ -378,7 +382,7 @@ if($footer != "NO"){ $str .= "|- style=\"font-size:80%\" align=\"right\"\n"; - $str .= "| colspan=\"".count($variables)."\"|". efSparqlParserFunction_footer($rs['query_time'])."\n"; + $str .= "| colspan=\"".count($variables)."\"|". efSparqlParserFunction_footer($rs['query_time'],$querySparqlWiki,$endpoint ,$classHeaders,$headers)."\n"; } $str .= "|}\n"; @@ -439,9 +443,12 @@ return array($str, 'noparse' => false, 'isHTML' => false); } -function efSparqlParserFunction_footer($duration){ - $today = date(wfMessage( 'date' )->text()); - return $today ." -- [{{fullurl:{{FULLPAGENAME}}|action=purge}} ".wfMessage( 'refresh' )->text()."] -- ".wfMessage( 'durate' )->text()." :". round($duration, 3) ."s"; +function efSparqlParserFunction_footer($duration,$querySparqlWiki,$endpoint ,$classHeaders = '',$headers = ''){ + $today = date(wfMessage( 'linkedwiki-date' )->text()); + return $today ." -- [{{fullurl:{{FULLPAGENAME}}|action=purge}} ".wfMessage( 'linkedwiki-refresh' )->text()."] -- ". + wfMessage( 'linkedwiki-durate' )->text()." :". + round($duration, 3) ."s"; + //"Version : [{{canonicalurl:Special:Specialexportcsv}}?query={{urlencode:$querySparqlWiki}}&$endpoint={{urlencode:$querySparqlWiki}}&classHeaders={{urlencode:$querySparqlWiki}}&headers={{urlencode:$querySparqlWiki}} CSV] "; } function efSparqlParserFunction_uri2Link($uri,$nowiki = false){ diff --git a/specialpages/SpecialSparqlQuery.i18n.php b/specialpages/SpecialSparqlQuery.i18n.php index 8a215f8..a649176 100644 --- a/specialpages/SpecialSparqlQuery.i18n.php +++ b/specialpages/SpecialSparqlQuery.i18n.php @@ -2,18 +2,18 @@ $messages = array(); $messages['en'] = array( - 'specialsparqlquery' => 'Sparql Endpoint', - 'specialsparqlquery_categorysparqlquery' => 'SPARQL Query', - 'specialsparqlquery_mainpage' => + 'linkedwiki-specialsparqlquery' => 'SPARQL Editor', + 'linkedwiki-specialsparqlquery_categorysparqlquery' => 'SPARQL Query', + 'linkedwiki-specialsparqlquery_mainpage' => "This page will be used to test, optimize and share your queries if you wish. Post your questions to: [http://groups.google.com/group/linkedwiki Group linkedwiki]", // 'specialsparqlquery_error_title_exists_yet' => 'Find another title to save this query !', // 'specialsparqlquery_your_query_saved_here' => 'Page of your query : ', - 'specialsparqlquery_sendquery' => 'Search', - 'specialsparqlquery_usethisquery' => "Howto use this query in this Wiki", - 'specialsparqlquery_usethisquery_tutorial' => "Copy and paste this line in a page of this Wiki. ". + 'linkedwiki-specialsparqlquery_sendquery' => 'Search', + 'linkedwiki-specialsparqlquery_usethisquery' => "Howto use this query in this Wiki", + 'linkedwiki-specialsparqlquery_usethisquery_tutorial' => "Copy and paste this line in a page of this Wiki. ". "See more : [http://www.mediawiki.org/wiki/Extension:LinkedWiki Extension:LinkedWiki]", // 'specialsparqlquery_sharethisquery' => "Share this query", // 'specialsparqlquery_linkxml' => "Copy this link in your code to have the xml", @@ -26,22 +26,22 @@ // 'specialsparqlquery_querySeemore' => "See more", // 'specialsparqlquery_querySeemore_link' => "[[Aide:API]]", -'specialsparqlquery_endpointsparql' => "Endpoint SPARQL", +'linkedwiki-specialsparqlquery_endpointsparql' => "Endpoint SPARQL", ); $messages['fr'] = array( - 'specialsparqlquery' => 'Sparql Endpoint', - 'specialsparqlquery_categorysparqlquery' => 'Requête SPARQL', - 'specialsparqlquery_mainpage' => + 'linkedwiki-specialsparqlquery' => 'Editeur SPARQL', + 'linkedwiki-specialsparqlquery_categorysparqlquery' => 'Requête SPARQL', + 'linkedwiki-specialsparqlquery_mainpage' => "Cette page va vous servir à tester, optimiser et partager vos requêtes si vous le souhaitez. Postez vos questions à : [http://groups.google.com/group/linkedwiki Group linkedwiki]", // 'specialsparqlquery_error_title_exists_yet' => 'Utiliser un autre titre pour sauver cette requête !', // 'specialsparqlquery_your_query_saved_here' => 'Votre requête est sur la page : ', - 'specialsparqlquery_sendquery' => 'Envoyer', - 'specialsparqlquery_usethisquery' => "Utiliser cette requête au sein de ce Wiki", - 'specialsparqlquery_usethisquery_tutorial' => "Pour cela, il vous suffit de copier le ". + 'linkedwiki-specialsparqlquery_sendquery' => 'Envoyer', + 'linkedwiki-specialsparqlquery_usethisquery' => "Utiliser cette requête au sein de ce Wiki", + 'linkedwiki-specialsparqlquery_usethisquery_tutorial' => "Pour cela, il vous suffit de copier le ". "text suivant dans une page du wiki. Pour formater l'affichage, voir : [http://www.mediawiki.org/wiki/Extension:LinkedWiki Extension:LinkedWiki]", // 'specialsparqlquery_sharethisquery' => "Partager votre requête", // 'specialsparqlquery_linkxml' => "Pour obtenir le XML, utilisez ce lien", @@ -54,5 +54,5 @@ // 'specialsparqlquery_querySeemore' => "Pour aller plus loin.", // 'specialsparqlquery_querySeemore_link' => "[[Aide:API]]", -'specialsparqlquery_endpointsparql' => "Point d'accès SPARQL", +'linkedwiki-specialsparqlquery_endpointsparql' => "Point d'accès SPARQL", ); \ No newline at end of file diff --git a/specialpages/SpecialSparqlQuery.php b/specialpages/SpecialSparqlQuery.php index d9e4c1d..d3a7cb8 100644 --- a/specialpages/SpecialSparqlQuery.php +++ b/specialpages/SpecialSparqlQuery.php @@ -27,7 +27,7 @@ class specialsparqlquery extends SpecialPage { public function __construct() { - parent::__construct( 'specialsparqlquery' ); + parent::__construct( 'linkedwiki-specialsparqlquery' ); /** @noinspection PhpUndefinedFunctionInspection */ //wfLoadExtensionMessages('specialsparqlquery'); } @@ -50,22 +50,22 @@ if ( $query != "" && $output == "save" && $titleRequest != "" ) { if($this->pageExists($titleRequest)){ - $wgOut->addHTML("<h2>".wfMessage('specialsparqlquery_error_title_exists_yet')->text()."</h2> \n"); + $wgOut->addHTML("<h2>".wfMessage('linkedwiki-specialsparqlquery_error_title_exists_yet')->text()."</h2> \n"); $wgOut->addHTML(); }else{ $this->savePage($titleRequest, $this->template($query,$description)); - $wgOut->addWikiText(wfMessage('specialsparqlquery_your_query_saved_here')->text()."[[$titleRequest]]"); + $wgOut->addWikiText(wfMessage('linkedwiki-specialsparqlquery_your_query_saved_here')->text()."[[$titleRequest]]"); } } if ( $query == "" || $output == "save" || $output == "wiki" ) { - $wgOut->addWikiText(wfMessage('specialsparqlquery_mainpage')->text()); + $wgOut->addWikiText(wfMessage('linkedwiki-specialsparqlquery_mainpage')->text()); $wgOut->addHTML("<pre>".htmlentities($this->prefix(), ENT_QUOTES, 'UTF-8')."</pre>"); $wgOut->addHTML("<form method='post' name='formQuery'>"); $wgOut->addHTML("<input type='hidden' name='output' value='wiki'>"); $wgOut->addHTML("<input type='hidden' name='prefix' value='".htmlentities($this->prefix(), ENT_QUOTES, 'UTF-8')." '>"); $wgOut->addHTML("<input type='hidden' name='query' >"); - $wgOut->addHTML(wfMessage('specialsparqlquery_endpointsparql')->text()." : <input type='text' name='endpoint' size='50' value='".$endpoint." '>"); + $wgOut->addHTML(wfMessage('linkedwiki-specialsparqlquery_endpointsparql')->text()." : <input type='text' name='endpoint' size='50' value='".$endpoint." '>"); $wgOut->addHTML("<textarea name='queryWithoutPrefix' cols='25' rows='15'>"); $strQuery = $queryWithoutPrefix != "" ? $queryWithoutPrefix : $this->exampleSparql(0) ; $wgOut->addHTML($strQuery); @@ -90,7 +90,7 @@ } //--> </SCRIPT>"); - $wgOut->addHTML("<input type='button' value='".wfMessage('specialsparqlquery_sendquery')->text()."' onClick='validAndSendQuery();' />"); + $wgOut->addHTML("<input type='button' value='".wfMessage('linkedwiki-specialsparqlquery_sendquery')->text()."' onClick='validAndSendQuery();' />"); $wgOut->addHTML("<input type='button' value='(R&D) Validation (js)' onClick='validWithJS();' />"); $wgOut->addHTML(" Xml : <input type='checkbox' name='toXML' />"); $wgOut->addHTML(" </form>"); @@ -124,8 +124,8 @@ $arr = efSparqlParserFunction_simple( $query, $endpoint, '', '', null ); $wgOut->addWikiText($arr[0]); - $wgOut->addWikiText("==".wfMessage('specialsparqlquery_usethisquery')->text()."=="); - $wgOut->addWikiText(wfMessage('specialsparqlquery_usethisquery_tutorial')->text()); + $wgOut->addWikiText("==".wfMessage('linkedwiki-specialsparqlquery_usethisquery')->text()."=="); + $wgOut->addWikiText(wfMessage('linkedwiki-specialsparqlquery_usethisquery_tutorial')->text()); $wgOut->addHTML("<pre>{{#sparql:".htmlentities($query, ENT_QUOTES, 'UTF-8')."\n|endpoint=".htmlentities($endpoint, ENT_QUOTES, 'UTF-8')."}}</pre>"); } -- To view, visit https://gerrit.wikimedia.org/r/71926 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib04913a966e5fdbc3b6b1b22189d86f184c15523 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LinkedWiki Gerrit-Branch: master Gerrit-Owner: Karima Rafes <karima.ra...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits