Skip to content

Commit

Permalink
Merge pull request mozilla-l10n#95 from flodolo/rss_errors
Browse files Browse the repository at this point in the history
Add web project's errors to RSS feed
  • Loading branch information
pascalchevrel committed Jun 10, 2015
2 parents b23c43c + 2c3e56f commit 80f63e4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions models/locale.php
Expand Up @@ -207,12 +207,18 @@
$tmp_message = '';
foreach ($available_products as $product_code => $product_name) {
$webproject = $webprojects['locales'][$locale][$product_code];
if ($webproject['missing'] + $webproject['untranslated'] > 0) {
$webproject_errors = $webproject['error_status'];
$webproject_incomplete = $webproject['missing'] + $webproject['untranslated'] > 0;
if ($webproject_incomplete || $webproject_errors) {
// Web project is incomplete (either missing or untranslated strings)
$tmp_message .= "<p><strong>{$webproject['name']}:</strong> {$webproject['missing']} missing ";
$tmp_message .= $webproject['missing'] == 1 ? 'string, ' : 'strings, ';
$tmp_message .= "{$webproject['untranslated']} untranslated ";
$tmp_message .= $webproject['untranslated'] == 1 ? 'string, ' : 'strings.';
$tmp_message .= "<p><strong>{$webproject['name']}</strong><br/>";
$tmp_message .= "{$webproject['missing']} missing ";
$tmp_message .= $webproject['missing'] == 1 ? 'string' : 'strings';
$tmp_message .= ", {$webproject['untranslated']} untranslated ";
$tmp_message .= $webproject['untranslated'] == 1 ? 'string.' : 'strings.';
if ($webproject_errors) {
$tmp_message .= '<br/>' . htmlspecialchars($webproject['error_message']);
}
$tmp_message .= '</p>';
}
}
Expand Down

0 comments on commit 80f63e4

Please sign in to comment.