20 protected string $language;
22 public function __construct( IContextSource $context,
MessageGroup $group,
string $language ) {
23 $this->setContext( $context );
24 $this->group = $group;
25 if ( MediaWikiServices::getInstance()->getLanguageNameUtils()->isKnownLanguageTag( $language ) ) {
26 $this->language = $language;
28 $this->language = $context->getLanguage()->getCode();
32 public function fullTable():
string {
34 Services::getInstance()->getHookRunner()->onTranslateBeforeAddModules( $modules );
35 $this->getOutput()->addModules( $modules );
37 $languageFactory = MediaWikiServices::getInstance()->getLanguageFactory();
38 $sourceLang = $languageFactory->getLanguage( $this->group->getSourceLanguage() );
39 $targetLang = $languageFactory->getLanguage( $this->language );
42 $list = Html::element(
'div', [
43 'class' =>
'row tux-messagelist',
44 'data-grouptype' => get_class( $this->group ),
45 'data-sourcelangcode' => $sourceLang->getCode(),
46 'data-sourcelangdir' => $sourceLang->getDir(),
47 'data-targetlangcode' => $targetLang->getCode(),
48 'data-targetlangdir' => $targetLang->getDir(),
51 $groupId = htmlspecialchars( $this->group->getId() );
52 $msg = $this->msg(
'tux-messagetable-loading-messages' )
53 ->numParams( $batchSize )
58 <div
class=
"tux-messagetable-loader hide" data-messagegroup=
"$groupId" data-pagesize=
"$batchSize">
59 <span
class=
"tux-loading-indicator"></span>
60 <div
class=
"tux-messagetable-loader-info">$msg</div>
64 $hideOwn = $this->msg(
'tux-editor-proofreading-hide-own-translations' )->escaped();
65 $clearTranslated = $this->msg(
'tux-editor-clear-translated' )->escaped();
66 $modeTranslate = $this->msg(
'tux-editor-translate-mode' )->escaped();
67 $modePage = $this->msg(
'tux-editor-page-mode' )->escaped();
68 $modeProofread = $this->msg(
'tux-editor-proofreading-mode' )->escaped();
72 <div
class=
"tux-action-bar hide row">
73 <div
class=
"three columns tux-message-list-statsbar" data-messagegroup=
"$groupId"></div>
74 <div
class=
"three columns text-center">
75 <button
class=
"toggle button tux-proofread-own-translations-button hide">
78 <button
class=
"toggle button tux-editor-clear-translated hide">$clearTranslated</button>
80 <div
class=
"six columns tux-view-switcher text-center">
81 <button
class=
"toggle down translate-mode-button">$modeTranslate
82 </button><button
class=
"toggle down page-mode-button">$modePage
83 </button><button
class=
"toggle hide proofread-mode-button">$modeProofread
91 return $list . $loader . $actionbar;