diff options
author | Alex Legler <alex@a3li.li> | 2014-12-23 17:49:26 +0100 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2014-12-23 17:49:26 +0100 |
commit | e352fff59842ca14fbfd81ee1c4a64297bb598c5 (patch) | |
tree | 153f268484aa5cc41cacf912bdce8c4847df222d /PipeEscape | |
download | extensions-e352fff59842ca14fbfd81ee1c4a64297bb598c5.tar.gz extensions-e352fff59842ca14fbfd81ee1c4a64297bb598c5.tar.bz2 extensions-e352fff59842ca14fbfd81ee1c4a64297bb598c5.zip |
Add initial set of additional extensions
Diffstat (limited to 'PipeEscape')
-rw-r--r-- | PipeEscape/PipeEscape.i18n.magic.php | 10 | ||||
-rw-r--r-- | PipeEscape/PipeEscape.i18n.php | 370 | ||||
-rw-r--r-- | PipeEscape/PipeEscape.php | 73 |
3 files changed, 453 insertions, 0 deletions
diff --git a/PipeEscape/PipeEscape.i18n.magic.php b/PipeEscape/PipeEscape.i18n.magic.php new file mode 100644 index 00000000..f6cf4b54 --- /dev/null +++ b/PipeEscape/PipeEscape.i18n.magic.php @@ -0,0 +1,10 @@ +<?php +/** + * Internationalization file for magic words. + */ + +$magicWords = array(); + +$magicWords['en'] = array( + '!' => array( 0, '!' ), +); diff --git a/PipeEscape/PipeEscape.i18n.php b/PipeEscape/PipeEscape.i18n.php new file mode 100644 index 00000000..78d7d3bc --- /dev/null +++ b/PipeEscape/PipeEscape.i18n.php @@ -0,0 +1,370 @@ +<?php +/** + * Internationalisation file for extension PipeEscape. + * + * @file + * @ingroup Extensions + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * @author David M. Sledge + * @author Purodha Blissenbach, http://ksh.wikipedia.org/wiki/User:Purodha + * @copyright Copyright © 2008 David M. Sledge + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later + */ + +$messages = array(); + +/** English (English) + * @author David M. Sledge + * @author Purodha + */ +$messages['en'] = array( + # general messages + 'pipeescape-desc' => 'Parser function <code>#!</code> for when you want a pipe character to be just a pipe character', +); + +/** Message documentation (Message documentation) + * @author Fryed-peach + * @author Purodha + */ +$messages['qqq'] = array( + 'pipeescape-desc' => '{{desc|name=[[:mw:Extension:Pipe_Escape|Pipe_Escape]]}}', +); + +/** Gheg Albanian (Gegë) + * @author Mdupont + */ +$messages['aln'] = array( + 'pipeescape-desc' => 'funksion parser <code>#!</code> për kur të doni një karakter tub të jetë vetëm një karakter tub', +); + +/** Arabic (العربية) + * @author Meno25 + */ +$messages['ar'] = array( + 'pipeescape-desc' => 'دالة محلل <code>#!</code> لعندما تريد حرف أنبوبة ليكون فقط حرف أنبوبة', +); + +/** Asturian (asturianu) + * @author Xuacu + */ +$messages['ast'] = array( + 'pipeescape-desc' => "Función del analizador sintácticu <code>#!</code> pa cuando se quier que'l caráuter de barra vertical «|» nun tenga significáu especial", +); + +/** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)) + * @author EugeneZelenko + */ +$messages['be-tarask'] = array( + 'pipeescape-desc' => 'Функцыя парсэра <code>#!</code>, якая сочыць, каб калі Вы жадаеце дадаць сымбаль «|», дадаваліся толькі сымбаль «|».', +); + +/** Breton (brezhoneg) + * @author Fulup + */ +$messages['br'] = array( + 'pipeescape-desc' => 'Arc\'hwel parser <code>#!</code> evit ensoc\'hañ arouezenn ur varrenn sonn "|" evel un arouezenn barrenn sonn hepmuiken', +); + +/** Bosnian (bosanski) + * @author CERminator + */ +$messages['bs'] = array( + 'pipeescape-desc' => 'Parserska funkcija <code>#!</code> kada želite da pipe znak bude isključivo samo pipe znak', +); + +/** German (Deutsch) + * @author Kghbln + * @author Purodha + */ +$messages['de'] = array( + 'pipeescape-desc' => 'Ergänzt die Funktion <code>#!</code>, die als versteckter Parametertrenner genutzt werden kann', +); + +/** Lower Sorbian (dolnoserbski) + * @author Michawiki + */ +$messages['dsb'] = array( + 'pipeescape-desc' => 'Parserowa funkcija <code>#!</code>, joli coš znamješko | schowaś (znamješko | ma se jano pśedstajiś, bźez wósebneje funkcije)', +); + +/** Greek (Ελληνικά) + * @author Omnipaedista + */ +$messages['el'] = array( + 'pipeescape-desc' => 'Λεξιαναλυτική συνάρτηση <code>#!</code> για όταν θέλετε ένας χαρακτήρας pipe να είναι απλά ένας χαρακτήρας pipe', +); + +/** Spanish (español) + * @author Sanbec + */ +$messages['es'] = array( + 'pipeescape-desc' => 'Función del analizador sintáctico <code>#!</code> para insertar el carácter de barra vertical «|» como tal carácter y sin significado especial,', +); + +/** Basque (euskara) + * @author Theklan + */ +$messages['eu'] = array( + 'pipeescape-desc' => '<code>#!</code> parser funtzioa, karaktere hori zehazki karaktere hori izan dadila nahi duzunerako', +); + +/** Finnish (suomi) + * @author Cimon Avaro + * @author Crt + */ +$messages['fi'] = array( + 'pipeescape-desc' => 'Jäsentimen toiminto <code>#!</code>, kun haluat putkimerkin olevan vain putkimerkki.', +); + +/** French (français) + * @author Grondin + * @author Urhixidur + */ +$messages['fr'] = array( + 'pipeescape-desc' => 'Fonction de l’analyseur syntaxique <code>#!</code> pour insérer une barre verticale non-interprétée.', +); + +/** Galician (galego) + * @author Toliño + */ +$messages['gl'] = array( + 'pipeescape-desc' => 'Función analítica <code>#!</code> para cando queira un carácter punto que sexa só un carácter punto', +); + +/** Swiss German (Alemannisch) + * @author Als-Holder + */ +$messages['gsw'] = array( + 'pipeescape-desc' => 'Parserfunktion <code>#!</code> versteckt Parameter-Trenner', +); + +/** Hebrew (עברית) + * @author Rotemliss + */ +$messages['he'] = array( + 'pipeescape-desc' => 'הוראת מפענח <code>#!</code> למקרה שבו רוצים שתו מפריד אנכי (|) יהיה פשוט תו מפריד אנכי', +); + +/** Hiligaynon (Ilonggo) + * @author Tagimata + */ +$messages['hil'] = array( + 'pipeescape-desc' => 'Parser panksiyon <code>#!</code> para kada kilanlan nimo sang karakter tubo para mangin isa ka karakter tubo', +); + +/** Upper Sorbian (hornjoserbsce) + * @author Michawiki + */ +$messages['hsb'] = array( + 'pipeescape-desc' => 'Parserowa funkcija <code>#!</code>, jeli chceš znamješko | schować (znamješko | ma so jenož předstajić, bjez wosebiteje funkcije)', +); + +/** Hungarian (magyar) + * @author Glanthor Reviol + */ +$messages['hu'] = array( + 'pipeescape-desc' => '<code>#!</code> elemzőfüggvény, hogy szükség esetén a függőleges vonal (pipe) karaktert ne értelmezze speciálisan az elemző', +); + +/** Interlingua (interlingua) + * @author McDutchie + */ +$messages['ia'] = array( + 'pipeescape-desc' => 'Function del analysator syntactic <code>#!</code> pro inserer le character de barra vertical ("pipe") qua character simple.', +); + +/** Indonesian (Bahasa Indonesia) + * @author Bennylin + */ +$messages['id'] = array( + 'pipeescape-desc' => 'Fungsi parser <code>#!</code> jika Anda menginginkan karakter pipa sebagaimana adanya', +); + +/** Italian (italiano) + * @author Civvì + */ +$messages['it'] = array( + 'pipeescape-desc' => "Funzione parser <code>#!</code> per quando si desidera che il carattere ''pipe'' sia solo un carattere pipe", +); + +/** Japanese (日本語) + * @author Fryed-peach + */ +$messages['ja'] = array( + 'pipeescape-desc' => 'パイプ記号をパイプ記号のまま扱いたい場合のために、パーサー関数 <code>#!</code> を追加する', +); + +/** Korean (한국어) + * @author Kwj2772 + */ +$messages['ko'] = array( + 'pipeescape-desc' => '파이프 문자가 파이프 문자로서의 역할만 하도록 할 때 사용하는 <code>#!</code> 파서 기능', +); + +/** Colognian (Ripoarisch) + * @author Purodha + */ +$messages['ksh'] = array( + 'pipeescape-desc' => 'Brengk de Paaserfunxjuhn <code>#!</code> en et Wiki, die der sängkrääschte Shtresh unmollesteet dorsch löht.', +); + +/** Latin (Latina) + * @author UV + * @author purodha + */ +$messages['la'] = array( + 'pipeescape-desc' => 'Functio parseris <code>#!</code> qui protegit litteram | ne haec littera separet parametra', +); + +/** Luxembourgish (Lëtzebuergesch) + * @author Robby + */ +$messages['lb'] = array( + 'pipeescape-desc' => 'Parserfonctioun <code>#!</code> fir den Trenn-Parameter als normale Buchstaw ze benotzen', +); + +/** Macedonian (македонски) + * @author Bjankuloski06 + */ +$messages['mk'] = array( + 'pipeescape-desc' => 'Парсерска функција <code>#!</code> која се користи кога сакате цртите да бидат само црти', +); + +/** Malay (Bahasa Melayu) + * @author Anakmalaysia + */ +$messages['ms'] = array( + 'pipeescape-desc' => 'Fungsi penghurai <code>#!</code> supaya aksara paip kekal sekadar aksara paip tanpa fungsi khas', +); + +/** Norwegian Bokmål (norsk (bokmål)) + * @author Nghtwlkr + */ +$messages['nb'] = array( + 'pipeescape-desc' => 'Tolkefunksjonen <code>#!</code> som lar «|»-tegnet bare være et «|»-tegn', +); + +/** Dutch (Nederlands) + * @author Siebrand + */ +$messages['nl'] = array( + 'pipeescape-desc' => 'Parserfunctie <code>#!</code> om een pipe-karakter gewoon een pipe-karakter te laten zijn', +); + +/** Norwegian Nynorsk (norsk (nynorsk)) + * @author Harald Khan + * @author Njardarlogar + */ +$messages['nn'] = array( + 'pipeescape-desc' => 'Tolkefunksjon <code>#!</code> som lèt «|»-teiknet vera berre eit «|»-teikn.', +); + +/** Occitan (occitan) + * @author Cedric31 + */ +$messages['oc'] = array( + 'pipeescape-desc' => 'Foncion parser <code>#!</code> per inserir lo caractèr pipe en tant que caractèr simple.', +); + +/** Polish (polski) + * @author Sp5uhe + */ +$messages['pl'] = array( + 'pipeescape-desc' => 'Funkcja parsera <code>#!</code> pozwalająca na użycie znaku pionowej kreski', +); + +/** Piedmontese (Piemontèis) + * @author Dragonòt + */ +$messages['pms'] = array( + 'pipeescape-desc' => 'Fonsion dël parser <code>#!</code> për quand it veule che un caràter "pipe" a sia mach un caràter "pipe"', +); + +/** Portuguese (português) + * @author Hamilton Abreu + * @author Malafaya + */ +$messages['pt'] = array( + 'pipeescape-desc' => 'Função do analisador sintáctico <code>#!</code> para quando se pretende que uma barra vertical ("pipe") seja apenas uma barra vertical.', +); + +/** Brazilian Portuguese (português do Brasil) + * @author Eduardo.mps + */ +$messages['pt-br'] = array( + 'pipeescape-desc' => 'Função do analisador (parser) <code>#!</code> para quando se pretende que um caractere barra vertical ("pipe") seja apenas um caractere barra vertical.', +); + +/** tarandíne (tarandíne) + * @author Joetaras + */ +$messages['roa-tara'] = array( + 'pipeescape-desc' => "Funziona d'analisi <code>#!</code> pe quanne tu vuè ca 'nu carattere de ''pipe'' avène conziderate cumme a 'nu ''pipe''", +); + +/** Russian (русский) + * @author Александр Сигачёв + */ +$messages['ru'] = array( + 'pipeescape-desc' => 'Функция парсера <code>#!</code> предназначена для случаев, когда вы хотите использовать символ вертикальной черты просто как символ', +); + +/** Slovak (slovenčina) + * @author Helix84 + */ +$messages['sk'] = array( + 'pipeescape-desc' => 'Funkciu syntaktického analyzátora <code>#!</code> použijete vtedy, keď chcete, aby bol znak rúry iba znakom rúry', +); + +/** Serbian (Cyrillic script) (српски (ћирилица)) + * @author Михајло Анђелковић + */ +$messages['sr-ec'] = array( + 'pipeescape-desc' => "Парсерска функција <code>#!</code> за случајеве када пајп-карактер ('|') треба да буде само то.", +); + +/** Serbian (Latin script) (srpski (latinica)) */ +$messages['sr-el'] = array( + 'pipeescape-desc' => "Parserska funkcija <code>#!</code> za slučajeve kada pajp-karakter ('|') treba da bude samo to.", +); + +/** Swedish (svenska) + * @author Najami + */ +$messages['sv'] = array( + 'pipeescape-desc' => 'Parserfunktionen <code>#!</code> låter "|"-tecknet bara vara ett "|"-tecken.', +); + +/** Tagalog (Tagalog) + * @author AnakngAraw + */ +$messages['tl'] = array( + 'pipeescape-desc' => 'Tungkulin ng banghay na <code>#!</code> para sa kung kailan mo naising maging isang panitik na tubo lamang ang isang panitik na tubo', +); + +/** Turkish (Türkçe) + * @author Vito Genovese + */ +$messages['tr'] = array( + 'pipeescape-desc' => 'Bir boru karakterinin sadece bir boru karakteri olmasını istediğiniz zamanlar için ayrıştırıcı fonksiyon <code>#!</code>', +); + +/** Ukrainian (українська) + * @author Prima klasy4na + */ +$messages['uk'] = array( + 'pipeescape-desc' => 'Функція парсера <code>#!</code> для випадків, коли ви хочете використовувати символ вертикальної риски тільки як символ', +); + +/** Vietnamese (Tiếng Việt) + * @author Vinhtantran + */ +$messages['vi'] = array( + 'pipeescape-desc' => 'Hàm cú pháp <code>#!</code> dùng khi bạn muốn một ký tự sổ dọc chỉ đơn thuần là một ký tự sổ dọc', +); + diff --git a/PipeEscape/PipeEscape.php b/PipeEscape/PipeEscape.php new file mode 100644 index 00000000..554afab3 --- /dev/null +++ b/PipeEscape/PipeEscape.php @@ -0,0 +1,73 @@ +<?php +/** + * @file + * @ingroup Extensions + * @link http://www.mediawiki.org/wiki/Extension:Pipe_Escape Documentation + * + * @author David M. Sledge + * @modifier Purodha Blissenbach + * @copyright Copyright © 2008 David M. Sledge + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 + * or later + * @version 0.1.0 + * initial creation. + * @version 0.1.1 + * i18n support. + * + * @todo + * allow alias names. + */ + +if ( !defined( 'MEDIAWIKI' ) ) +{ + die( 'This file is a MediaWiki extension, it is not a valid entry point.' ); +} + +$wgHooks[ 'ParserFirstCallInit' ][] = 'ExtPipeEsc::setup'; +$wgExtensionCredits[ 'parserhook' ][] = array( + 'path' => __FILE__, + 'author' => 'David M. Sledge', + 'name' => 'Pipe Escape', + 'version' => ExtPipeEsc::VERSION, + 'url' => 'https://www.mediawiki.org/wiki/Extension:Pipe_Escape', + 'descriptionmsg' => 'pipeescape-desc', +); + +$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR; +$wgExtensionMessagesFiles['PipeEscape'] = $dir . 'PipeEscape.i18n.php'; +$wgExtensionMessagesFiles['PipeEscapeMagic'] = $dir . 'PipeEscape.i18n.magic.php'; + +class ExtPipeEsc +{ + const VERSION = '0.1.1'; + private static $parserFunctions = array('!' => 'pipeChar'); + + public static function setup( &$parser ) + { + // register each hook + foreach( self::$parserFunctions as $hook => $function ) + $parser->setFunctionHook( $hook, + array( __CLASS__, $function ), SFH_OBJECT_ARGS ); + return true; + } + + public static function pipeChar( &$parser, $frame, $args ) + { + $output = array_shift( $args ); + // no parameters means we're done. spit out an empty string + if ( !isset( $output ) ) + return ''; + // expand the first argument + $output = $frame->expand( $output ); + // get the rest of the arguments, expand each one, prefix each expansion + // with a pipe character, and append it to the output string. + for ( $arg = array_shift( $args ); + isset( $arg ); + $arg = array_shift( $args ) ) + { + $output .= '|' . $frame->expand( $arg ); + } + //return '<pre><nowiki>'. trim( $output ) . '</nowiki></pre>'; + return trim( $output ); + } +} |