Index: trunk/extensions/Translate/lcadft/LCADFT.i18n.php |
— | — | @@ -20,6 +20,9 @@ |
21 | 21 | 'lcadft-email-confirmed' => 'Your e-mail address is confirmed', |
22 | 22 | 'lcadft-email-unconfirmed' => 'Your e-mail address is not confirmed. $1', |
23 | 23 | 'lcadft-email-notset' => 'You have not provided an e-mail address. You can do that in your [[Special:Preferences|preferences]].', |
| 24 | + 'lcadft-languages' => 'Languages', |
| 25 | + 'lcadft-lang' => 'Language #$1', |
| 26 | + 'lcadft-nolang' => 'Choose a language', |
24 | 27 | 'lcadft-contact' => 'Preferred contact methods', |
25 | 28 | 'lcadft-cmethod-email' => 'E-mail', |
26 | 29 | 'lcadft-cmethod-talkpage' => 'Talk page', |
— | — | @@ -43,6 +46,9 @@ |
44 | 47 | 'lcadft-emailstatus' => 'Label', |
45 | 48 | 'lcadft-email-unconfirmed' => 'Parameters: |
46 | 49 | * $1 is a button which can be used to send confirmation email. Button text is {{msg-mw|mediawiki:confirmemail_send}}.', |
| 50 | + 'lcadft-languages' => 'Fieldset header', |
| 51 | + 'lcadft-lang' => 'Label for select, $1 is a numbeer', |
| 52 | + 'lcadft-nolang' => 'First option in a language select', |
47 | 53 | 'lcadft-contact' => 'Fieldset header', |
48 | 54 | 'lcadft-cmethod-email' => 'Check option label', |
49 | 55 | 'lcadft-cmethod-talkpage' => 'Check option label', |
Index: trunk/extensions/Translate/lcadft/SpecialTranslatorSignup.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | ); |
48 | 48 | } |
49 | 49 | public function getDataModel() { |
50 | | - global $wgLCADFTContactMethods; |
| 50 | + global $wgLCADFTContactMethods, $wgLang; |
51 | 51 | |
52 | 52 | $m['username'] = array( |
53 | 53 | 'type' => 'info', |
— | — | @@ -73,6 +73,33 @@ |
74 | 74 | 'raw' => true, |
75 | 75 | ); |
76 | 76 | |
| 77 | + |
| 78 | + $languages = Language::getLanguageNames(); |
| 79 | + ksort( $languages ); |
| 80 | + |
| 81 | + $options = array(); |
| 82 | + foreach ( $languages as $code => $name ) { |
| 83 | + $display = wfBCP47( $code ) . ' - ' . $name; |
| 84 | + $options[$display] = $code; |
| 85 | + } |
| 86 | + |
| 87 | + $options = array( wfMessage( 'lcadft-nolang' )->plain() => '' ) + $options; |
| 88 | + |
| 89 | + for ( $i = 1; $i < 4; $i++ ) { |
| 90 | + $m["lang-$i"] = array( |
| 91 | + 'type' => 'select', |
| 92 | + 'label-message' => array( "lcadft-lang", $wgLang->formatNum( $i ) ), |
| 93 | + 'section' => 'languages', |
| 94 | + 'options' => $options, |
| 95 | + 'default' => $user->getOption( "lcadft-lang-$i" ), |
| 96 | + ); |
| 97 | + |
| 98 | + if ( $i === 1 ) { |
| 99 | + $m["lang-$i"]['default'] = $user->getOption( "lcadft-lang-$i", $wgLang->getCode() ); |
| 100 | + $m["lang-$i"]['required'] = true; |
| 101 | + } |
| 102 | + } |
| 103 | + |
77 | 104 | foreach ( $wgLCADFTContactMethods as $method => $value ) { |
78 | 105 | if ( $value === false ) { |
79 | 106 | continue; |