aboutsummaryrefslogtreecommitdiffstats
path: root/langs/missing.php
blob: 345e9035e8e2832faa2ec2a340116b049f1f6261 (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
<?php
/**
*/
define('HLANG', true);
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;
}

$resource = _extract_resource($s);
$to_translate  = '<a href="/langs/' . $s . '">/langs/' .$s . '</a>';

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

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

if ($s == '../_nav/langs/en.pot') {
    $file   = substr(_po_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="http://gitweb.mageia.org/web/nav/tree/langs/' . $file . '">/_nav/langs/' . $file . '</a>';
    $file   = '/_nav/langs/' . $file;
    $to_translate  = '<a href="../_nav/langs/en.pot">/_nav/langs/en.pot</a>';
} else {
    $file     = '/langs/' . _po_file_switch($s, $l);
    $note   = '';
    $commit = '<a href="http://gitweb.mageia.org/web/www/tree' . $file . '">' . $file . '</a>';
}

$constitution_or_license = '';
if($constitution) {
    $constitution_or_license .= '<h2 style="color: red;">Please translate <a href="http://gitweb.mageia.org/web/www/tree/en/about/constitution/">separate constitution file</a> fully into ' . $langs[$l] . ' first</h2>';
    $constitution_or_license .= '<p>You can find it in <a href="http://gitweb.mageia.org/web/www/tree/en/about/constitution/">git</a>.';
}

$tx_resource_name = 'page-' . str_replace(array('../_nav/langs/en', '/'), array('nav', '-'), $resource);
$tx_language_code = locale_hyphen_underscore($l, true);
$num_of_untranslated_strings = 0;
if($license) {
    $constitution_or_license .= '<h2 style="color: red;">Please translate <a href="http://gitweb.mageia.org/software/drakx/tree/perl-install/share/po/">separate license file</a> into ' . $langs[$l] . ' first</h2>';
    $constitution_or_license .= '<p>You can find it as a part of a separate <a href="http://gitweb.mageia.org/software/drakx/tree/perl-install/share/po/';
    $constitution_or_license .= $l . '.po">drakx translation file in git</a> or in <a href="https://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/';
    $constitution_or_license .= $tx_language_code . '/#1/?s=drakx_share">Transifex</a> (it starts before ';
    $constitution_or_license .= 'the line with the string "1. License Agreement").'; // 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 - <?php echo $file ?></h1>

<p>Note that you can translate most of our web page resources online in <a href="http://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/<?php
echo $tx_language_code;
?>/#1/?c=Webpages&amp;o=priority">Transifex</a>.</p>
<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>

<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
echo '    <li>You can start translating the source file ' . $to_translate;
echo ' in <a href="http://www.transifex.com/organization/MageiaLinux/dashboard/all_resources/';
echo $tx_language_code . '/#1/?s=' . $tx_resource_name . '&amp;c=Webpages">Transifex</a> or any other gettext editor ';
echo 'of your choice and rename it to <code>' . $file . '</code>.' . $note . '</li>' . PHP_EOL;
?>
    <li>Then:
        <ul>
            <li>if you're in <a href="http://people.mageia.org/g/mga-i18n-committers.html">mga-i18n-committers group</a>, you may commit it directly in <code><?php echo $commit ?></code>;</li>
            <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>
        </ul>
    </li>
</ol>

<p>Thanks!</p>
<hr>
</body>
</html>