Пример #1
0
 $reference_data = LangManager::loadSource($current_website, $reference_locale, $current_filename);
 $supported_locales = Project::getSupportedLocales($current_website, $current_filename, $langfiles_subsets);
 foreach ($supported_locales as $current_locale) {
     if ($current_locale == $reference_locale) {
         // Ignore reference language
         continue;
     }
     if (!file_exists(Project::getLocalFilePath($current_website, $current_locale, $current_filename))) {
         // If the .lang file does not exist, just skip the locale for this file
         continue;
     }
     if (Project::isObsoleteFile($current_website, $current_filename, $current_locale)) {
         // If the .lang file is obsolete, skip it
         continue;
     }
     $locale_analysis = LangManager::analyzeLangFile($current_website, $current_locale, $current_filename, $reference_data);
     $todo = count($locale_analysis['Identical']) + count($locale_analysis['Missing']) + LangManager::countErrors($locale_analysis['errors']);
     $activation_status = $locale_analysis['activated'] ? 'yes' : 'no';
     if ($todo == 0 && $activation_status == 'no') {
         $svn_path = 'http://viewvc.svn.mozilla.org/vc/projects/mozilla.com/trunk/locales/' . $current_locale . '/' . $current_filename;
         $table_rows .= "  <tr>\n";
         $table_rows .= '    <td><a href="./?locale=' . $current_locale . '" title="See full status of this locale">' . $current_locale . "</a></td>\n";
         $table_rows .= '    <td><a href="' . $svn_path . '" target="_blank" title="Open this file on SVN">' . $current_filename . "</a></td>\n";
         $table_rows .= '    <td>' . count($locale_analysis['Identical']) . "</td>\n";
         $table_rows .= '    <td>' . count($locale_analysis['Translated']) . "</td>\n";
         $table_rows .= '    <td>' . count($locale_analysis['Missing']) . "</td>\n";
         $table_rows .= '    <td>' . count($locale_analysis['Obsolete']) . "</td>\n";
         $table_rows .= '    <td>' . $activation_status . "</td>\n";
         $table_rows .= "  </tr>\n";
     }
 }