original_string: public function delete($id)
      {
          $this->loadModel('Locale.Languages');
          $language = $this->Languages->get($id);
  
          if (!in_array($language->code, [CORE_LOCALE, option('default_language')])) {
              if ($this->Languages->delete($language)) {
                  $this->Flash->success(__d('locale', 'Language successfully removed!'));
              } else {
                  $this->Flash->danger(__d('locale', 'Language could not be removed, please try again.'));
              }
          } else {
              $this->Flash->danger(__d('locale', 'You cannot remove this language as it still in use.'));
          }
  
          $this->title(__d('locale', 'Delete Language'));
          $this->redirect($this->referer());
      }
code: public function delete($id)
      {
          $this->loadModel('Locale.Languages');
          $language = $this->Languages->get($id);
  
          if (!in_array($language->code, [CORE_LOCALE, option('default_language')])) {
              if ($this->Languages->delete($language)) {
                  $this->Flash->success(__d('locale', 'Language successfully removed!'));
              } else {
                  $this->Flash->danger(__d('locale', 'Language could not be removed, please try again.'));
              }
          } else {
              $this->Flash->danger(__d('locale', 'You cannot remove this language as it still in use.'));
          }
  
          $this->title(__d('locale', 'Delete Language'));
          $this->redirect($this->referer());
      }
code_tokens: public function delete ( $ id ) { $ this -> loadModel ( 'Locale.Languages' ) ; $ language = $ this -> Languages -> get ( $ id ) ; if ( ! in_array ( $ language -> code , [ CORE_LOCALE , option ( 'default_language' ) ] ) ) { if ( $ this -> Languages -> delete ( $ language ) ) { $ this -> Flash -> success ( __d ( 'locale' , 'Language successfully removed!' ) ) ; } else { $ this -> Flash -> danger ( __d ( 'locale' , 'Language could not be removed, please try again.' ) ) ; } } else { $ this -> Flash -> danger ( __d ( 'locale' , 'You cannot remove this language as it still in use.' ) ) ; } $ this -> title ( __d ( 'locale' , 'Delete Language' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
docstring: Unregisters the given language.
  
  @param int $id Language's ID
  @return void Redirects to previous page
docstring_tokens: Unregisters the given language .