language_tour_tips_alter(array &$tour_tips, EntityInterface $entity)
Implements hook_tour_tips_alter().
File
- core/modules/language/language.module, line 451
- Add language handling functionality to Drupal.
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | function language_tour_tips_alter( array & $tour_tips , EntityInterface $entity ) { foreach ( $tour_tips as $tour_tip ) { if ( $tour_tip ->get( 'id' ) == 'language-overview' ) { $additional_overview = '' ; if (Drupal::service( 'module_handler' )->moduleExists( 'locale' )) { $additional_overview = t( "This page also provides an overview of how much of the site's interface has been translated for each configured language." ); } else { $additional_overview = t( "If the Interface Translation module is enabled, this page will provide an overview of how much of the site's interface has been translated for each configured language." ); } $tour_tip ->set( 'body' , $tour_tip ->get( 'body' ) . '<p>' . $additional_overview . '</p>' ); } elseif ( $tour_tip ->get( 'id' ) == 'language-continue' ) { $additional_continue = '' ; $additional_modules = array (); if (!Drupal::service( 'module_handler' )->moduleExists( 'locale' )) { $additional_modules [] = Drupal::service( 'module_handler' )->getName( 'locale' ); } if (!Drupal::service( 'module_handler' )->moduleExists( 'content_translation' )) { $additional_modules [] = Drupal::service( 'module_handler' )->getName( 'content_translation' ); } if (! empty ( $additional_modules )) { $additional_continue = t( 'Depending on your site features, additional modules that you might want to enable are:' ) . '<ul>' ; foreach ( $additional_modules as $additional_module ) { $additional_continue .= '<li>' . $additional_module . '</li>' ; } $additional_continue .= '</ul>' ; } if (! empty ( $additional_continue )) { $tour_tip ->set( 'body' , $tour_tip ->get( 'body' ) . '<p>' . $additional_continue . '</p>' ); } } } } |
Please login to continue.