From 9ce6d646ff718cd62f6434c9a4c94e450436612a Mon Sep 17 00:00:00 2001 From: Thomas Backlund Date: Sun, 12 Oct 2014 12:27:45 +0300 Subject: Revert "Updated Estonian translation" This reverts commit a0b2d09125d7911656fe4cb286f20643c4432281. --- langs/diff.php | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 langs/diff.php (limited to 'langs/diff.php') diff --git a/langs/diff.php b/langs/diff.php new file mode 100644 index 000000000..9986bf1b2 --- /dev/null +++ b/langs/diff.php @@ -0,0 +1,157 @@ + NOTE: THIS IS TRANSLATION OF NAVIGATION SO LOCATION FOR COMMIT IS DIFFERENT!'; + $commit = '/langs/' . $file . ''; +} else { + $file = $target_file; + $note = ''; + $commit = '/langs/' . $file . ''; +} + +$source_file_path = realpath($source_file); +$target_file_path = realpath($target_file); + +if (false === strstr($source_file_path, '/langs/') || + false === strstr($target_file_path, '/langs/')) { + die('no sorry'); +} + +$diff = _po_diff($target_lang, $resource); + +$issues = array( + 'missing' => 'missing string', + 'fuzzy_or_missing' => 'fuzzy or missing string', + 'notrans' => 'untranslated string', + 'extra' => 'unused (old) string', + 'dup_str' => 'duplicate string', +); + +$s = '« back to the report page for ' . $langs[$target_lang] . ''; +$s .= sprintf('

Differences between %s source and %s target

', + $source_file, $target_lang); + +$s .= '

You can translate most of our web page resources online in Transifex.

'; +$s .= '

Please take a look off the translation guide on the localization Wiki page too.

'; + +$additional_file = ''; + +if($constitution) { + $s .= '

Please translate constitution fully into ' . $langs[$target_lang] . ' first

'; + $s .= '

You can find it in git. '; + + $constitution_results = aproximate_number_of_untranslated_constitution_lines(G_APP_ROOT, 'en'); + $unique_lines_in_eng_constitution = $constitution_results['unique_lines_in_constitution']; + $lang_constitution_results = aproximate_number_of_untranslated_constitution_lines(G_APP_ROOT, $target_lang, $unique_lines_in_eng_constitution); + $constitution_readable = $lang_constitution_results['constitution_readable']; + $diff['untranslated_lines_in_constitution'] = $lang_constitution_results['untranslated_lines_in_constitution']; // add untranslated license sentences + $dest_constitution = sprintf('%s/%s_%s.md"', 'href="http://gitweb.mageia.org/web/www/tree/en/about/constitution', 'mageia.org_statutes', ($constitution_readable ? $target_lang : 'en')); + $issues['untranslated_lines_in_constitution'] = 'of all untranslated lines in separate constitution md format file'; + $additional_file = "\t\t

  • same goes for constitution
  • "; +} + +if($license) { + require_once('../en/about/license/license.php'); + $license_array = read_license_from_vcs($target_lang); + $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 .= '

    Please translate separate license file fully into ' . $langs[$target_lang] . ' first

    '; + $s .= sprintf('

    You can find it as a part of a separate drakx translation file in git or in Transifex. ', $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 drakx translation file (it starts before the line with the string "1. License Agreement")'; +} + +if($constitution || $license) { + $s .= 'Please read page on wiki for more information about that.

    '; +} + +$s .= '

    After translation:

    '; +$s .= "\t"; + +$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) { + if ($type == 'untranslated_lines_in_constitution') { + $prefix = ''; + $new_line = "\n"; + $filename = ''; + } else if ($type == 'untranslated_sentences_in_license') { + $prefix = 'msgid: '; + $filename = ''; + } else { + $prefix = ';'; + } + $s .= sprintf('

    %s %d %s%s:

    ', $title_prefix, count($diff[$type]), $name . ((count($diff[$type]) > 1) ? 's' : ''), $filename); + $s .= '
    ';
    +        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 .= '
    '; + $filename = ''; + $title_prefix = 'and also '; + } +} + +header('Content-Type: text/html;charset=utf-8'); + +?> + + + + + Differences between %s source and %s target', + $source_file, $target_lang); ?> + + + + +
    + + -- cgit v1.2.1