locale_uninstall()
Implements hook_uninstall().
File
- core/modules/locale/locale.install, line 26
- Install, update, and uninstall functions for the Locale module.
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | function locale_uninstall() { $config = \Drupal::config( 'locale.settings' ); // Delete all JavaScript translation files. if ( is_dir ( $locale_js_directory )) { $locale_javascripts = \Drupal::state()->get( 'locale.translation.javascript' ) ? : array (); foreach ( $locale_javascripts as $langcode => $file_suffix ) { if (! empty ( $file_suffix )) { file_unmanaged_delete( $locale_js_directory . '/' . $langcode . '_' . $file_suffix . '.js' ); } } // Delete the JavaScript translations directory if empty. if (!file_scan_directory( $locale_js_directory , '/.*/' )) { drupal_rmdir( $locale_js_directory ); } } // Clear variables. \Drupal::state()-> delete ( 'system.javascript_parsed' ); \Drupal::state()-> delete ( 'locale.translation.plurals' ); \Drupal::state()-> delete ( 'locale.translation.javascript' ); } |
Please login to continue.