Index: branches/wmf/1.17wmf1/extensions/Narayam/Narayam.i18n.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | 'narayam-toggle-ime' => 'To toggle IM ($1)', // FIXME: better message |
20 | 20 | 'narayam-help-page' => 'Help:Typing', |
21 | 21 | 'narayam-checkbox-tooltip' => 'To toggle input method on and off', // FIXME: better message |
| 22 | + 'narayam-disable-preference' => 'Disable Narayam Input Method Editor (IME)', |
22 | 23 | 'narayam-hi-inscript' => 'Hindi InScript', |
23 | 24 | 'narayam-kn' => 'Kannada Transliteration', |
24 | 25 | 'narayam-kn-inscript' => 'Kannada InScript', |
— | — | @@ -99,6 +100,8 @@ |
100 | 101 | 'narayam-kn-inscript' => 'Канацкая InScript', |
101 | 102 | 'narayam-ml' => 'Малайская трансьлітарацыя', |
102 | 103 | 'narayam-ml-inscript' => 'Малайскі надпіс', |
| 104 | + 'narayam-or' => 'Орыя трансьлітарацыя', |
| 105 | + 'narayam-or-inscript' => 'Орыя InScript', |
103 | 106 | 'narayam-sa' => 'Санскрыцкая трансьлітарацыя', |
104 | 107 | 'narayam-sa-inscript' => 'Санскрыт інскрыпт', |
105 | 108 | 'narayam-si-singlish' => 'Сынгальскі Сынглсіх', |
— | — | @@ -120,6 +123,32 @@ |
121 | 124 | 'narayam-ta' => 'Treuzlizherennadur tamoul', |
122 | 125 | ); |
123 | 126 | |
| 127 | +/** Bosnian (Bosanski) |
| 128 | + * @author CERminator |
| 129 | + */ |
| 130 | +$messages['bs'] = array( |
| 131 | + 'narayam-desc' => 'Omogućava dodavanje proizvoljnog metoda unosa za polja unosa', |
| 132 | + 'narayam-toggle-ime' => 'Za prebacivanje IM ($1)', |
| 133 | + 'narayam-help-page' => 'Help:Tipkanje', |
| 134 | + 'narayam-checkbox-tooltip' => 'Za uključivanje i isključivanje načina unosa', |
| 135 | + 'narayam-hi-inscript' => 'InScript za hidni', |
| 136 | + 'narayam-kn' => 'Kannada transliteracija', |
| 137 | + 'narayam-kn-inscript' => 'InScript za Kannadu', |
| 138 | + 'narayam-ml' => 'Malayalam transliteracija', |
| 139 | + 'narayam-ml-inscript' => 'InScript za Malayalam', |
| 140 | + 'narayam-or' => 'Oriya transliteracija', |
| 141 | + 'narayam-or-inscript' => 'InScript za Oriya', |
| 142 | + 'narayam-sa' => 'Sanskrit transliteracija', |
| 143 | + 'narayam-sa-inscript' => 'InScript za sanskrit', |
| 144 | + 'narayam-si-singlish' => 'Sinhala singleski', |
| 145 | + 'narayam-si-wijesekara' => 'Sinhala Wijesekara', |
| 146 | + 'narayam-ta99' => 'Tamil99', |
| 147 | + 'narayam-ta' => 'Tamil transliteracija', |
| 148 | + 'narayam-bn-avro' => 'Bengali Avro', |
| 149 | + 'narayam-bn-inscript' => 'InScript za bengalski', |
| 150 | + 'narayam-bn-nkb' => 'Bengalski NKB', |
| 151 | +); |
| 152 | + |
124 | 153 | /** German (Deutsch) |
125 | 154 | * @author Kghbln |
126 | 155 | * @author McDutchie |
— | — | @@ -129,6 +158,7 @@ |
130 | 159 | 'narayam-toggle-ime' => 'Eingabemethode umschalten ($1)', |
131 | 160 | 'narayam-help-page' => 'Help:Eingabe', |
132 | 161 | 'narayam-checkbox-tooltip' => 'Eingabemethode ein- und ausschalten', |
| 162 | + 'narayam-disable-preference' => 'Narayameditor deaktivieren', |
133 | 163 | 'narayam-hi-inscript' => 'Hindi (InScript)', |
134 | 164 | 'narayam-kn' => 'Kannada (Transliteration)', |
135 | 165 | 'narayam-kn-inscript' => 'Kannada (InScript)', |
— | — | @@ -157,6 +187,43 @@ |
158 | 188 | 'narayam-help-page' => 'Aide: Saisie au clavier', |
159 | 189 | ); |
160 | 190 | |
| 191 | +/** Galician (Galego) |
| 192 | + * @author Toliño |
| 193 | + */ |
| 194 | +$messages['gl'] = array( |
| 195 | + 'narayam-desc' => 'Permite engadir métodos de entrada personalizados para os campos de entrada', |
| 196 | + 'narayam-toggle-ime' => 'Para conmutar o método de entrada ($1)', |
| 197 | + 'narayam-help-page' => 'Help:Escritura', |
| 198 | + 'narayam-checkbox-tooltip' => 'Para activar e desactivar o método de entrada', |
| 199 | + 'narayam-ta99' => 'Tamil99', |
| 200 | +); |
| 201 | + |
| 202 | +/** Swiss German (Alemannisch) |
| 203 | + * @author Als-Holder |
| 204 | + */ |
| 205 | +$messages['gsw'] = array( |
| 206 | + 'narayam-desc' => 'Macht benutzerdefinierti Yygabemethode fir Yygabefälder megli', |
| 207 | + 'narayam-toggle-ime' => 'Yygabemethode umschalte ($1)', |
| 208 | + 'narayam-help-page' => 'Help:Yygabe', |
| 209 | + 'narayam-checkbox-tooltip' => 'Yygabemethode aa- un abstelle', |
| 210 | + 'narayam-hi-inscript' => 'Hindi (InScript)', |
| 211 | + 'narayam-kn' => 'Kannada (Transliteration)', |
| 212 | + 'narayam-kn-inscript' => 'Kannada (InScript)', |
| 213 | + 'narayam-ml' => 'Malayalam (Transliteration)', |
| 214 | + 'narayam-ml-inscript' => 'Malayalam (InScript)', |
| 215 | + 'narayam-or' => 'Oriya (Transliteration)', |
| 216 | + 'narayam-or-inscript' => 'Oriya (InScript)', |
| 217 | + 'narayam-sa' => 'Sanskrit (Transliteration)', |
| 218 | + 'narayam-sa-inscript' => 'Sanskrit (InScript)', |
| 219 | + 'narayam-si-singlish' => 'Singhalesisch (Singlish)', |
| 220 | + 'narayam-si-wijesekara' => 'Singhalesisch (Wijesekara)', |
| 221 | + 'narayam-ta99' => 'Tamil (Tamil 99)', |
| 222 | + 'narayam-ta' => 'Tamil (Transliteration)', |
| 223 | + 'narayam-bn-avro' => 'Bengalisch (Avro)', |
| 224 | + 'narayam-bn-inscript' => 'Bengalisch (InScript)', |
| 225 | + 'narayam-bn-nkb' => 'Bengalisch (NKB)', |
| 226 | +); |
| 227 | + |
161 | 228 | /** Hebrew (עברית) |
162 | 229 | * @author Amire80 |
163 | 230 | * @author McDutchie |
— | — | @@ -166,6 +233,7 @@ |
167 | 234 | 'narayam-toggle-ime' => 'הפעלת שיטת קלט ($1)', |
168 | 235 | 'narayam-help-page' => 'Help:הקלדה', |
169 | 236 | 'narayam-checkbox-tooltip' => 'הפעלה וכיבוי של שיטת קלט', |
| 237 | + 'narayam-disable-preference' => 'לבטל את שיטת הקלט של נאראיאם', |
170 | 238 | 'narayam-hi-inscript' => 'הינדי InScript', |
171 | 239 | 'narayam-kn' => 'קאנדה תעתיק', |
172 | 240 | 'narayam-kn-inscript' => 'קאנדה InScript', |
— | — | @@ -219,6 +287,7 @@ |
220 | 288 | 'narayam-toggle-ime' => 'Pro alternar MI ($1)', |
221 | 289 | 'narayam-help-page' => 'Help:Dactylographia', |
222 | 290 | 'narayam-checkbox-tooltip' => 'Activar e disactivar le methodo de entrata', |
| 291 | + 'narayam-disable-preference' => 'Disactivar le methodo de entrata pro Narayam', |
223 | 292 | 'narayam-hi-inscript' => 'Hindi (InScript)', |
224 | 293 | 'narayam-kn' => 'Translitteration in kannada', |
225 | 294 | 'narayam-kn-inscript' => 'Kannada (InScript)', |
— | — | @@ -245,6 +314,7 @@ |
246 | 315 | 'narayam-toggle-ime' => 'Taste-Einjabe ömschallde ($1)', |
247 | 316 | 'narayam-help-page' => 'Help:Tippe', |
248 | 317 | 'narayam-checkbox-tooltip' => 'Et Tippe zwesche jewöhnlesch un besönders ömschallde', |
| 318 | + 'narayam-disable-preference' => 'Donn de Enjaabe övver <i lang="en">Narayam</i> ußschallde.', |
249 | 319 | 'narayam-hi-inscript' => 'Hindi <i lang="en">InScript</i>', |
250 | 320 | 'narayam-kn' => 'Kannada met Äsazboochshtaave', |
251 | 321 | 'narayam-kn-inscript' => 'Kannada <i lang="en">InScript</i>', |
— | — | @@ -281,6 +351,7 @@ |
282 | 352 | 'narayam-toggle-ime' => 'За префрлање на вносен метод ($1)', |
283 | 353 | 'narayam-help-page' => 'Help:Внос', |
284 | 354 | 'narayam-checkbox-tooltip' => 'За вкл/искл на метод на внос', |
| 355 | + 'narayam-disable-preference' => 'Оневозможи го уредникот на вносни методи (IME) Narayam', |
285 | 356 | 'narayam-hi-inscript' => 'Хинди - InScript', |
286 | 357 | 'narayam-kn' => 'Транслитерација на Канада', |
287 | 358 | 'narayam-kn-inscript' => 'Канада - InScript', |
— | — | @@ -302,6 +373,7 @@ |
303 | 374 | /** Malayalam (മലയാളം) |
304 | 375 | * @author Junaid P V |
305 | 376 | * @author Junaidpv |
| 377 | + * @author Praveenp |
306 | 378 | * @author Vssun |
307 | 379 | */ |
308 | 380 | $messages['ml'] = array( |
— | — | @@ -311,9 +383,15 @@ |
312 | 384 | 'narayam-checkbox-tooltip' => 'ഇൻപുട്ട് മെത്തേഡ് നിയന്ത്രിക്കാൻ ഇതുപയോഗിക്കുക', |
313 | 385 | 'narayam-hi-inscript' => 'ഹിന്ദി ഇൻസ്ക്രിപ്റ്റ്', |
314 | 386 | 'narayam-kn' => 'കന്നഡ ലിപ്യന്തരണം', |
| 387 | + 'narayam-kn-inscript' => 'കന്നട ഇൻസ്ക്രിപ്റ്റ്', |
315 | 388 | 'narayam-ml' => 'മലയാളം ലിപ്യന്തരണം', |
316 | 389 | 'narayam-ml-inscript' => 'മലയാളം ഇൻസ്ക്രിപ്റ്റ്', |
| 390 | + 'narayam-or' => 'ഒറിയ ലിപ്യന്തരണം', |
| 391 | + 'narayam-or-inscript' => 'ഒറിയ ഇൻസ്ക്രിപ്റ്റ്', |
317 | 392 | 'narayam-sa' => 'സംസ്കൃതം ലിപ്യന്തരണം', |
| 393 | + 'narayam-sa-inscript' => 'സംസ്കൃതം ഇൻസ്ക്രിപ്റ്റ്', |
| 394 | + 'narayam-si-singlish' => 'സിംഹള സിൻഗ്ലീഷ്', |
| 395 | + 'narayam-si-wijesekara' => 'സിംഹള വിജെശേഖര', |
318 | 396 | 'narayam-ta99' => 'തമിഴ്99', |
319 | 397 | 'narayam-ta' => 'തമിഴ് ലിപ്യന്തരണം', |
320 | 398 | 'narayam-bn-avro' => 'ബംഗാളി അവ്രൊ', |
— | — | @@ -348,6 +426,32 @@ |
349 | 427 | 'narayam-bn-nkb' => 'Bengaals NKB', |
350 | 428 | ); |
351 | 429 | |
| 430 | +/** Polish (Polski) |
| 431 | + * @author Sp5uhe |
| 432 | + */ |
| 433 | +$messages['pl'] = array( |
| 434 | + 'narayam-desc' => 'Pozwala dodać niestandardowe metody wprowadzania dla pól wejściowych', |
| 435 | + 'narayam-toggle-ime' => 'Aby przełączyć metodę wprowadzania ($1)', |
| 436 | + 'narayam-help-page' => 'Help:Wpisywanie', |
| 437 | + 'narayam-checkbox-tooltip' => 'Aby włączyć lub wyłączyć metodę wprowadzania', |
| 438 | + 'narayam-hi-inscript' => 'Hindi InScript', |
| 439 | + 'narayam-kn' => 'Kannada transliteracja', |
| 440 | + 'narayam-kn-inscript' => 'Kannada InScript', |
| 441 | + 'narayam-ml' => 'Malajalam transliteracja', |
| 442 | + 'narayam-ml-inscript' => 'Malajalam InScript', |
| 443 | + 'narayam-or' => 'Orija transliteracja', |
| 444 | + 'narayam-or-inscript' => 'Orija InScript', |
| 445 | + 'narayam-sa' => 'Sanskryt transliteracja', |
| 446 | + 'narayam-sa-inscript' => 'Sanskryt InScript', |
| 447 | + 'narayam-si-singlish' => 'Syngaleski singlish', |
| 448 | + 'narayam-si-wijesekara' => 'Syngaleski wijesekara', |
| 449 | + 'narayam-ta99' => 'Tamil99', |
| 450 | + 'narayam-ta' => 'Tamil transliteracja', |
| 451 | + 'narayam-bn-avro' => 'Bengalski avro', |
| 452 | + 'narayam-bn-inscript' => 'Bengalski InScript', |
| 453 | + 'narayam-bn-nkb' => 'Bengalski NKB', |
| 454 | +); |
| 455 | + |
352 | 456 | /** Portuguese (Português) |
353 | 457 | * @author Hamilton Abreu |
354 | 458 | * @author Waldir |
— | — | @@ -399,6 +503,58 @@ |
400 | 504 | 'narayam-bn-nkb' => 'Бенгальский NKB', |
401 | 505 | ); |
402 | 506 | |
| 507 | +/** Yakut (Саха тыла) |
| 508 | + * @author HalanTul |
| 509 | + */ |
| 510 | +$messages['sah'] = array( |
| 511 | + 'narayam-toggle-ime' => 'Киллэрии ньыматын уларытарга ($1)', |
| 512 | + 'narayam-help-page' => 'Help:Киллэрии', |
| 513 | + 'narayam-checkbox-tooltip' => 'Киллэрии ньыматын холбооһун уонна араарыы', |
| 514 | + 'narayam-hi-inscript' => 'Хиинди инскрипт', |
| 515 | + 'narayam-kn' => 'Каннадаа транслитерацията', |
| 516 | + 'narayam-kn-inscript' => 'Каннадаа инскрипт', |
| 517 | + 'narayam-ml' => 'Малаай транслитерацията', |
| 518 | + 'narayam-ml-inscript' => 'Малаай инскрипт', |
| 519 | + 'narayam-or' => 'Орийа транслитерацията', |
| 520 | + 'narayam-or-inscript' => 'Орийа инскрипт', |
| 521 | + 'narayam-sa' => 'Санскрит транслитерацията', |
| 522 | + 'narayam-sa-inscript' => 'Санскрит инскрипт', |
| 523 | + 'narayam-si-singlish' => 'Синһаала сиинглиш', |
| 524 | + 'narayam-si-wijesekara' => 'Видьэсэкээр синһаала', |
| 525 | + 'narayam-ta99' => 'Тамил99', |
| 526 | + 'narayam-ta' => 'Тамиил транслитерацията', |
| 527 | + 'narayam-bn-avro' => 'Бэнгээл Авро', |
| 528 | + 'narayam-bn-inscript' => 'Бэнгээл инскрипт', |
| 529 | + 'narayam-bn-nkb' => 'Бэнгээл NKB', |
| 530 | +); |
| 531 | + |
| 532 | +/** Slovenian (Slovenščina) |
| 533 | + * @author Dbc334 |
| 534 | + */ |
| 535 | +$messages['sl'] = array( |
| 536 | + 'narayam-desc' => 'Omogoča dodajanje načinov vnosa po meri za vnosna polja', |
| 537 | + 'narayam-toggle-ime' => 'Za preklop načina vnosa ($1)', |
| 538 | + 'narayam-help-page' => 'Help:Tipkanje', |
| 539 | + 'narayam-checkbox-tooltip' => 'Za vklop ali izklop načina vnosa', |
| 540 | + 'narayam-disable-preference' => 'Onemogoči urejevalnik načina vnosa (IME) Narayam', |
| 541 | + 'narayam-hi-inscript' => 'InScript za hindijščino', |
| 542 | + 'narayam-kn' => 'Prečrkovanje kannadščine', |
| 543 | + 'narayam-kn-inscript' => 'InScript za kannadščino', |
| 544 | + 'narayam-ml' => 'Prečrkovanje malajalščine', |
| 545 | + 'narayam-ml-inscript' => 'InScript za malajalščino', |
| 546 | + 'narayam-or' => 'Prečrkovanje orijščine', |
| 547 | + 'narayam-or-inscript' => 'InScript za orijščino', |
| 548 | + 'narayam-sa' => 'Prečkovanje sanskrta', |
| 549 | + 'narayam-sa-inscript' => 'InScript za sanskrt', |
| 550 | + 'narayam-si-singlish' => 'Singalska singleščina', |
| 551 | + 'narayam-si-wijesekara' => 'Singalska Wijesekara', |
| 552 | + 'narayam-ta99' => 'Tamil 99', |
| 553 | + 'narayam-ta' => 'Prečrkovanje tamilščine', |
| 554 | + 'narayam-bn-avro' => 'Bengalski Avro', |
| 555 | + 'narayam-bn-inscript' => 'InScript za bengalščino', |
| 556 | + 'narayam-bn-nkb' => 'Bengalski NKB', |
| 557 | +); |
| 558 | + |
403 | 559 | /** Serbian Cyrillic ekavian (Српски (ћирилица)) |
404 | 560 | * @author Rancher |
405 | 561 | */ |
— | — | @@ -470,9 +626,17 @@ |
471 | 627 | 'narayam-toggle-ime' => 'Bật/tắt bộ gõ ($1)', |
472 | 628 | 'narayam-help-page' => 'Help:Bộ gõ', |
473 | 629 | 'narayam-checkbox-tooltip' => 'Bật/tắt bộ gõ', |
| 630 | + 'narayam-hi-inscript' => 'InScript Hindi', |
| 631 | + 'narayam-kn' => 'Chuyển tự tiếng Kannada', |
| 632 | + 'narayam-kn-inscript' => 'InScript Kannada', |
474 | 633 | 'narayam-ml' => 'Chuyển tự tiếng Malayalam', |
475 | 634 | 'narayam-ml-inscript' => 'InScript Malayalam', |
| 635 | + 'narayam-or' => 'Chuyển tự tiếng Oriya', |
| 636 | + 'narayam-or-inscript' => 'InScript Oriya', |
476 | 637 | 'narayam-sa' => 'Chuyển tự tiếng Phạn', |
| 638 | + 'narayam-sa-inscript' => 'InScript Phạn', |
| 639 | + 'narayam-si-singlish' => 'Singlish Sinhala', |
| 640 | + 'narayam-si-wijesekara' => 'Wijesekara Sinhala', |
477 | 641 | 'narayam-ta99' => 'Tamil99', |
478 | 642 | 'narayam-ta' => 'Chuyển tự tiếng Tamil', |
479 | 643 | 'narayam-bn-avro' => 'Avro Bengal', |
— | — | @@ -489,9 +653,17 @@ |
490 | 654 | 'narayam-toggle-ime' => '切换 IM ($1)', |
491 | 655 | 'narayam-help-page' => 'Help:打字', |
492 | 656 | 'narayam-checkbox-tooltip' => '要打开和关闭切换输入的法', |
| 657 | + 'narayam-hi-inscript' => '印地语 InScript', |
| 658 | + 'narayam-kn' => '卡纳达语音译', |
| 659 | + 'narayam-kn-inscript' => '卡纳达语 InScript', |
493 | 660 | 'narayam-ml' => '马拉雅拉姆语音译', |
494 | 661 | 'narayam-ml-inscript' => '马拉雅拉姆语 InScript', |
| 662 | + 'narayam-or' => '奥里亚文音译', |
| 663 | + 'narayam-or-inscript' => '奥里亚文 InScript', |
495 | 664 | 'narayam-sa' => '梵语的音译', |
| 665 | + 'narayam-sa-inscript' => '梵语 InScript', |
| 666 | + 'narayam-si-singlish' => '僧伽罗语新式', |
| 667 | + 'narayam-si-wijesekara' => '僧伽罗语维杰塞克拉', |
496 | 668 | 'narayam-ta99' => '泰米尔99', |
497 | 669 | 'narayam-ta' => '泰米尔音译', |
498 | 670 | 'narayam-bn-avro' => '孟加拉文阿夫罗', |
Index: branches/wmf/1.17wmf1/extensions/Narayam/Narayam.hooks.php |
— | — | @@ -1,11 +1,18 @@ |
2 | 2 | <?php |
| 3 | + |
3 | 4 | /** |
4 | 5 | * Hooks for Narayam extension |
5 | 6 | * @file |
6 | 7 | * @ingroup Extensions |
7 | 8 | */ |
8 | 9 | class NarayamHooks { |
| 10 | + |
9 | 11 | public static function addModules( $out, $skin ) { |
| 12 | + global $wgUser; |
| 13 | + if ( $wgUser->getOption( 'narayamDisable' ) ) { |
| 14 | + // User disabled Narayam |
| 15 | + return true; |
| 16 | + } |
10 | 17 | $schemes = array_values( self::getSchemes () ); |
11 | 18 | if ( count( $schemes ) ) { |
12 | 19 | $out->addModules( $schemes ); |
— | — | @@ -13,20 +20,29 @@ |
14 | 21 | } |
15 | 22 | return true; |
16 | 23 | } |
17 | | - |
| 24 | + |
18 | 25 | public static function addConfig( &$vars ) { |
19 | | - global $wgNarayamEnabledByDefault, $wgNarayamShortcutKey; |
| 26 | + global $wgNarayamEnabledByDefault, $wgNarayamShortcutKey, $wgUser; |
| 27 | + if ( $wgUser->getOption( 'narayamDisable' ) ) { |
| 28 | + // User disabled Narayam |
| 29 | + return true; |
| 30 | + } |
20 | 31 | $vars['wgNarayamEnabledByDefault'] = $wgNarayamEnabledByDefault; |
21 | 32 | $vars['wgNarayamShortcutKey'] = $wgNarayamShortcutKey; |
22 | | - |
| 33 | + |
23 | 34 | return true; |
24 | 35 | } |
25 | | - |
| 36 | + |
26 | 37 | public static function addVariables( &$vars ) { |
| 38 | + global $wgUser; |
| 39 | + if ( $wgUser->getOption( 'narayamDisable' ) ) { |
| 40 | + // User disabled Narayam |
| 41 | + return true; |
| 42 | + } |
27 | 43 | $vars['wgNarayamAvailableSchemes'] = self::getSchemes(); // Note: scheme names must be keys, not values |
28 | 44 | return true; |
29 | 45 | } |
30 | | - |
| 46 | + |
31 | 47 | /** |
32 | 48 | * Get the available schemes for the user and content language |
33 | 49 | * @return array( scheme name => module name ) |
— | — | @@ -35,9 +51,20 @@ |
36 | 52 | global $wgLanguageCode, $wgLang, $wgNarayamSchemes; |
37 | 53 | $userlangCode = $wgLang->getCode(); |
38 | 54 | $contlangSchemes = isset( $wgNarayamSchemes[$wgLanguageCode] ) ? |
39 | | - $wgNarayamSchemes[$wgLanguageCode] : array(); |
| 55 | + $wgNarayamSchemes[$wgLanguageCode] : array(); |
40 | 56 | $userlangSchemes = isset( $wgNarayamSchemes[$userlangCode] ) ? |
41 | | - $wgNarayamSchemes[$userlangCode] : array(); |
| 57 | + $wgNarayamSchemes[$userlangCode] : array(); |
42 | 58 | return $userlangSchemes + $contlangSchemes; |
43 | 59 | } |
| 60 | + |
| 61 | + public static function addPreference( $user, &$preferences ) { |
| 62 | + // A checkbox in preferences to diable Narayam |
| 63 | + $preferences['narayamDisable'] = array( |
| 64 | + 'type' => 'toggle', |
| 65 | + 'label-message' => 'narayam-disable-preference', // a system message |
| 66 | + 'section' => 'editing/advancedediting', // under 'Advanced options' section of 'Editing' tab |
| 67 | + ); |
| 68 | + return true; |
| 69 | + } |
| 70 | + |
44 | 71 | } |
Index: branches/wmf/1.17wmf1/extensions/Narayam/Narayam.php |
— | — | @@ -98,6 +98,7 @@ |
99 | 99 | $wgHooks['BeforePageDisplay'][] = 'NarayamHooks::addModules'; |
100 | 100 | $wgHooks['ResourceLoaderGetConfigVars'][] = 'NarayamHooks::addConfig'; |
101 | 101 | $wgHooks['MakeGlobalVariablesScript'][] = 'NarayamHooks::addVariables'; |
| 102 | +$wgHooks['GetPreferences'][] = 'NarayamHooks::addPreference'; |
102 | 103 | |
103 | 104 | // Autoloader |
104 | 105 | $wgAutoloadClasses['NarayamHooks'] = dirname( __FILE__ ) . '/Narayam.hooks.php'; |
— | — | @@ -155,16 +156,16 @@ |
156 | 157 | 'messages' => array( 'narayam-kn-inscript' ), |
157 | 158 | 'dependencies' => 'ext.narayam.core', |
158 | 159 | ); |
| 160 | +$wgResourceModules['ext.narayam.rules.ml'] = $narayamTpl + array( |
| 161 | + 'scripts' => 'ext.narayam.rules.ml.js', |
| 162 | + 'messages' => array( 'narayam-ml' ), |
| 163 | + 'dependencies' => 'ext.narayam.core', |
| 164 | +); |
159 | 165 | $wgResourceModules['ext.narayam.rules.ml-inscript'] = $narayamTpl + array( |
160 | 166 | 'scripts' => 'ext.narayam.rules.ml-inscript.js', |
161 | 167 | 'messages' => array( 'narayam-ml-inscript' ), |
162 | 168 | 'dependencies' => 'ext.narayam.core', |
163 | 169 | ); |
164 | | -$wgResourceModules['ext.narayam.rules.ml'] = $narayamTpl + array( |
165 | | - 'scripts' => 'ext.narayam.rules.ml.js', |
166 | | - 'messages' => array( 'narayam-ml' ), |
167 | | - 'dependencies' => 'ext.narayam.core', |
168 | | -); |
169 | 170 | $wgResourceModules['ext.narayam.rules.or'] = $narayamTpl + array( |
170 | 171 | 'scripts' => 'ext.narayam.rules.or.js', |
171 | 172 | 'messages' => array( 'narayam-or' ), |