14use MediaWiki\MediaWikiServices;
32 $select->setTargetId(
'mw-input-translate-editlangs' );
34 $languages = MediaWikiServices::getInstance()->getLanguageNameUtils()->getLanguageNames();
36 $preferences[
'translate-editlangs'] = [
37 'class' => HTMLJsSelectToInputField::class,
39 'section' =>
'editing/translate',
40 'label-message' =>
'translate-pref-editassistlang',
41 'help-message' =>
'translate-pref-editassistlang-help',
43 'valid-values' => array_keys( $languages ),
44 'name' =>
'translate-editlangs',
55 $lang = RequestContext::getMain()->getLanguage();
56 $languages = MediaWikiServices::getInstance()->getLanguageNameUtils()->getLanguageNames( $lang->getCode() );
59 $selector =
new XmlSelect(
false,
'mw-language-selector' );
60 foreach ( $languages as $code => $name ) {
61 $selector->addOption(
"$code - $name", $code );
Class to add Translate specific preference settings.
static languageSelector()
JavsScript selector for language codes.
static translationAssistLanguages(User $user, &$preferences)
Add 'translate-editlangs' preference.