aboutsummaryrefslogtreecommitdiffstats
path: root/langs/missing.php
blob: 952232704c9b1099e630d8902f9b7fdbc52a195d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
*/

include 'lib.php';

$s = isset($_GET['s']) ? strip_tags(trim($_GET['s'])) : null;
$l = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : null;

if (is_null($s)) {
    header('Location: /langs/report.php');
    die;
}

if (strrpos($s, '.pot')) {
    $gettext  = true;
    $resource = _extract_resource($s);
    $file     = _po_file_switch($s, $l);
    $to_translate  = '<a href="/langs/' . $s . '">/langs/' .$s . '</a>';
} else {
    $gettext  = false;
    $resource = _extract_resource($s, '.en.lang');
    $file     = _lang_file_switch($s, $l);
    $to_translate  = '<iframe src="//' . $_SERVER['SERVER_NAME'] .'/langs/'. $s . '" style="width: 60em; height: 30em;"></iframe>';
}

if($resource =='constitution') {
    $constitution = true;
} else {
    $constitution = false;
}

if($resource =='license') {
    $license = true;
} else {
    $license = false;
}

if ($s == '../_nav/langs/en.lang') {
    $file   = substr(_lang_file_switch($s, $l), 14);
    $note   = '<span style="color: red; font-weight: bold"> NOTE: THIS IS TRANSLATION OF NAVIGATION SO LOCATION FOR COMMIT IS DIFFERENT!</span>';
    $commit = '<a href="//svnweb.mageia.org/web/www/trunk/_nav/langs/">web/www/trunk/_nav/langs/</a>' . $file . ' and for now to the <a href="//svnweb.mageia.org/web/nav/langs/">web/nav/langs/</a>' . $file . ' too';
    $to_translate  = '<iframe src="//' . $_SERVER['SERVER_NAME'] .'/_nav/langs/en.lang" style="width: 60em; height: 30em;"></iframe>';
} else {
    $note   = '';
    $commit = '<a href="//svnweb.mageia.org/web/www/trunk/langs/">web/www/trunk/langs</a>/' . $file;
}

$constitution_or_license = '';
if($constitution) {
    $constitution_or_license .= '<h2 style="color: red;">Please translate constitution first</h2>';
    $constitution_or_license .= '<p>You can find it in <a href="//svnweb.mageia.org/org/constitution/">svn</a>. ';
}

$num_of_untranslated_strings = 0;
if($license) {
    $constitution_or_license .= '<h2 style="color: red;">Please translate license into ' . $langs[$l] . ' first</h2>';
    $constitution_or_license .= sprintf('<p>You can find it in <a href="http://gitweb.mageia.org/software/drakx/tree/perl-install/share/po/%s.po">git</a>. ', $l); // git doesn't work yet on https
}

if($constitution || $license) {
    $constitution_or_license .= 'Please read <a href="https://wiki.mageia.org/en/Internationalisation_Team_%28i18n%29#Special_cases_of_web_pages">page on wiki for more information</a> about that.</p><p>Then:</p>';
}

?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="robots" content="noindex,nofollow,nosnippet">
    <title>Missing language file</title>
</head>
<body>

<p><a href="report.php<?php echo '?l=' . $l ?>">&laquo; back to the report page for <?php echo $langs[$l] ?></a></p>
<h1>Missing language file</h1>
<p>So, <code><?php echo $file ?></code> language file is missing in <?php echo $langs[$l], ' (<code>', $l, '</code>)' ?>. What can you do to help us?</p>
<?php echo $constitution_or_license; ?>
<ol>
<?php
if ($gettext) {
    echo '    <li>Copy the source file ' . $to_translate . ' in gettext editor of your choice and rename it to <code>' . $file . '</code>.' . $note . '</li>' . PHP_EOL;
    echo '    <li>You can also translate directly on our <a href="https://www.transifex.com/projects/p/mageia/language/' . $l . '/">project in transifex</a>.</li>' . PHP_EOL;
    $to_translate = ''; // don't show it bellow
} else {
    echo '    <li>Copy the source file from the frame below in a text editor and rename it to <code>' . $file . '</code>.' . $note . '</li>' . PHP_EOL;
    echo '    <li>Replace and translate the strings that are just after the lines starting with a ";". Be careful to always keep your translated text on a single line.</li>' . PHP_EOL;
} ?>
    <li>Then:
        <ul>
            <li>if you have a SVN account, you may commit it directly in <code><?php echo $commit ?></code>;</li>
            <li>or attach it to a mail to Mageia localization team (<code>mageia-i18n</code>, <a href="irc://irc.freenode.net/#mageia-i18n">#mageia-i18n</a> on Freenode).</li>
        </ul>
    </li>
    <li>You can look to the translation guide on the <a href="https://wiki.mageia.org/en/Internationalisation_Team_(i18n)#Website_translation">localization Wiki page</a> too.</li>
</ol>

<p>Thanks!</p>
<?php echo $to_translate ?>
<hr>
</body>
</html>