22 public function __construct( IContextSource $context,
MessageGroup $group,
string $language ) {
23 $this->setContext( $context );
24 $this->group = $group;
25 if ( Language::isKnownLanguageTag( $language ) ) {
26 $this->language = $language;
28 $this->language = $context->getLanguage()->getCode();
32 public function fullTable():
string {
34 Hooks::run(
'TranslateBeforeAddModules', [ &$modules ] );
35 $this->getOutput()->addModules( $modules );
37 $sourceLang = Language::factory( $this->group->getSourceLanguage() );
38 $targetLang = Language::factory( $this->language );
41 $list = Html::element(
'div', [
42 'class' =>
'row tux-messagelist',
43 'data-grouptype' => get_class( $this->group ),
44 'data-sourcelangcode' => $sourceLang->getCode(),
45 'data-sourcelangdir' => $sourceLang->getDir(),
46 'data-targetlangcode' => $targetLang->getCode(),
47 'data-targetlangdir' => $targetLang->getDir(),
50 $groupId = htmlspecialchars( $this->group->getId() );
51 $msg = $this->msg(
'tux-messagetable-loading-messages' )
52 ->numParams( $batchSize )
56<div
class=
"tux-messagetable-loader hide" data-messagegroup=
"$groupId" data-pagesize=
"$batchSize">
57 <span
class=
"tux-loading-indicator"></span>
58 <div
class=
"tux-messagetable-loader-info">$msg</div>
62 $hideOwn = $this->msg(
'tux-editor-proofreading-hide-own-translations' )->escaped();
63 $clearTranslated = $this->msg(
'tux-editor-clear-translated' )->escaped();
64 $modeTranslate = $this->msg(
'tux-editor-translate-mode' )->escaped();
65 $modePage = $this->msg(
'tux-editor-page-mode' )->escaped();
66 $modeProofread = $this->msg(
'tux-editor-proofreading-mode' )->escaped();
69<div
class=
"tux-action-bar hide row">
70 <div
class=
"three columns tux-message-list-statsbar" data-messagegroup=
"$groupId"></div>
71 <div
class=
"three columns text-center">
72 <button
class=
"toggle button tux-proofread-own-translations-button hide">
75 <button
class=
"toggle button tux-editor-clear-translated hide">$clearTranslated</button>
77 <div
class=
"six columns tux-view-switcher text-center">
78 <button
class=
"toggle down translate-mode-button">$modeTranslate
79 </button><button
class=
"toggle down page-mode-button">$modePage
80 </button><button
class=
"toggle hide proofread-mode-button">$modeProofread
88 return $list . $loader . $actionbar;