Index: trunk/extensions/SelectCategory/SelectCategory.i18n.php |
— | — | @@ -0,0 +1,212 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalisation file for extension SelectCategory. |
| 5 | + * |
| 6 | + * @addtogroup Extensions |
| 7 | + * @author Leon Weber <leon.weber@leonweber.de> & Manuel Schneider <manuel.schneider@wikimedia.ch> |
| 8 | + * @copyright © 2006 by Leon Weber & Manuel Schneider |
| 9 | + * @licence GNU General Public Licence 2.0 or later |
| 10 | + */ |
| 11 | + |
| 12 | +$messages = array(); |
| 13 | + |
| 14 | +/** English |
| 15 | + * @author Leon Weber <leon.weber@leonweber.de> |
| 16 | + * @author Manuel Schneider <manuel.schneider@wikimedia.ch> |
| 17 | + */ |
| 18 | +$messages['en'] = array( |
| 19 | + 'selectcategory-title' => 'Select categories', |
| 20 | + 'selectcategory-subtitle' => 'Shift-mouse to select multiple contiguous entries, Ctrl-mouse to select non-contiguous entries.', |
| 21 | +); |
| 22 | + |
| 23 | +/** Arabic (العربية) |
| 24 | + * @author Meno25 |
| 25 | + */ |
| 26 | +$messages['ar'] = array( |
| 27 | + 'selectcategory-title' => 'اختر التصنيفات', |
| 28 | + 'selectcategory-subtitle' => 'Shift-mouse لاختيار مدخلات متوافقة متعددة، Ctrl-mouse لاختيار مدخلات غير متوافقة.', |
| 29 | +); |
| 30 | + |
| 31 | +/** Bikol Central (Bikol Central) |
| 32 | + * @author Filipinayzd |
| 33 | + */ |
| 34 | +$messages['bcl'] = array( |
| 35 | + 'selectcategory-title' => 'Magpilì nin mga kategorya', |
| 36 | +); |
| 37 | + |
| 38 | +/** Bulgarian (Български) |
| 39 | + * @author Spiritia |
| 40 | + */ |
| 41 | +$messages['bg'] = array( |
| 42 | + 'selectcategory-title' => 'Избор на категории', |
| 43 | + 'selectcategory-subtitle' => 'Shift + ляв бутон на мишката за избор на множество последователни записи, Ctrl + ляв бутон на мишката за избор на непоследователни записи.', |
| 44 | +); |
| 45 | + |
| 46 | +/** German (Deutsch) |
| 47 | + * @author Manuel Schneider <manuel.schneider@wikimedia.ch> |
| 48 | + */ |
| 49 | +$messages['de'] = array( |
| 50 | + 'selectcategory-title' => 'Kategorien auswählen', |
| 51 | + 'selectcategory-subtitle' => 'Shift-Maus um mehrere nachfolgende Einträge zu (de-)selektieren, Strg-Maus um einzelne Einträge zu (de-)selektieren.', |
| 52 | +); |
| 53 | + |
| 54 | +/** Greek (Ελληνικά) |
| 55 | + * @author Consta |
| 56 | + */ |
| 57 | +$messages['el'] = array( |
| 58 | + 'selectcategory-title' => 'Επέλεξε κατηγορίες', |
| 59 | +); |
| 60 | + |
| 61 | +/** French (Français) |
| 62 | + * @author Marius Engler <marius.engler@coop.ch> |
| 63 | + * @author Sherbrooke |
| 64 | + */ |
| 65 | +$messages['fr'] = array( |
| 66 | + 'selectcategory-title' => 'Choix de catégories', |
| 67 | + 'selectcategory-subtitle' => 'Maj+click afin de (dé)sélectionner plusieurs catégories d’affilée, Ctrl+click afin de (dé)sélectionner des catégories individuellement.', |
| 68 | +); |
| 69 | + |
| 70 | +/** Galician (Galego) |
| 71 | + * @author Xosé |
| 72 | + */ |
| 73 | +$messages['gl'] = array( |
| 74 | + 'selectcategory-title' => 'Seleccionar categorías', |
| 75 | + 'selectcategory-subtitle' => 'Faga clic co botón de maiúsculas e o rato para seleccionar varias entradas contiguas. Co botón Ctrl e o rato para seleccionar entradas non contiguas.', |
| 76 | +); |
| 77 | + |
| 78 | +/** Swiss German (Alemannisch) |
| 79 | + * @author Manuel Schneider <manuel.schneider@wikimedia.ch> |
| 80 | + */ |
| 81 | +$messages['gsw'] = array( |
| 82 | + 'selectcategory-title' => 'Kategori ussueche', |
| 83 | + 'selectcategory-subtitle' => 'Gross-Muus go verschiedeni Iiträg hintrenander go uswähle, Strg-Muus go einzelni Iiträg go uswähle', |
| 84 | +); |
| 85 | + |
| 86 | +/** Upper Sorbian (Hornjoserbsce) |
| 87 | + * @author Michawiki |
| 88 | + */ |
| 89 | +$messages['hsb'] = array( |
| 90 | + 'selectcategory-title' => 'Kategorije wubrać', |
| 91 | + 'selectcategory-subtitle' => 'Umschalt-Myš, zo bychu so wjacore susodne zapiski wubrali, Strg-myš, zo bychu so njesusodne zapiski wubrali.', |
| 92 | +); |
| 93 | + |
| 94 | +/** Indonesian (Bahasa Indonesia) |
| 95 | + * @author Ivan Lanin <ivanlanin@gmail.com> |
| 96 | + */ |
| 97 | +$messages['id'] = array( |
| 98 | + 'selectcategory-title' => 'Pilih kategori', |
| 99 | + 'selectcategory-subtitle' => 'Shift-mouse untuk memilih entri yang berurutan, Ctrl-mouse untuk memilih entri yang tidak berurutan.', |
| 100 | +); |
| 101 | + |
| 102 | +/** Italian (Italiano) |
| 103 | + * @author Marius Engler <marius.engler@coop.ch> |
| 104 | + * @author BrokenArrow |
| 105 | + */ |
| 106 | +$messages['it'] = array( |
| 107 | + 'selectcategory-title' => 'Selezionare le categorie', |
| 108 | + 'selectcategory-subtitle' => 'Fare clic con il mouse tenendo premuto MAIUSC per selezionare più voci adiacenti o CTRL per selezionare più voci non adiacenti.', |
| 109 | +); |
| 110 | + |
| 111 | +/** Luxembourgish (Lëtzebuergesch) |
| 112 | + * @author Robby |
| 113 | + */ |
| 114 | +$messages['lb'] = array( |
| 115 | + 'selectcategory-title' => 'Kategorie wielen', |
| 116 | + 'selectcategory-subtitle' => 'Shift + Maus fir méi Rubriken hannereneen unzewielen, Ctrl + Maus fir eenzel Rubriken unzewielen', |
| 117 | +); |
| 118 | + |
| 119 | +/** Dutch (Nederlands) |
| 120 | + * @author Siebrand |
| 121 | + */ |
| 122 | +$messages['nl'] = array( |
| 123 | + 'selectcategory-title' => 'Selecteer categorieën', |
| 124 | + 'selectcategory-subtitle' => 'Shiftklik om meerdere opeenvolgende categorieën te selecteren, Ctrlklik om niet-openvolgende categorieën te selecteren.', |
| 125 | +); |
| 126 | + |
| 127 | +/** Norwegian (Norsk (bokmål)) |
| 128 | + * @author Jon Harald Søby |
| 129 | + */ |
| 130 | +$messages['no'] = array( |
| 131 | + 'selectcategory-title' => 'Velg kategorier', |
| 132 | + 'selectcategory-subtitle' => 'Shift+klikk for å velge flere sammenhengende alternativer, Ctrl+klikk for å velge ikke-sammenhengende alternativer.', |
| 133 | +); |
| 134 | + |
| 135 | +/** Occitan (Occitan) |
| 136 | + * @author Cedric31 |
| 137 | + */ |
| 138 | +$messages['oc'] = array( |
| 139 | + 'selectcategory-title' => 'Causida de categorias', |
| 140 | + 'selectcategory-subtitle' => "Maj+click pr'amor de (de)seleccionar mantuna categoria d’arrèu, Ctrl+click pr'amor de (de)seleccionar de categorias individualament.", |
| 141 | +); |
| 142 | + |
| 143 | +/** Polish (Polski) |
| 144 | + * @author Derbeth |
| 145 | + */ |
| 146 | +$messages['pl'] = array( |
| 147 | + 'selectcategory-title' => 'Wybór kategorii', |
| 148 | + 'selectcategory-subtitle' => 'Shift+przycisk myszy wybiera wiele sąsiednich elementów, Ctrl+przycisk myszy wybiera elementy, które nie są koło siebie', |
| 149 | +); |
| 150 | + |
| 151 | +/** Piemontèis (Piemontèis) |
| 152 | + * @author Bèrto 'd Sèra |
| 153 | + */ |
| 154 | +$messages['pms'] = array( |
| 155 | + 'selectcategory-title' => 'Selession për categorìe', |
| 156 | + 'selectcategory-subtitle' => "Ch'a dòvra sò rat con la ciav dlë Shift sgnacà për sërne ëd categorìe ch'as ven-o l'un-a dapress a l'àotra, ò pura con ën sgmacand la ciav Ctrl për pieje un-a pr'un-a.", |
| 157 | +); |
| 158 | + |
| 159 | +/** Portuguese (Português) |
| 160 | + * @author Malafaya |
| 161 | + */ |
| 162 | +$messages['t'] = array( |
| 163 | + 'selectcategory-title' => 'Seleccionar categorias', |
| 164 | + 'selectcategory-subtitle' => 'Shift-clique para seleccionar múltiplas entradas contíguas, Ctrl-clique para seleccionar entradas não-contíguas.', |
| 165 | +); |
| 166 | + |
| 167 | +/** Slovak (Slovenčina) |
| 168 | + * @author Helix84 |
| 169 | + */ |
| 170 | +$messages['sk'] = array( |
| 171 | + 'selectcategory-title' => 'Vybrať kategórie', |
| 172 | + 'selectcategory-subtitle' => 'Shift+kliknutie označí súvislú skupinu položiek, ctrl+kliknutie označí jednotlivé nesúvislé položky.', |
| 173 | +); |
| 174 | + |
| 175 | +/** Seeltersk (Seeltersk) |
| 176 | + * @author Pyt |
| 177 | + */ |
| 178 | +$messages['stq'] = array( |
| 179 | + 'selectcategory-title' => 'Kategorien uutwääle', |
| 180 | + 'selectcategory-subtitle' => 'Shift-Muus uum moorere ätterfoulgjende Iendraage tou (de-)selektierjen, Strg-Muus uum eenpelde Iendraage tou (de-)selektierjen.', |
| 181 | +); |
| 182 | + |
| 183 | +/** Yue (粵語) |
| 184 | + * @author Shinjiman |
| 185 | + */ |
| 186 | +$messages['yue'] = array( |
| 187 | + 'selectcategory-title' => '選擇分類', |
| 188 | + 'selectcategory-subtitle' => '撳住Shift掣再用個mouse去揀連續嘅項目,撳住Ctrl掣再用個mouse去揀非連續嘅項目。', |
| 189 | +); |
| 190 | + |
| 191 | +/** Simplified Chinese (中文(简体)) |
| 192 | + * @author Shinjiman |
| 193 | + */ |
| 194 | +$messages['zh-hans'] = array( |
| 195 | + 'selectcategory-title' => '选择分类', |
| 196 | + 'selectcategory-subtitle' => '按着Shift键再以鼠标选取连续的项目,按着Ctrl键再以鼠标选取非连续的项目。', |
| 197 | +); |
| 198 | + |
| 199 | +/** Traditional Chinese (中文(繁體)) |
| 200 | + * @author Shinjiman |
| 201 | + */ |
| 202 | +$messages['zh-hant'] = array( |
| 203 | + 'selectcategory-title' => '選擇分類', |
| 204 | + 'selectcategory-subtitle' => '按著Shift鍵再以滑鼠選取連續的項目,按著Ctrl鍵再以滑鼠選取非連續的項目。', |
| 205 | +); |
| 206 | + |
| 207 | +$messages['de-formal'] = $messages['de']; |
| 208 | +$messages['zh'] = $messages['zh-hans']; |
| 209 | +$messages['zh-cn'] = $messages['zh-hans']; |
| 210 | +$messages['zh-hk'] = $messages['zh-hant']; |
| 211 | +$messages['zh-sg'] = $messages['zh-hans']; |
| 212 | +$messages['zh-tw'] = $messages['zh-hant']; |
| 213 | +$messages['zh-yue'] = $messages['yue']; |
Property changes on: trunk/extensions/SelectCategory/SelectCategory.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 214 | + native |
Added: svn:executable |
2 | 215 | + * |
Index: trunk/extensions/SelectCategory/SelectCategory.php |
— | — | @@ -59,18 +59,22 @@ |
60 | 60 | if( !isset( $wgSelectCategoryEnableSubpages ) ) $wgSelectCategoryEnableSubpages = true; |
61 | 61 | |
62 | 62 | ## Register extension setup hook and credits: |
63 | | -$wgExtensionFunctions[] = 'fnSelectCategory'; |
64 | 63 | $wgExtensionCredits['parserhook'][] = array( |
65 | 64 | 'name' => 'SelectCategory', |
| 65 | + 'version' => '0.6', |
66 | 66 | 'author' => 'Leon Weber & Manuel Schneider', |
67 | 67 | 'url' => 'http://www.mediawiki.org/wiki/Extension:SelectCategory', |
68 | 68 | 'description' => 'Allows the user to select from existing categories when editing a page' |
69 | 69 | ); |
70 | 70 | |
| 71 | +$dir = dirname(__FILE__) . '/'; |
| 72 | +$wgExtensionMessagesFiles['SelectCategory'] = $dir . 'SelectCategory.i18n.php'; |
| 73 | +$wgExtensionFunctions[] = 'fnSelectCategory'; |
| 74 | + |
71 | 75 | ## Set Hook: |
72 | 76 | function fnSelectCategory() { |
73 | 77 | global $wgHooks; |
74 | | - |
| 78 | + |
75 | 79 | ## Showing the boxes |
76 | 80 | # Hook when starting editing: |
77 | 81 | $wgHooks['EditPage::showEditForm:initial'][] = array( 'fnSelectCategoryShowHook', false ); |
— | — | @@ -86,8 +90,6 @@ |
87 | 91 | ## Infrastructure |
88 | 92 | # Hook our own CSS: |
89 | 93 | $wgHooks['OutputPageParserOutput'][] = 'fnSelectCategoryOutputHook'; |
90 | | - # Hook up local messages: |
91 | | - $wgHooks['LoadAllMessages'][] = 'fnSelectCategoryMessageHook'; |
92 | 94 | } |
93 | 95 | |
94 | 96 | ## Load the file containing the hook functions: |
Index: trunk/extensions/SelectCategory/CHANGELOG |
— | — | @@ -1,3 +1,6 @@ |
| 2 | +* v0.6 - 2008-01-19 |
| 3 | + - using wfLoadExtensionMessages now, all messages in one file |
| 4 | + |
2 | 5 | * v0.5 - 2007-10-12 |
3 | 6 | - fixed problem with additional newline at sectionedits |
4 | 7 | - preserve category sortkeys |
Index: trunk/extensions/SelectCategory/SelectCategoryFunctions.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | # Get all categories from wiki: |
25 | 25 | $m_allCats = fnSelectCategoryGetAllCategories(); |
26 | 26 | # Load system messages: |
27 | | - fnSelectCategoryMessageHook(); |
| 27 | + wfLoadExtensionMessages( 'SelectCategory' ); |
28 | 28 | # Get the right member variables, depending on if we're on an upload form or not: |
29 | 29 | if( !$m_isUpload ) { |
30 | 30 | # Extract all categorylinks from page: |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | } else { |
38 | 38 | # No need to get categories: |
39 | 39 | $m_pageCats = array(); |
40 | | - |
| 40 | + |
41 | 41 | # Place output at the right place: |
42 | 42 | $m_place = 'uploadFormTextAfterSummary'; |
43 | 43 | # Print the part of the table including the localised title for the select box: |
— | — | @@ -69,8 +69,8 @@ |
70 | 70 | $m_pageObj->$m_place .= wfMsg( 'selectcategory-subtitle' ) . "<br/>\n"; |
71 | 71 | $m_pageObj->$m_place .= "<!-- SelectCategory end -->\n"; |
72 | 72 | |
73 | | - } |
74 | | - |
| 73 | + } |
| 74 | + |
75 | 75 | # Return true to let the rest work: |
76 | 76 | return true; |
77 | 77 | } |
— | — | @@ -127,27 +127,7 @@ |
128 | 128 | 'href' => $wgScriptPath . '/extensions/SelectCategory/SelectCategory.css' |
129 | 129 | ) |
130 | 130 | ); |
131 | | - |
132 | | - # Be nice: |
133 | | - return true; |
134 | | -} |
135 | 131 | |
136 | | -## Entry point for the hook for our localised messages: |
137 | | -function fnSelectCategoryMessageHook() { |
138 | | - global $wgLang; |
139 | | - global $wgMessageCache; |
140 | | - |
141 | | - # Initialize array of all messages: |
142 | | - $messages=array(); |
143 | | - # Load default messages (english): |
144 | | - include( 'i18n/SelectCategory.i18n.php' ); |
145 | | - # Load localised messages: |
146 | | - if( file_exists( dirname( __FILE__ ) . '/i18n/SelectCategory.i18n.' . $wgLang->getCode() . '.php' ) ) { // avoid warnings |
147 | | - include( 'i18n/SelectCategory.i18n.' . $wgLang->getCode() . '.php' ); |
148 | | - } |
149 | | - # Put messages into message cache: |
150 | | - $wgMessageCache->addMessages( $messages ); |
151 | | - |
152 | 132 | # Be nice: |
153 | 133 | return true; |
154 | 134 | } |
— | — | @@ -171,12 +151,12 @@ |
172 | 152 | # Get table names to access them in SQL query: |
173 | 153 | $m_tblCatLink = $m_dbObj->tableName( 'categorylinks' ); |
174 | 154 | $m_tblPage = $m_dbObj->tableName( 'page' ); |
175 | | - |
| 155 | + |
176 | 156 | # Automagically detect root categories: |
177 | 157 | $m_sql = " SELECT tmpSelectCat1.cl_to AS title |
178 | | - FROM $m_tblCatLink AS tmpSelectCat1 |
| 158 | + FROM $m_tblCatLink AS tmpSelectCat1 |
179 | 159 | LEFT JOIN $m_tblPage AS tmpSelectCatPage ON (tmpSelectCat1.cl_to = tmpSelectCatPage.page_title AND tmpSelectCatPage.page_namespace = 14) |
180 | | - LEFT JOIN $m_tblCatLink AS tmpSelectCat2 ON tmpSelectCatPage.page_id = tmpSelectCat2.cl_from |
| 160 | + LEFT JOIN $m_tblCatLink AS tmpSelectCat2 ON tmpSelectCatPage.page_id = tmpSelectCat2.cl_from |
181 | 161 | WHERE tmpSelectCat2.cl_from IS NULL GROUP BY tmpSelectCat1.cl_to"; |
182 | 162 | # Run the query: |
183 | 163 | $m_res = $m_dbObj->query( $m_sql, __METHOD__ ); |
— | — | @@ -184,11 +164,11 @@ |
185 | 165 | while ( $m_row = $m_dbObj->fetchRow( $m_res ) ) { |
186 | 166 | $m_allCats += array( $m_row['title'] => 0 ); |
187 | 167 | $m_allCats += fnSelectCategoryGetChildren( $m_row['title'] ); |
188 | | - } |
| 168 | + } |
189 | 169 | # Free result: |
190 | 170 | $m_dbObj->freeResult( $m_res ); |
191 | 171 | } |
192 | | - |
| 172 | + |
193 | 173 | # Afterwards return the array to the caller: |
194 | 174 | return $m_allCats; |
195 | 175 | } |
— | — | @@ -196,17 +176,17 @@ |
197 | 177 | function fnSelectCategoryGetChildren( $m_root, $m_prefix = 1 ) { |
198 | 178 | # Initialize return value: |
199 | 179 | $m_allCats = array(); |
200 | | - |
| 180 | + |
201 | 181 | # Get a database object: |
202 | 182 | $m_dbObj =& wfGetDB( DB_SLAVE ); |
203 | 183 | # Get table names to access them in SQL query: |
204 | 184 | $m_tblCatLink = $m_dbObj->tableName( 'categorylinks' ); |
205 | 185 | $m_tblPage = $m_dbObj->tableName( 'page' ); |
206 | | - |
| 186 | + |
207 | 187 | # The normal query to get all children of a given root category: |
208 | 188 | $m_sql = " SELECT tmpSelectCatPage.page_title AS title |
209 | | - FROM $m_tblCatLink AS tmpSelectCat |
210 | | - LEFT JOIN $m_tblPage AS tmpSelectCatPage ON tmpSelectCat.cl_from = tmpSelectCatPage.page_id |
| 189 | + FROM $m_tblCatLink AS tmpSelectCat |
| 190 | + LEFT JOIN $m_tblPage AS tmpSelectCatPage ON tmpSelectCat.cl_from = tmpSelectCatPage.page_id |
211 | 191 | WHERE tmpSelectCat.cl_to LIKE '$m_root' AND tmpSelectCatPage.page_namespace = 14"; |
212 | 192 | # Run the query: |
213 | 193 | $m_res = $m_dbObj->query( $m_sql, __METHOD__ ); |
— | — | @@ -215,10 +195,10 @@ |
216 | 196 | # Add current entry to array: |
217 | 197 | $m_allCats += array( $m_row['title'] => $m_prefix ); |
218 | 198 | $m_allCats += fnSelectCategoryGetChildren( $m_row['title'], $m_prefix + 1 ); |
219 | | - } |
| 199 | + } |
220 | 200 | # Free result: |
221 | 201 | $m_dbObj->freeResult( $m_res ); |
222 | | - |
| 202 | + |
223 | 203 | # Afterwards return the array to the upper recursion level: |
224 | 204 | return $m_allCats; |
225 | 205 | } |
— | — | @@ -238,7 +218,7 @@ |
239 | 219 | } |
240 | 220 | |
241 | 221 | global $wgContLang; |
242 | | - |
| 222 | + |
243 | 223 | # Get page contents: |
244 | 224 | $m_pageText = $m_pageObj->textbox1; |
245 | 225 | # Get localised namespace string: |
— | — | @@ -262,7 +242,7 @@ |
263 | 243 | } |
264 | 244 | # Place the cleaned text into the text box: |
265 | 245 | $m_pageObj->textbox1 = trim( $m_cleanText ); |
266 | | - |
| 246 | + |
267 | 247 | # Return the list of categories as an array: |
268 | 248 | return $m_catLinks; |
269 | 249 | } |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -1642,17 +1642,12 @@ |
1643 | 1643 | protected $messageFile = 'ScanSet/ScanSet.i18n.php'; |
1644 | 1644 | } |
1645 | 1645 | |
1646 | | -class SelectCategoryExtensionGroup extends MultipleFileMessageGroup { |
1647 | | - protected $fileExporter = null; |
| 1646 | +class SelectCategoryExtensionGroup extends ExtensionMessageGroup { |
1648 | 1647 | protected $label = 'Select Category'; |
1649 | 1648 | protected $id = 'ext-selectcategory'; |
1650 | 1649 | |
1651 | 1650 | protected $arrName = 'messages'; |
1652 | 1651 | protected $messageFile = 'SelectCategory/i18n/SelectCategory.i18n.php'; |
1653 | | - protected $filePattern = 'SelectCategory/i18n/SelectCategory.i18n.$CODE.php'; |
1654 | | - |
1655 | | - protected $exportStart = '$messages = array('; |
1656 | | - protected $exportEnd = ');'; |
1657 | 1652 | } |
1658 | 1653 | |
1659 | 1654 | class SemanticDrilldownMessageGroup extends ExtensionMessageGroup { |