Пример #1
0
     $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";
         }
     }
 }
Пример #2
0
         if (!$website_with_errors) {
             $website_with_errors = true;
             $locale_htmloutput .= $opening_div;
         }
         $locale_htmloutput .= "        <p>Repository: <a href='{$repo}'>{$repo}</a></p>\n";
         $locale_htmloutput .= "        <div class='file_container' id='{$current_filename}'>\n";
         $locale_htmloutput .= "          <h3 class='filename'><a href='#{$current_filename}'>{$current_filename}</a></h3>\n";
         $locale_htmloutput .= "          <h3>Errors in variables in the sentence:</h3>\n";
         $locale_htmloutput .= "          <ul>\n";
         foreach ($locale_analysis['errors']['python'] as $stringid => $python_error) {
             $locale_htmloutput .= "              <table class='python'>\n                    <tr>\n                      <th>Check the following variables: <strong style='color:red'>{$python_error['var']}</strong></th>\n                    </tr>\n                    <tr>\n                      <td>" . Utils::highlightPythonVar($stringid) . "</td>\n                    </tr>\n                    <tr>\n                      <td>" . Utils::highlightPythonVar($python_error['text']) . "</td>\n                    </tr>\n                  </table>\n";
         }
         $locale_htmloutput .= "          </ul>\n";
         $locale_htmloutput .= "        </div>\n";
     }
     if (LangManager::countErrors($locale_analysis['errors'], 'length')) {
         if (!$website_with_errors) {
             $website_with_errors = true;
             $locale_htmloutput .= $opening_div;
         }
         $locale_htmloutput .= "\n    <h3>{$current_filename}</h3><p>Some strings are longer than allowed:</p>\n";
         $locale_htmloutput .= "    <ul>\n";
         foreach ($locale_analysis['errors']['length'] as $stringid => $length_error) {
             $locale_htmloutput .= "<li>" . htmlspecialchars($length_error['text']) . "<br/><em>Currently {$length_error['current']} characters long (maximum allowed {$length_error['limit']})</em></li>";
         }
         $locale_htmloutput .= "    </ul>\n";
     }
 }
 // Check if the lang file is not in UTF-8 or US-ASCII
 if (Utils::isUTF8($locale_filename) == false) {
     if (!$website_with_errors) {