Debian Codegraph @

vendor/wikimedia/parsoid/src/Language/ZhConverter.php

raw
1 <?php
2 declare( strict_types = 1 );
3
4 namespace Wikimedia\Parsoid\Language;
5
6 use Wikimedia\LangConv\ZhReplacementMachine;
7
8 /* @note: Use of this class is currently disabled in production, see T346657 */
9 class ZhConverter extends LanguageConverter {
10
11 public function loadDefaultTables() {
12 $this->setMachine( new ZhReplacementMachine() );
13 }
14
15 // phpcs:ignore MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
16 public function findVariantLink( $link, $nt, $ignoreOtherCond ) {
17 $ns = $nt->getNamespace();
18 // do not try to find variants for usernames
19 if ( $ns->isUser() || $ns->isUserTalk ) {
20 return [ 'nt' => $nt, 'link' => $link ];
21 }
22 // FIXME check whether selected language is 'zh'
23 return parent::findVariantLink( $link, $nt, $ignoreOtherCond );
24 }
25 }