original_string: public function uninstall_language($lang) {
          global $CFG;
  
          $dest1 = $CFG->dataroot.'/lang/'.$lang;
          $dest2 = $CFG->dirroot.'/lang/'.$lang;
          $rm1 = false;
          $rm2 = false;
          if (file_exists($dest1)) {
              $rm1 = remove_dir($dest1);
          }
          if (file_exists($dest2)) {
              $rm2 = remove_dir($dest2);
          }
  
          if ($rm1 or $rm2) {
              $this->info[] = get_string('langpackremoved', 'tool_langimport', $lang);
              event\langpack_removed::event_with_langcode($lang)->trigger();
              return true;
          } else {    // Nothing deleted, possibly due to permission error.
              $this->errors[] = get_string('langpacknotremoved', 'tool_langimport', $lang);
              return false;
          }
      }
code: public function uninstall_language($lang) {
          global $CFG;
  
          $dest1 = $CFG->dataroot.'/lang/'.$lang;
          $dest2 = $CFG->dirroot.'/lang/'.$lang;
          $rm1 = false;
          $rm2 = false;
          if (file_exists($dest1)) {
              $rm1 = remove_dir($dest1);
          }
          if (file_exists($dest2)) {
              $rm2 = remove_dir($dest2);
          }
  
          if ($rm1 or $rm2) {
              $this->info[] = get_string('langpackremoved', 'tool_langimport', $lang);
              event\langpack_removed::event_with_langcode($lang)->trigger();
              return true;
          } else {    // Nothing deleted, possibly due to permission error.
              $this->errors[] = get_string('langpacknotremoved', 'tool_langimport', $lang);
              return false;
          }
      }
code_tokens: public function uninstall_language ( $ lang ) { global $ CFG ; $ dest1 = $ CFG -> dataroot . '/lang/' . $ lang ; $ dest2 = $ CFG -> dirroot . '/lang/' . $ lang ; $ rm1 = false ; $ rm2 = false ; if ( file_exists ( $ dest1 ) ) { $ rm1 = remove_dir ( $ dest1 ) ; } if ( file_exists ( $ dest2 ) ) { $ rm2 = remove_dir ( $ dest2 ) ; } if ( $ rm1 or $ rm2 ) { $ this -> info [ ] = get_string ( 'langpackremoved' , 'tool_langimport' , $ lang ) ; event \ langpack_removed :: event_with_langcode ( $ lang ) -> trigger ( ) ; return true ; } else { // Nothing deleted, possibly due to permission error. $ this -> errors [ ] = get_string ( 'langpacknotremoved' , 'tool_langimport' , $ lang ) ; return false ; } }
docstring: Uninstall language pack
  
  @param string $lang language code
  @return bool true if language succesfull installed
docstring_tokens: Uninstall language pack