protected function processLanguage(FileBasedMessageGroup $group, $code) { $cache = new MessageGroupCache($group, $code); $reason = 0; if (!$cache->isValid($reason)) { $this->addMessageUpdateChanges($group, $code, $reason, $cache); if (!isset($this->changes[$code])) { /* Update the cache immediately if file and wiki state match. * Otherwise the cache will get outdated compared to file state * and will give false positive conflicts later. */ $cache->create(); } } }
/** * @param $group MessageGroup */ public function doModLangs($group) { global $wgLang; $languages = array_keys(Language::getLanguageNames(false)); $modified = $codes = array(); foreach ($languages as $code) { if ($code === 'en') { continue; } $cache = new MessageGroupCache($group, $code); if ($cache->isValid()) { continue; } $link = $this->skin->link($this->getTitle(), htmlspecialchars(TranslateUtils::getLanguageName($code, false, $wgLang->getCode()) . " ({$code})"), array(), array('group' => $group->getId(), 'language' => $code)); if (!$cache->exists()) { $modified[] = wfMsgHtml('translate-manage-modlang-new', $link); } else { $modified[] = $link; } $codes[] = $code; } if (count($modified)) { $this->out->addWikiMsg('translate-manage-modlangs', $wgLang->formatNum(count($modified))); if ($this->user->isAllowed('translate-manage')) { $this->out->addHTML($this->rebuildButton($group, $codes, 'import')); } $this->out->addHTML('<ul><li>' . implode("</li>\n<li>", $modified) . '</li></ul>'); } }