summaryrefslogtreecommitdiff
path: root/extensions/Poem
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Poem')
-rw-r--r--extensions/Poem/Poem.class.php84
-rw-r--r--extensions/Poem/Poem.i18n.php721
-rw-r--r--extensions/Poem/Poem.php33
-rw-r--r--extensions/Poem/install.settings2
-rw-r--r--extensions/Poem/poemParserTests.txt142
5 files changed, 982 insertions, 0 deletions
diff --git a/extensions/Poem/Poem.class.php b/extensions/Poem/Poem.class.php
new file mode 100644
index 00000000..586750c0
--- /dev/null
+++ b/extensions/Poem/Poem.class.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * This class handles formatting poems in WikiText, specifically anything within
+ * <poem></poem> tags.
+ */
+class Poem {
+ /**
+ * Bind the renderPoem function to the <poem> tag
+ * @param Parser $parser
+ * @return bool true
+ */
+ public static function init( &$parser ) {
+ $parser->setHook( 'poem', array( 'Poem', 'renderPoem' ) );
+ return true;
+ }
+
+ /**
+ * Parse the text into proper poem format
+ * @param string $in The text inside the poem tag
+ * @param array $param
+ * @param Parser $parser
+ * @param boolean $frame
+ * @return string
+ */
+ public static function renderPoem( $in, $param = array(), $parser = null, $frame = false ) {
+ // using newlines in the text will cause the parser to add <p> tags,
+ // which may not be desired in some cases
+ $newline = isset( $param['compact'] ) ? '' : "\n";
+
+ $tag = $parser->insertStripItem( "<br />", $parser->mStripState );
+
+ // replace colons with indented spans
+ $text = preg_replace_callback( '/^(:+)(.+)$/m', array( 'Poem', 'indentVerse' ), $in );
+
+ // replace newlines with <br /> tags unless they are at the beginning or end
+ // of the poem
+ $text = preg_replace(
+ array( "/^\n/", "/\n$/D", "/\n/" ),
+ array( "", "", "$tag\n" ),
+ $text );
+
+ // replace spaces at the beginning of a line with non-breaking spaces
+ $text = preg_replace_callback( '/^( +)/m', array( 'Poem', 'replaceSpaces' ), $text );
+
+ $text = $parser->recursiveTagParse( $text, $frame );
+
+ $attribs = Sanitizer::validateTagAttributes( $param, 'div' );
+
+ // Wrap output in a <div> with "poem" class.
+ if ( isset( $attribs['class'] ) ) {
+ $attribs['class'] = 'poem ' . $attribs['class'];
+ } else {
+ $attribs['class'] = 'poem';
+ }
+
+ return Html::rawElement( 'div', $attribs, $newline . trim( $text ) . $newline );
+ }
+
+ /**
+ * Callback for preg_replace_callback() that replaces spaces with non-breaking spaces
+ * @param array $m Matches from the regular expression
+ * - $m[1] consists of 1 or more spaces
+ * @return mixed
+ */
+ protected static function replaceSpaces( $m ) {
+ return str_replace( ' ', '&#160;', $m[1] );
+ }
+
+ /**
+ * Callback for preg_replace_callback() that wraps content in an indented span
+ * @param array $m Matches from the regular expression
+ * - $m[1] consists of 1 or more colons
+ * - $m[2] consists of the text after the colons
+ * @return string
+ */
+ protected static function indentVerse( $m ) {
+ $attribs = array(
+ 'class' => 'mw-poem-indented',
+ 'style' => 'display: inline-block; margin-left: ' . strlen( $m[1] ) . 'em;'
+ );
+ // @todo Should this really be raw?
+ return Html::rawElement( 'span', $attribs, $m[2] );
+ }
+}
diff --git a/extensions/Poem/Poem.i18n.php b/extensions/Poem/Poem.i18n.php
new file mode 100644
index 00000000..26fecca6
--- /dev/null
+++ b/extensions/Poem/Poem.i18n.php
@@ -0,0 +1,721 @@
+<?php
+/**
+ * Internationalisation file for Poem extension.
+ *
+ * @file
+ * @ingroup Extensions
+ */
+
+$messages = array();
+
+$messages['en'] = array(
+ 'poem-desc' => 'Adds <code>&lt;poem&gt;</code> tag for poem formatting',
+);
+
+/** Message documentation (Message documentation)
+ * @author Raymond
+ */
+$messages['qqq'] = array(
+ 'poem-desc' => 'Extension description displayed on [[Special:Version]]',
+);
+
+/** Afrikaans (Afrikaans)
+ * @author Naudefj
+ */
+$messages['af'] = array(
+ 'poem-desc' => "Maak 'n <code>&lt;poem&gt;</code> etiket beskikbaar vir die formatering van poësie",
+);
+
+/** Aragonese (aragonés)
+ * @author Juanpabl
+ */
+$messages['an'] = array(
+ 'poem-desc' => 'Adibe a etiqueta <code>&lt;poem&gt;</code> ta formateyar poesía',
+);
+
+/** Arabic (العربية)
+ * @author Meno25
+ */
+$messages['ar'] = array(
+ 'poem-desc' => 'يضيف الوسم <code>&lt;poem&gt;</code> لصياغة القصيدة',
+);
+
+/** Egyptian Spoken Arabic (مصرى)
+ * @author Ramsis II
+ */
+$messages['arz'] = array(
+ 'poem-desc' => 'بيضيف تاج ال <code>&lt;poem&gt;</code> لصياغة القصيدة',
+);
+
+/** Asturian (asturianu)
+ * @author Esbardu
+ */
+$messages['ast'] = array(
+ 'poem-desc' => 'Añade la etiqueta <code>&lt;poem&gt;</code> pal formatu de poemes',
+);
+
+/** Azerbaijani (azərbaycanca)
+ * @author Sortilegus
+ */
+$messages['az'] = array(
+ 'poem-desc' => 'Şeirlərin formatlaşdırılması üçün <code>&lt;poem&gt;</code> teqini əlavə edir',
+);
+
+/** Bashkir (башҡортса)
+ * @author Assele
+ */
+$messages['ba'] = array(
+ 'poem-desc' => 'Шиғырҙарҙы форматлау өсөн <code>&lt;poem&gt;</code> билдәһен өҫтәй',
+);
+
+/** Bavarian (Boarisch)
+ * @author Man77
+ */
+$messages['bar'] = array(
+ 'poem-desc' => "Fügt s'<code>&lt;poem&gt;</code>-Tag zum Formatian vu Gedichtln dazua",
+);
+
+/** Southern Balochi (بلوچی مکرانی)
+ * @author Mostafadaneshvar
+ */
+$messages['bcc'] = array(
+ 'poem-desc' => 'هورکنت <code>&lt;poem&gt;</code> برچسپء په فرمت شئر',
+);
+
+/** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)‎)
+ * @author Jim-by
+ */
+$messages['be-tarask'] = array(
+ 'poem-desc' => 'Дадае тэг <code>&lt;poem&gt;</code> для фарматаваньня вершаў',
+);
+
+/** Bulgarian (български)
+ * @author DCLXVI
+ */
+$messages['bg'] = array(
+ 'poem-desc' => 'Добавя етикет <code>&lt;poem&gt;</code> за форматиране на стихове',
+);
+
+/** Bengali (বাংলা)
+ * @author Bellayet
+ */
+$messages['bn'] = array(
+ 'poem-desc' => 'কবিতার ফরমেটিং এর জন্য <code>&lt;poem&gt;</code> ট্যাগ যোগ করুন',
+);
+
+/** Breton (brezhoneg)
+ * @author Fulup
+ */
+$messages['br'] = array(
+ 'poem-desc' => 'Ouzhpennañ a ra ar valizenn <code>&lt;poem&gt;</code> da furmadiñ testennoù barzhonegoù.',
+);
+
+/** Bosnian (bosanski)
+ * @author CERminator
+ */
+$messages['bs'] = array(
+ 'poem-desc' => 'Dodaje oznaku <code>&lt;poem&gt;</code> za formatiranje stihova',
+);
+
+/** Catalan (català)
+ * @author Paucabot
+ */
+$messages['ca'] = array(
+ 'poem-desc' => "Afegeix l'etiqueta <code>&lt;poem&gt;</code> per al formatatge de poemes",
+);
+
+/** Sorani Kurdish (کوردی)
+ * @author Asoxor
+ */
+$messages['ckb'] = array(
+ 'poem-desc' => 'تاگی <code>&lt;poem&gt;</code> زێدەدەکات بۆ ڕێکخستنی ھۆنراوەکان',
+);
+
+/** Czech (česky)
+ * @author Matěj Grabovský
+ */
+$messages['cs'] = array(
+ 'poem-desc' => 'Přidává značku <code>&lt;poem&gt;</code> pro formátování básní',
+);
+
+/** Danish (dansk)
+ * @author Peter Alberti
+ */
+$messages['da'] = array(
+ 'poem-desc' => 'Tilføjer tagget <code>&lt;poem&gt;</code> til formatering af digte',
+);
+
+/** German (Deutsch)
+ * @author Kghbln
+ * @author Raimond Spekking
+ */
+$messages['de'] = array(
+ 'poem-desc' => 'Ergänzt das Tag <code>&lt;poem&gt;</code> zur Formatierung von Gedichten',
+);
+
+/** Zazaki (Zazaki)
+ * @author Aspar
+ */
+$messages['diq'] = array(
+ 'poem-desc' => 'qey fesaldayişê şiiri etiketê <code>&lt;poem&gt;</code>i têarê keno',
+);
+
+/** Lower Sorbian (dolnoserbski)
+ * @author Michawiki
+ */
+$messages['dsb'] = array(
+ 'poem-desc' => 'Pśidawa toflicku <code>&lt;poem&gt;</code> za formatěrowanje basnjow',
+);
+
+/** Greek (Ελληνικά)
+ * @author Dead3y3
+ */
+$messages['el'] = array(
+ 'poem-desc' => 'Προσθέτει την ετικέτα <code>&lt;poem&gt;</code> για την μορφοποίηση ποιημάτων',
+);
+
+/** Esperanto (Esperanto)
+ * @author Yekrats
+ */
+$messages['eo'] = array(
+ 'poem-desc' => 'Aldonas <code>&lt;poem&gt;</code> etikedon por formatado de poezio.',
+);
+
+/** Spanish (español)
+ * @author Muro de Aguas
+ */
+$messages['es'] = array(
+ 'poem-desc' => 'Añade la etiqueta <code>&lt;poem&gt;</code> para dar el formato propio de un poema.',
+);
+
+/** Estonian (eesti)
+ * @author Pikne
+ */
+$messages['et'] = array(
+ 'poem-desc' => 'Lisab <code>&lt;poem&gt;</code>-sildi luuletuse vormindamiseks.',
+);
+
+/** Basque (euskara)
+ * @author Theklan
+ */
+$messages['eu'] = array(
+ 'poem-desc' => '<code>&lt;poem&gt;</code> etiketa gehitzen du olerkien formaturako',
+);
+
+/** Persian (فارسی)
+ * @author Huji
+ */
+$messages['fa'] = array(
+ 'poem-desc' => 'برچسب <code>&lt;poem&gt;</code> را برای قالب‌بندی شعرها می‌افزاید',
+);
+
+/** Finnish (suomi)
+ * @author Nike
+ */
+$messages['fi'] = array(
+ 'poem-desc' => 'Mahdollistaa runojen muotoilun <code>&lt;poem&gt;</code>-elementillä.',
+);
+
+/** French (français)
+ * @author Grondin
+ */
+$messages['fr'] = array(
+ 'poem-desc' => 'Ajoute la balise <code>&lt;poem&gt;</code> pour le formatage des poèmes',
+);
+
+/** Franco-Provençal (arpetan)
+ * @author ChrisPtDe
+ */
+$messages['frp'] = array(
+ 'poem-desc' => 'Apond la balisa <code>&lt;poem&gt;</code> por lo formatâjo des poèmos.',
+);
+
+/** Northern Frisian (Nordfriisk)
+ * @author Murma174
+ */
+$messages['frr'] = array(
+ 'poem-desc' => 'Saat <code>&lt;poem&gt;</code> diartu, am dachtangen tu formatiarin',
+);
+
+/** Galician (galego)
+ * @author Alma
+ */
+$messages['gl'] = array(
+ 'poem-desc' => 'Engada a etiqueta <code>&lt;poem&gt;</code> para o formato poema',
+);
+
+/** Swiss German (Alemannisch)
+ * @author Als-Holder
+ */
+$messages['gsw'] = array(
+ 'poem-desc' => 'Fiegt s <code>&lt;poem&gt;</code>-Tag zue zum Formatiere vu Gedicht',
+);
+
+/** Hebrew (עברית)
+ */
+$messages['he'] = array(
+ 'poem-desc' => 'הוספת התגית <code>&lt;poem&gt;</code> לעיצוב שירה',
+);
+
+/** Hindi (हिन्दी)
+ * @author Kaustubh
+ */
+$messages['hi'] = array(
+ 'poem-desc' => 'कविता लिखने के लिये आवश्यक <code>&lt;poem&gt;</code> टॅग देता हैं',
+);
+
+/** Hiligaynon (Ilonggo)
+ * @author Tagimata
+ */
+$messages['hil'] = array(
+ 'poem-desc' => 'Gadugang <code>&lt;poem&gt;</code> tag para sa pagformat sang tula',
+);
+
+/** Croatian (hrvatski)
+ * @author Dalibor Bosits
+ */
+$messages['hr'] = array(
+ 'poem-desc' => 'Dodaje <code>&lt;poem&gt;</code> oznaku za formatiranje pjesama',
+);
+
+/** Upper Sorbian (hornjoserbsce)
+ * @author Michawiki
+ */
+$messages['hsb'] = array(
+ 'poem-desc' => 'Přidawa tafličku <code>&lt;poem&gt;</code> za formatowanje basnjow',
+);
+
+/** Hungarian (magyar)
+ * @author Dani
+ */
+$messages['hu'] = array(
+ 'poem-desc' => '<code>&lt;poem&gt;</code> tag a versek formázásához',
+);
+
+/** Interlingua (interlingua)
+ * @author McDutchie
+ */
+$messages['ia'] = array(
+ 'poem-desc' => 'Adde le etiquetta <code>&lt;poem&gt;</code> pro formatar poemas',
+);
+
+/** Indonesian (Bahasa Indonesia)
+ * @author IvanLanin
+ */
+$messages['id'] = array(
+ 'poem-desc' => 'Menambahkan tag <code>&lt;poem&gt;</code> tag untuk pemformatan puisi',
+);
+
+/** Iloko (Ilokano)
+ * @author Lam-ang
+ */
+$messages['ilo'] = array(
+ 'poem-desc' => 'Ikkan na iti<code>&lt;poem&gt;</code> nga tag para ti pagporma ti daniw',
+);
+
+/** Italian (italiano)
+ * @author BrokenArrow
+ */
+$messages['it'] = array(
+ 'poem-desc' => 'Aggiunge il tag <code>&lt;poem&gt;</code> per la formattazione dei testi poetici',
+);
+
+/** Japanese (日本語)
+ * @author Aotake
+ * @author JtFuruhata
+ * @author Shirayuki
+ */
+$messages['ja'] = array(
+ 'poem-desc' => '詩を整形する <code>&lt;poem&gt;</code> タグを追加する',
+);
+
+/** Jutish (jysk)
+ * @author Huslåke
+ */
+$messages['jut'] = array(
+ 'poem-desc' => 'Tilføje <code>&lt;poem&gt;</code> tag før digt formåter',
+);
+
+/** Javanese (Basa Jawa)
+ * @author Meursault2004
+ */
+$messages['jv'] = array(
+ 'poem-desc' => 'Nambahaké tag <code>&lt;poem&gt;</code> tag kanggo formatting tembang utawa puisi',
+);
+
+/** Georgian (ქართული)
+ * @author David1010
+ */
+$messages['ka'] = array(
+ 'poem-desc' => 'ამატებს ტეგს <code>&lt;პოემა&gt;</code> ლექსების ფორმატირებისათვის',
+);
+
+/** Khmer (ភាសាខ្មែរ)
+ * @author Lovekhmer
+ * @author Thearith
+ */
+$messages['km'] = array(
+ 'poem-desc' => 'ដាក់ប្លាក <code>&lt;poem&gt;</code> សម្រាប់ទ្រង់ទ្រាយកំណាព្យ',
+);
+
+/** Korean (한국어)
+ * @author ToePeu
+ */
+$messages['ko'] = array(
+ 'poem-desc' => '시 형식을 위해 <code>&lt;poem&gt;</code> 태그를 추가',
+);
+
+/** Colognian (Ripoarisch)
+ * @author Purodha
+ */
+$messages['ksh'] = array(
+ 'poem-desc' => 'Brengk et <code>&lt;poem&gt;</code>-Kommando met, för Jedeeshte ze jeshtallde.',
+);
+
+/** Luxembourgish (Lëtzebuergesch)
+ * @author Robby
+ */
+$messages['lb'] = array(
+ 'poem-desc' => "Setzt de <code>&lt;poem&gt;</code>-Tag fir d'Formatéierung vu Gedichter derbäi",
+);
+
+/** Limburgish (Limburgs)
+ * @author Matthias
+ */
+$messages['li'] = array(
+ 'poem-desc' => 'Voegt de tag <code>&lt;poem&gt;</code> toe veur de opmaak van poëzie',
+);
+
+/** Lithuanian (lietuvių)
+ * @author Garas
+ * @author Hugo.arg
+ */
+$messages['lt'] = array(
+ 'poem-desc' => 'Prideda <code>&lt;poem&gt;</code> gaires poemų formatavimui',
+);
+
+/** Mizo (Mizo ţawng)
+ * @author RMizo
+ */
+$messages['lus'] = array(
+ 'poem-desc' => 'Hlahril tàrphung siamrem nan tàrreuh <code>&lt;poem&gt;</code> hi a belh.',
+);
+
+/** Latvian (latviešu)
+ * @author Xil
+ */
+$messages['lv'] = array(
+ 'poem-desc' => 'Pievieno <code>&lt;poem&gt;</code> tagu dzejas formatēšanai',
+);
+
+/** Macedonian (македонски)
+ * @author Bjankuloski06
+ * @author Brest
+ */
+$messages['mk'] = array(
+ 'poem-desc' => 'Додава <code>&lt;poem&gt;</code> ознака за форматирање на стихови',
+);
+
+/** Malayalam (മലയാളം)
+ * @author Shijualex
+ */
+$messages['ml'] = array(
+ 'poem-desc' => 'പദ്യത്തിന്റെ ഫോർമാറ്റിങ്ങിനു <code>&lt;poem&gt;</code> എന്ന ടാഗ് ചേർക്കുന്നു',
+);
+
+/** Marathi (मराठी)
+ * @author Kaustubh
+ */
+$messages['mr'] = array(
+ 'poem-desc' => 'कवितेच्या सादरीकरणासाठी आवश्यक असणारा <code>&lt;poem&gt;</code> टॅग देतो.',
+);
+
+/** Malay (Bahasa Melayu)
+ * @author Aviator
+ */
+$messages['ms'] = array(
+ 'poem-desc' => 'Menambah tag <code>&lt;poem&gt;</code> untuk pemformatan puisi',
+);
+
+/** Norwegian Bokmål (norsk (bokmål)‎)
+ */
+$messages['nb'] = array(
+ 'poem-desc' => 'Legger til taggen <code>&lt;poem&gt;</code> for å kunne formatere dikt',
+);
+
+/** Low German (Plattdüütsch)
+ * @author Slomox
+ */
+$messages['nds'] = array(
+ 'poem-desc' => 'Föögt dat <code>&lt;poem&gt;</code>-Tag för dat Formateren vun Gedichten to',
+);
+
+/** Dutch (Nederlands)
+ * @author Siebrand
+ */
+$messages['nl'] = array(
+ 'poem-desc' => 'Voegt de tag <code>&lt;poem&gt;</code> toe voor de opmaak van poëzie',
+);
+
+/** Norwegian Nynorsk (norsk (nynorsk)‎)
+ * @author Harald Khan
+ */
+$messages['nn'] = array(
+ 'poem-desc' => 'Legg til merket <code>&lt;poem&gt;</code> for å kunna formatera dikt',
+);
+
+/** Occitan (occitan)
+ * @author Cedric31
+ */
+$messages['oc'] = array(
+ 'poem-desc' => 'Apond la balisa <code>&lt;poem&gt;</code> pel formatatge dels poèmas',
+);
+
+/** Polish (polski)
+ * @author Sp5uhe
+ */
+$messages['pl'] = array(
+ 'poem-desc' => 'Dodaje znacznik <code>&lt;poem&gt;</code> służący do formatowania wierszy',
+);
+
+/** Piedmontese (Piemontèis)
+ * @author Dragonòt
+ */
+$messages['pms'] = array(
+ 'poem-desc' => 'A gionta ël tag <code>&lt;poem&gt;</code> për formatassion ëd poema',
+);
+
+/** Pashto (پښتو)
+ * @author Ahmed-Najib-Biabani-Ibrahimkhel
+ */
+$messages['ps'] = array(
+ 'poem-desc' => 'د شعر بڼه ورکولو کړنې لپاره د <tt>&lt;شعر&gt;</tt> وييکه ورګډوي',
+);
+
+/** Portuguese (português)
+ * @author Hamilton Abreu
+ * @author Malafaya
+ */
+$messages['pt'] = array(
+ 'poem-desc' => 'Adiciona o elemento <code>&lt;poem&gt;</code> para formatação de poemas',
+);
+
+/** Brazilian Portuguese (português do Brasil)
+ * @author Eduardo.mps
+ */
+$messages['pt-br'] = array(
+ 'poem-desc' => 'Adiciona a marca <code>&lt;poem&gt;</code> para formatação de poemas',
+);
+
+/** Tarifit (Tarifit)
+ * @author Aryaz
+ */
+$messages['rif'] = array(
+ 'poem-desc' => 'Issadaf <code>&lt;poem&gt;</code> i usmal d tira n tmdyazt',
+);
+
+/** Romanian (română)
+ * @author Mihai
+ */
+$messages['ro'] = array(
+ 'poem-desc' => 'Adaugă eticheta <code>&lt;poem&gt;</code> pentru formatarea poem',
+);
+
+/** tarandíne (tarandíne)
+ * @author Joetaras
+ */
+$messages['roa-tara'] = array(
+ 'poem-desc' => "Aggiunge 'u tag <code>&lt;poem&gt;</code> p'a formattazione de le poesie",
+);
+
+/** Russian (русский)
+ * @author Александр Сигачёв
+ */
+$messages['ru'] = array(
+ 'poem-desc' => 'Добавляет тег <code>&lt;poem&gt;</code> для форматирования стихов',
+);
+
+/** Rusyn (русиньскый)
+ * @author Gazeb
+ */
+$messages['rue'] = array(
+ 'poem-desc' => 'Додасть значку <code>&lt;poem&gt;</code> про форматованя віршів',
+);
+
+/** Sakha (саха тыла)
+ * @author HalanTul
+ */
+$messages['sah'] = array(
+ 'poem-desc' => 'Хоһооннору суруйарга <code>&lt;poem&gt;</code> тиэги эбэр',
+);
+
+/** Sicilian (sicilianu)
+ * @author Melos
+ */
+$messages['scn'] = array(
+ 'poem-desc' => 'Iunci lu tag <code>&lt;poem&gt;</code> pi la furmattazioni di li testa puetici',
+);
+
+/** Slovak (slovenčina)
+ * @author Helix84
+ */
+$messages['sk'] = array(
+ 'poem-desc' => 'Pridáva značku <code>&lt;poem&gt;</code> pre formátovanie básní',
+);
+
+/** Slovenian (slovenščina)
+ * @author Dbc334
+ */
+$messages['sl'] = array(
+ 'poem-desc' => 'Doda etiketo <code>&lt;poem&gt;</code> za oblikovanje pesmi',
+);
+
+/** Lower Silesian (Schläsch)
+ * @author Piotron
+ */
+$messages['sli'] = array(
+ 'poem-desc' => 'Fiegt is <code>&lt;poem&gt;</code>-Tag zur Furmatierung voo Gedichta hinzu',
+);
+
+/** Albanian (shqip)
+ * @author Puntori
+ */
+$messages['sq'] = array(
+ 'poem-desc' => 'Vendosë kodin <code>&lt;poem&gt;</code> për formatim të poezive',
+);
+
+/** Serbian (Cyrillic script) (српски (ћирилица)‎)
+ * @author Millosh
+ * @author Nikola Smolenski
+ */
+$messages['sr-ec'] = array(
+ 'poem-desc' => 'Додаје <code>&lt;poem&gt;</code> ознаку за форматирање песама.',
+);
+
+/** Serbian (Latin script) (srpski (latinica)‎)
+ * @author Michaello
+ */
+$messages['sr-el'] = array(
+ 'poem-desc' => 'Dodaje <code>&lt;poem&gt;</code> oznaku za formatiranje pesama.',
+);
+
+/** Seeltersk (Seeltersk)
+ * @author Pyt
+ */
+$messages['stq'] = array(
+ 'poem-desc' => 'Föiget dät <code>&lt;poem&gt;</code>-Tag tou ju Formatierenge fon Gedichte bietou',
+);
+
+/** Swedish (svenska)
+ * @author Lejonel
+ */
+$messages['sv'] = array(
+ 'poem-desc' => 'Lägger till taggen <code>&lt;poem&gt;</code> för att formatera dikter',
+);
+
+/** Telugu (తెలుగు)
+ * @author Veeven
+ */
+$messages['te'] = array(
+ 'poem-desc' => 'పద్యాల ఫార్మాటింగుకై <code>&lt;poem&gt;</code> అనే టాగుని చేరుస్తుంది',
+);
+
+/** Tajik (Cyrillic script) (тоҷикӣ)
+ * @author Ibrahim
+ */
+$messages['tg-cyrl'] = array(
+ 'poem-desc' => 'Барчасби <code>&lt;poem&gt;</code>-ро барои қолаббандиҳои шеърҳо илова мекунад',
+);
+
+/** Tajik (Latin script) (tojikī)
+ * @author Liangent
+ */
+$messages['tg-latn'] = array(
+ 'poem-desc' => "Barcasbi <code>&lt;poem&gt;</code>-ro baroi qolabbandihoi şe'rho ilova mekunad",
+);
+
+/** Thai (ไทย)
+ * @author Octahedron80
+ */
+$messages['th'] = array(
+ 'poem-desc' => 'เพิ่มแท็ก <code>&lt;poem&gt;</code> สำหรับการจัดรูปแบบบทกวี',
+);
+
+/** Turkmen (Türkmençe)
+ * @author Hanberke
+ */
+$messages['tk'] = array(
+ 'poem-desc' => 'Goşgy formatirlemesi üçin <code>&lt;poem&gt;</code> tegini goşýar',
+);
+
+/** Tagalog (Tagalog)
+ * @author AnakngAraw
+ */
+$messages['tl'] = array(
+ 'poem-desc' => 'Nagdaragdag ng tatak na <code>&lt;poem&gt;</code> para sa pagpopormat ng tula',
+);
+
+/** Turkish (Türkçe)
+ * @author Joseph
+ */
+$messages['tr'] = array(
+ 'poem-desc' => 'Şiir biçimlendirmesi için <code>&lt;poem&gt;</code> etiketini ekler',
+);
+
+/** Ukrainian (українська)
+ * @author Ahonc
+ */
+$messages['uk'] = array(
+ 'poem-desc' => 'Додає тег <code>&lt;poem&gt;</code> для форматування віршів',
+);
+
+/** vèneto (vèneto)
+ * @author Candalua
+ */
+$messages['vec'] = array(
+ 'poem-desc' => 'Zonta el tag <code>&lt;poem&gt;</code> par la formatazion dei testi poetici',
+);
+
+/** Veps (vepsän kel’)
+ * @author Игорь Бродский
+ */
+$messages['vep'] = array(
+ 'poem-desc' => 'Ližadab <code>&lt;poem&gt;</code>-virg runod formatiruides',
+);
+
+/** Vietnamese (Tiếng Việt)
+ * @author Minh Nguyen
+ */
+$messages['vi'] = array(
+ 'poem-desc' => 'Thêm thẻ <code>&lt;poem&gt;</code> để định dạng các bài thơ',
+);
+
+/** Volapük (Volapük)
+ * @author Smeira
+ */
+$messages['vo'] = array(
+ 'poem-desc' => 'Läükon mali: <code>&lt;poem&gt;</code> pro fomät: poedot',
+);
+
+/** Cantonese (粵語)
+ * @author Shinjiman
+ */
+$messages['yue'] = array(
+ 'poem-desc' => '加 <code>&lt;poem&gt;</code> 標籤畀詩格式用',
+);
+
+/** Simplified Chinese (中文(简体)‎)
+ * @author Shinjiman
+ * @author Wmr89502270
+ * @author Xiaomingyan
+ */
+$messages['zh-hans'] = array(
+ 'poem-desc' => '添加“<code>&lt;poem&gt;</code>”标签用于诗歌格式',
+);
+
+/** Traditional Chinese (中文(繁體)‎)
+ * @author Shinjiman
+ */
+$messages['zh-hant'] = array(
+ 'poem-desc' => '加入 <code>&lt;poem&gt;</code> 標籤給予詩歌格式使用',
+);
diff --git a/extensions/Poem/Poem.php b/extensions/Poem/Poem.php
new file mode 100644
index 00000000..ee5f7083
--- /dev/null
+++ b/extensions/Poem/Poem.php
@@ -0,0 +1,33 @@
+<?php
+# MediaWiki Poem extension v1.1
+#
+# Based on example code from
+# http://www.mediawiki.org/wiki/Manual:Extending_wiki_markup
+#
+# Other code is © 2005 Nikola Smolenski <smolensk@eunet.yu>
+# and © 2011 Zaran <zaran.krleza@gmail.com>
+#
+# Anyone is allowed to use this code for any purpose.
+#
+# To install, copy the extension to your extensions directory and add line
+# require_once( "$IP/extensions/Poem/Poem.php" );
+# to the bottom of your LocalSettings.php
+#
+# To use, put some text between <poem></poem> tags
+#
+# For more information see its page at
+# http://www.mediawiki.org/wiki/Extension:Poem
+
+$wgExtensionCredits['parserhook'][] = array(
+ 'path' => __FILE__,
+ 'name' => 'Poem',
+ 'author' => array( 'Nikola Smolenski', 'Brion Vibber', 'Steve Sanbeg' ),
+ 'url' => 'https://www.mediawiki.org/wiki/Extension:Poem',
+ 'descriptionmsg' => 'poem-desc',
+);
+
+$dir = __DIR__ . '/';
+$wgParserTestFiles[] = $dir . 'poemParserTests.txt';
+$wgAutoloadClasses['Poem'] = $dir . 'Poem.class.php';
+$wgExtensionMessagesFiles['Poem'] = $dir . 'Poem.i18n.php';
+$wgHooks['ParserFirstCallInit'][] = 'Poem::init';
diff --git a/extensions/Poem/install.settings b/extensions/Poem/install.settings
new file mode 100644
index 00000000..973dbc72
--- /dev/null
+++ b/extensions/Poem/install.settings
@@ -0,0 +1,2 @@
+require_once( "{{path}}/Poem.php" );
+
diff --git a/extensions/Poem/poemParserTests.txt b/extensions/Poem/poemParserTests.txt
new file mode 100644
index 00000000..266dd614
--- /dev/null
+++ b/extensions/Poem/poemParserTests.txt
@@ -0,0 +1,142 @@
+# Force the test runner to ensure the extension is loaded
+!! hooks
+poem
+!! endhooks
+
+#Regression tests for existing functionality, to ensure nothing was broken.
+!! test
+<poem>
+!! input
+<poem>
+this
+is
+a
+test
+</poem>
+!! result
+<div class="poem">
+<p>this<br />
+is<br />
+a<br />
+test
+</p>
+</div>
+
+!! end
+
+!!test
+ <poem> with recursive parsing
+!!input
+<poem>
+this ''is'' a '''test'''
+</poem>
+!! result
+<div class="poem">
+<p>this <i>is</i> a <b>test</b>
+</p>
+</div>
+
+!!end
+
+
+!!test
+ <poem> with leading whitespace
+!!input
+<poem>
+
+ test
+
+</poem>
+!! result
+<div class="poem">
+<p><br />
+&#160;&#160;&#160;test<br />
+</p>
+</div>
+
+!!end
+
+!!test
+Horizontal rule
+!!input
+<poem>
+some
+-----
+text
+</poem>
+!!result
+<div class="poem">
+<p>some<br />
+</p>
+<hr /><br />
+<p>text
+</p>
+</div>
+
+!!end
+
+#test for new poem/nowiki feature; should fail without new enhancement.
+!! test 2
+example of <nowiki> without <poem>
+!!options
+disabled
+!! input
+<nowiki>
+this
+is
+a
+test
+</nowiki>
+!! result
+<p>
+this
+is
+a
+test
+
+</p>
+!! end
+
+!! test
+ nested <poem><nowiki>
+!! input
+<poem><nowiki>
+this
+is
+a
+test
+</nowiki></poem>
+!! result
+<div class="poem">
+<p><br />
+this<br />
+is<br />
+a<br />
+test<br />
+
+</p>
+</div>
+
+!!end
+
+!! test 5
+ nested <poem><nowiki> with formatting
+!! input
+<poem><nowiki>
+this
+'''is'''
+a
+test
+</nowiki></poem>
+!! result
+<div class="poem">
+<p><br />
+this<br />
+'''is'''<br />
+a<br />
+test<br />
+
+</p>
+</div>
+
+!! end