From 268da1986e106fd8763beea61bfe0fff75ee97ee Mon Sep 17 00:00:00 2001
From: Filip Komar You can find it in svn. ';
+ $s .= ' You can find it in svn. ';
}
+$num_of_untranslated_strings = 0;
if($license) {
- $s .= ' You can find it in git (file %s.po). ', $target_lang); // git doesn't work yet on https
+ require_once('../en/about/license/license.php');
+ $license_numbers = array_pop(read_license_from_vcs($target_lang));
+ $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 .= ' You can find it in git. ', $target_lang); // git doesn't work yet on https
}
if($constitution || $license) {
- $s .= 'Please read page on wiki for more information about that.
', ' ');
foreach($license_strings as $value) {
@@ -50,10 +51,11 @@ function read_license_from_vcs($locale) {
$license_string = $po_file[$value[0]]["msgstr"][0];
} else {
$num_of_untranslated_sentences += $count;
+ $untranslated_sentences[] = $value[0];
$license_string = $value[0];
}
$license_string = str_replace('%s', (isset($value[2]) ? $value[2] : ''), $license_string);
- $prepared_license_strings[] = array(str_replace($search, $replace, $license_string), (isset($value[1]) ? $value[1] : 'p'), 'untran' => $num_of_untranslated_sentences, 'all' => $num_of_sentences_for_translation);
+ $prepared_license_strings[] = array(str_replace($search, $replace, $license_string), (isset($value[1]) ? $value[1] : 'p'), 'untran' => $num_of_untranslated_sentences, 'all' => $num_of_sentences_for_translation, 'untranslated_sentences' => $untranslated_sentences);
}
return $prepared_license_strings;
diff --git a/langs/diff.php b/langs/diff.php
index 948243cbf..9e5484a2f 100644
--- a/langs/diff.php
+++ b/langs/diff.php
@@ -26,15 +26,25 @@ if (!file_exists($target_file)) {
}
if($source_file =='en/about/constitution.en.lang') {
- $constitution = true;
+ $constitution = true;
} else {
- $constitution = false;
+ $constitution = false;
}
if($source_file =='en/about/license.en.lang') {
- $license = true;
+ $license = true;
} else {
- $license = false;
+ $license = false;
+}
+
+if ($source_file == '../_nav/langs/en.lang') {
+ $file = substr(_lang_file_switch($source_file, $target_lang), 14);
+ $note = ' NOTE: THIS IS TRANSLATION OF NAVIGATION SO LOCATION FOR COMMIT IS DIFFERENT!';
+ $commit = 'web/www/trunk/_nav/langs/' . $file . ' and for now to the web/nav/langs/' . $file . ' too';
+} else {
+ $file = _lang_file_switch($source_file, $target_lang);
+ $note = '';
+ $commit = 'web/www/trunk/langs/' . $file . '';
}
$source_file = realpath($source_file);
@@ -45,7 +55,6 @@ if (false === strstr($source_file, '/langs/') ||
die('no sorry');
}
-
$diff = _lang_diff($source_file, $target_file);
$s = '« back to langs report';
@@ -53,25 +62,38 @@ $s .= sprintf('Differences between %s source and %s target
',
substr($source_file, strpos($source_file, '/langs/')+7), $target_lang);
if($constitution) {
- $s .= 'Please translate constitution first
';
- $s .= 'Please translate constitution first
';
+ $s .= 'Please translate license first
';
- $s .= sprintf('Please translate license into ' . $langs[$target_lang] . ' first
';
+ $s .= sprintf('
After translation:
+' . $commit . '
. ' . $note . 'mageia-i18n
, #mageia-i18n on Freenode).'; + $prefix = (($type == 'untranslated_sentences_in_license') ? 'msgid: ' : ';'); foreach ($diff[$type] as $l) - $s .= sprintf(";%s\n\n", htmlspecialchars($l)); + $s .= sprintf("%s%s\n\n", $prefix, htmlspecialchars($l)); $s .= ''; } } @@ -83,6 +105,8 @@ header('Content-Type: text/html;charset=utf-8'); + Differences between %s source and %s target', + substr($source_file, strpos($source_file, '/langs/')+7), $target_lang); ?> diff --git a/langs/missing.php b/langs/missing.php index 0514be1c3..44016693a 100644 --- a/langs/missing.php +++ b/langs/missing.php @@ -12,6 +12,18 @@ if (is_null($s)) { include 'lib.php'; +if($s =='en/about/constitution.en.lang') { + $constitution = true; +} else { + $constitution = false; +} + +if($s =='en/about/license.en.lang') { + $license = true; +} else { + $license = false; +} + if ($s == '../_nav/langs/en.lang') { $file = substr(_lang_file_switch($s, $l), 14); $note = ' NOTE: THIS IS TRANSLATION OF NAVIGATION SO LOCATION FOR COMMIT IS DIFFERENT!'; @@ -24,18 +36,35 @@ if ($s == '../_nav/langs/en.lang') { $iframe = '//www.mageia.org/langs/'.$s; } +$constitution_or_license = ''; +if($constitution) { + $constitution_or_license .= '
You can find it in svn. '; +} + +$num_of_untranslated_strings = 0; +if($license) { + $constitution_or_license .= '
You can find it in git. ', $target_lang); // git doesn't work yet on https +} + +if($constitution || $license) { + $constitution_or_license .= 'Please read page on wiki for more information about that.
Then:
'; +} + ?> +So, language file is missing in ', $l, ')' ?>. What can you do to help us?
.