22 $translations = $this->dataProvider->getGoodTranslations();
23 $code = $this->handle->getCode();
25 $sourceLanguage = $this->handle->getGroup()->getSourceLanguage();
27 foreach ( $this->
getFallbacks( $code ) as $fallbackCode ) {
28 if ( !isset( $translations[$fallbackCode] ) ) {
32 if ( $fallbackCode === $sourceLanguage ) {
37 'language' => $fallbackCode,
38 'value' => $translations[$fallbackCode],
52 global $wgTranslateLanguageFallbacks;
53 $mwServices = MediaWikiServices::getInstance();
56 $userOptionLookup = $mwServices->getUserOptionsLookup();
57 $preference = $userOptionLookup->getOption( $this->context->getUser(),
'translate-editlangs' );
58 if ( $preference !==
'default' ) {
59 $fallbacks = array_map(
'trim', explode(
',', $preference ) );
60 foreach ( $fallbacks as $k => $v ) {
62 unset( $fallbacks[$k] );
71 if ( isset( $wgTranslateLanguageFallbacks[$code] ) ) {
72 $fallbacks = (array)$wgTranslateLanguageFallbacks[$code];
75 $list = $mwServices->getLanguageFallback()->getAll( $code );
76 $fallbacks = array_merge( $list, $fallbacks );
78 return array_unique( $fallbacks );