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] ) || $fallbackCode === $sourceLanguage ) {
33 'language' => $fallbackCode,
34 'value' => $translations[$fallbackCode],
48 global $wgTranslateLanguageFallbacks;
49 $mwServices = MediaWikiServices::getInstance();
52 $userOptionLookup = $mwServices->getUserOptionsLookup();
53 $preference = $userOptionLookup->getOption( $this->context->getUser(),
'translate-editlangs' );
54 if ( $preference !==
'default' ) {
55 $fallbacks = array_map(
'trim', explode(
',', $preference ) );
56 foreach ( $fallbacks as $k => $v ) {
58 unset( $fallbacks[$k] );
67 if ( isset( $wgTranslateLanguageFallbacks[$code] ) ) {
68 $fallbacks = (array)$wgTranslateLanguageFallbacks[$code];
71 $list = $mwServices->getLanguageFallback()->getAll( $code );
72 $fallbacks = array_merge( $list, $fallbacks );
74 return array_unique( $fallbacks );