source: t29-www/en/no-translation.php @ 1080

Last change on this file since 1080 was 936, checked in by sven, 3 years ago

Links und Anzeige der Auto-Translation ("There is no translation...") korrigiert. Bei manchen Seiten ist die "There is no translation..."-Box unter den Inhalt geraten.

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1<?php
2        $seiten_id = 'no-translation'; // befindet sich nicht in navi
3        $lang = 'en'; // force language
4        $version = '$Id: no-translation.php 936 2016-03-30 12:54:23Z sven $';
5        $titel = 'No English translation available';
6        $dynamischer_inhalt = true;
7       
8        // see usage below
9        $how = isset($_GET['how']) ? $_GET['how'] : 'no';
10        $backurl = isset($_GET['backurl']) ? $_GET['backurl'] : null;
11        $backtitle = isset($_GET['backtitle']) ? $_GET['backtitle'] : null;
12       
13        $template_callback = function($template) use($backurl,$backtitle) {
14                if($backurl) {
15                        $template->set_page_relation("prev", $backurl, $backtitle ? $backtitle : "German version of page");
16                        $template->current_link_classes = array('show-rel-prev');
17                }
18               
19                $template->interlang_links = array(
20                        'de' =>  $backurl ? t29Menu::dom_new_link($backurl, $backtitle) : t29Menu::dom_new_link('#', 'unknown'),
21                        'en' =>  t29Menu::dom_new_link('#', 'This "no translation available" page'),
22                );
23        };
24
25        require "../lib/technikum29.php";
26?>
27    <!--
28       "Not yet translated"-Page Usage
29       Get-Param    optional  values
30       how          yes       (yet|no)   => yet = Not yet translated | no = no translation
31       backurl      yes       == url_de
32       backtitle    required  title of german page
33
34       GET-Parameters can be seperated by using , (commas) or normal sperators (&), for example:
35         ?how=yet&backurl=index.shtm&backtitle=Main%20Page
36         ?how=no,backtitle=Blabla
37    -->
38
39    <?php
40
41       
42        if($how == 'yet')
43                $h2 = "The page &raquo;$backtitle&laquo; has not been translated yet";
44        else
45                $h2 = "There is no translation for ".($backtitle ? " &raquo;$backtitle&laquo" : "the page you requested");
46   
47        print "<h2>$h2</h2>";
48       
49        //$url_de = "/de/"...
50        //$backurl = "/de/".$url_de;
51       
52        if($backurl)  {
53                ?><p class="panel-hide">Please <a href="<?=$backurl; ?>">go back to the german page</a>.</p>
54                <p>You can also use automatically generated translations from <a href="https://translate.google.com/">Google Translate</a> or <a href="https://www.bing.com/translator">Microsoft Bing</a>
55                (but don't expect too much):</p>
56                <ul>
57                <li><a href="http://translate.google.com/translate?hl=en&sl=de&u=http://www.technikum29.de/<?=$backurl; ?>&prev=/search%3Fq%3Dtechnikum29%26hl%3Den%26lr%3D%26sa%3DN">Read the google translation</a></li>
58                <li><a href="http://www.microsofttranslator.com/bv.aspx?from=de&to=en&a=http://www.technikum29.de/<?=$backurl; ?>">Read the Microsoft translator (Babelfish/Bing)</a></li>
59                </ul><?php
60        } else {
61                ?>
62                <p>There is no english translation for the requested page.</p>
63                <p><a class="go" href="javascript:history.go();">Back to the german page</a></p>
64                <?php
65        }
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License