/**
  * Finds changes in external sources compared to wiki state.
  *
  * The returned array is as following:
  * - First level is indexed by language code
  * - Second level is indexed by change type:
  * - - addition (new message in the file)
  * - - deletion (message in wiki not present in the file)
  * - - change (difference in content)
  * - Third level is a list of changes
  * - Fourth level is change properties
  * - - key (the message key)
  * - - content (the message content in external source, null for deletions)
  *
  * @param FileBasedMessageGroup $group
  * @param array|string $languages
  * @throws MWException
  * @return array array[language code][change type] = change.
  */
 public function processGroup(FileBasedMessageGroup $group, $languages)
 {
     $this->changes = array();
     if ($languages === self::ALL_LANGUAGES) {
         $languages = $group->getTranslatableLanguages();
         // This means all languages
         if ($languages === null) {
             $languages = TranslateUtils::getLanguageNames('en');
         }
         $languages = array_keys($languages);
     } elseif (!is_array($languages)) {
         throw new MWException('Invalid input given for $languages');
     }
     // Process the source language before others
     $sourceLanguage = $group->getSourceLanguage();
     $index = array_search($sourceLanguage, $languages);
     if ($index !== false) {
         unset($languages[$index]);
         $this->processLanguage($group, $sourceLanguage);
     }
     foreach ($languages as $code) {
         $this->processLanguage($group, $code);
     }
     return $this->changes;
 }