aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2014-08-04 19:12:15 +0200
committerfilip <filip.komar@gmail.com>2014-08-04 19:12:15 +0200
commit491271239463e59b1561bc94efe28dbc17b5f931 (patch)
tree6a96cf62f8d990881bc8701d8fa750fe1b335203
parent10b4de915588b381c94bed83b777ebbe953d8cba (diff)
downloadwww-491271239463e59b1561bc94efe28dbc17b5f931.tar
www-491271239463e59b1561bc94efe28dbc17b5f931.tar.gz
www-491271239463e59b1561bc94efe28dbc17b5f931.tar.bz2
www-491271239463e59b1561bc94efe28dbc17b5f931.tar.xz
www-491271239463e59b1561bc94efe28dbc17b5f931.zip
minor improvements of diff.php + better consistency with missing.php
-rw-r--r--langs/diff.php29
1 files changed, 16 insertions, 13 deletions
diff --git a/langs/diff.php b/langs/diff.php
index f86038f41..9986bf1b2 100644
--- a/langs/diff.php
+++ b/langs/diff.php
@@ -59,19 +59,19 @@ if (false === strstr($source_file_path, '/langs/') ||
$diff = _po_diff($target_lang, $resource);
$issues = array(
- 'missing' => 'missing strings',
- 'fuzzy_or_missing' => 'fuzzy or missing strings',
- 'notrans' => 'untranslated strings',
- 'extra' => 'unused (old) strings',
- 'dup_str' => 'duplicate strings',
+ 'missing' => 'missing string',
+ 'fuzzy_or_missing' => 'fuzzy or missing string',
+ 'notrans' => 'untranslated string',
+ 'extra' => 'unused (old) string',
+ 'dup_str' => 'duplicate string',
);
$s = '<a href="report.php?l=' . $target_lang . '">&laquo; back to the report page for ' . $langs[$target_lang] . '</a>';
$s .= sprintf('<h1>Differences between %s source and %s target</h1>',
$source_file, $target_lang);
-$s .= '<p>You can translate most of our web page resources online in <a href="http://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/' . $target_lang . '/#1/?c=Webpages">Transifex</a>.';
-$s .= ' More info in our <a href="https://wiki.mageia.org/en/Internationalisation_Team_%28i18n%29#Website_translation">Wiki</a>.</p>';
+$s .= '<p>You can translate most of our web page resources online in <a href="http://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/' . $target_lang . '/#1/?c=Webpages">Transifex</a>.</p>';
+$s .= '<p>Please take a look off the translation guide on the <a href="https://wiki.mageia.org/en/Internationalisation_Team_(i18n)#Website_translation">localization Wiki page</a> too.</p>';
$additional_file = '';
@@ -95,9 +95,9 @@ if($license) {
$license_numbers = array_pop($license_array);
$num_of_untranslated_strings = $license_numbers["untran"]; // number of all license sentences
$diff['untranslated_sentences_in_license'] = $license_numbers['untranslated_sentences']; // add untranslated license sentences
- $s .= '<h2 style="color: red;">Please translate license fully into ' . $langs[$target_lang] . ' first</h2>';
- $s .= sprintf('<p>You can find it in <a href="http://gitweb.mageia.org/software/drakx/tree/perl-install/share/po/%s.po">git</a>. ', $target_lang); // git doesn't work yet on https
- $issues['untranslated_sentences_in_license'] = 'untranslated msgid strings in ' . $num_of_untranslated_strings . ' license sentences as part of a separate <a href="http://gitweb.mageia.org/software/drakx/tree/perl-install/share/po/' . $target_lang . '.po">drakx file</a> (look below line 4 500)';
+ $s .= '<h2 style="color: red;">Please translate <a href="http://gitweb.mageia.org/software/drakx/tree/perl-install/share/po/' . $target_lang . '.po">separate license file</a> fully into ' . $langs[$target_lang] . ' first</h2>';
+ $s .= sprintf('<p>You can find it as a part of a separate <a href="http://gitweb.mageia.org/software/drakx/tree/perl-install/share/po/' . $target_lang . '.po">drakx translation file in git</a> or in <a href="https://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/' . $target_lang . '/#1/?s=drakx_share">Transifex</a>. ', $target_lang); // git doesn't work yet on https
+ $issues['untranslated_sentences_in_license'] = 'untranslated msgid strings in ' . $num_of_untranslated_strings . ' license sentences as a part of a separate <a href="http://gitweb.mageia.org/software/drakx/tree/perl-install/share/po/' . $target_lang . '.po">drakx translation file</a> (it starts before the line with the string "1. License Agreement")';
}
if($constitution || $license) {
@@ -107,15 +107,16 @@ if($constitution || $license) {
$s .= '<p>After translation:</p>';
$s .= "\t<ul>";
$s .= "\t\t<li>if you're in <a href=\"http://people.mageia.org/g/mga-i18n-committers.html\">mga-i18n-committers group</a>,";
-$s .= " you may commit updated po file directly in <code>$commit</code>$note</li>";
+$s .= " you may commit updated po file directly in <code>$commit.</code>$note</li>";
$s .= "\t\t<li>or attach it to a mail to <a href=\"https://ml.mageia.org/l/info/i18n-discuss\">Mageia localization team</a> (<code>mageia-i18n</code>, <a href=\"irc://irc.freenode.net/#mageia-i18n\">#mageia-i18n</a> on Freenode).</li>";
$s .= $additional_file;
$s .= "\t</ul>";
$new_line = "\n\n";
+$filename = ' in ' . $commit; // $file
+$title_prefix = 'Report found ';
foreach ($issues as $type => $name) {
if (isset($diff[$type]) && count($diff[$type]) > 0) {
- $filename = ' in ' . $commit; // $file
if ($type == 'untranslated_lines_in_constitution') {
$prefix = '';
$new_line = "\n";
@@ -126,11 +127,13 @@ foreach ($issues as $type => $name) {
} else {
$prefix = ';';
}
- $s .= sprintf('<h2>%d %s%s:</h2>', count($diff[$type]), $name, $filename);
+ $s .= sprintf('<h2>%s %d %s%s:</h2>', $title_prefix, count($diff[$type]), $name . ((count($diff[$type]) > 1) ? 's' : ''), $filename);
$s .= '<pre>';
foreach ($diff[$type] as $l)
$s .= sprintf("%s%s%s", $prefix, rtrim(htmlspecialchars($l)), $new_line); // cut at 200: substr(rtrim(htmlspecialchars($l)), 0, 200)
$s .= '</pre>';
+ $filename = '';
+ $title_prefix = 'and also ';
}
}