add german translation of navigation.wmi (and some other non-translated .wmi files)
Runa A. Sandvik

Runa A. Sandvik commited on 2011-04-11 15:33:34
Zeige 6 geänderte Dateien mit 424 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,25 @@
1
+#!/usr/bin/wml
2
+
3
+## translation metadata
4
+# Revision: $Revision$
5
+# Translation-Priority: 1-high
6
+
7
+<:
8
+    # path                              link text
9
+    my @navigation = (
10
+        'index'                       , 'Startseite',
11
+        'about/overview'                 , '�ber Tor',
12
+        'docs/documentation'          , 'Dokumentation',
13
+        'projects/projects'         , 'Projekte',
14
+        'press/press'                 , 'Presse',
15
+        '<blog>'                      , 'Blog',
16
+        'http://printfection.com/torprojectstore' , 'Shop',
17
+    );
18
+    my @calltoaction = (
19
+        'download/download'                , 'Download',
20
+        'donate/donate'                    , 'Spenden',
21
+        'getinvolved/volunteer'          , 'Sich Engagieren',
22
+    );      
23
+
24
+:>
25
+
... ...
@@ -0,0 +1,131 @@
1
+#!/usr/bin/env wml
2
+#use "functions.wmi"
3
+
4
+    <div id="footer">
5
+    	<div class="onion"><img src="$(IMGROOT)/onion.jpg" alt="Tor"></div>
6
+      <div class="about">
7
+	<p>"Tor" and the "Onion Logo" are registered trademarks of
8
+	<a href="<page docs/trademark-faq>">The Tor Project, Inc.</a>
9
+	Content on this site is licensed under a <a
10
+	href="http://creativecommons.org/licenses/by/3.0/us/">Creative
11
+	Commons Attribution 3.0 United States License</a>, unless
12
+	otherwise noted.</p>
13
+<!--
14
+        # This will grab the date from svn info but formatting is tedious
15
+       	# REQUIRES svn for this to work
16
+        <:{
17
+          my $svninfo = `svn info`;
18
+          if ($svninfo =~ m/Last Changed Date: (\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}:\d{2})\s(.*)\s\((.*)\)/) {
19
+            my $modifydate = "$4 $2 $3";
20
+            # remove commas from date
21
+            $modifydate =~ s/,//;
22
+            print 'Last modified: '.$modifydate."\n";
23
+          }
24
+        }:>
25
+        <:{
26
+          #my $compiledate = `date`;
27
+          my $compiledate = `date +"%a %b %d %Y %k:%M:%S %z"`;
28
+          print 'Last compiled: '.$compiledate."\n";
29
+        }:>
30
+-->
31
+      </div>
32
+      <!-- END ABOUT -->
33
+      <!-- WE HAVE NO NEWSLETTER SO REMOVE THIS
34
+      <div class="newsletter">
35
+        <form action="">
36
+          <input class="textfield" type="text" name="email" value="Sign up for our newsletter! Enter email." onClick="clearDefault(this);">
37
+          <input class="signup" type="submit" name="submit" value="Sign Up">
38
+        </form>
39
+      </div>
40
+      END NEWSLETTER -->
41
+      <div class="col first">
42
+      	<h4>About Tor</h4>
43
+        <ul>
44
+          <li><a href="<page about/overview>">What Tor Does</a></li>
45
+          <li><a href="<page about/torusers>">Users of Tor</a></li>
46
+          <li><a href="<page about/corepeople>">Core Tor People</a></li>
47
+          <li><a href="<page about/sponsors>">Sponsors</a></li>
48
+          <li><a href="<page about/contact>">Contact Us</a></li>
49
+        </ul>
50
+      </div>
51
+      <!-- END COL -->
52
+      <div class="col">
53
+      	<h4>Get Involved</h4>
54
+        <ul>
55
+          <li><a href="<page donate/donate>">Donate</a></li>
56
+          <li><a href="<page docs/documentation>#MailingLists">Mailing List</a></li>
57
+          <li><a href="<page getinvolved/mirrors>">Mirrors</a></li>
58
+          <li><a href="<page docs/hidden-services>">Hidden Services</a></li>
59
+          <li><a href="<page getinvolved/translation>">Translations</a></li>
60
+          <li><a href="<page getinvolved/open-positions>">Careers</a></li>
61
+        </ul>
62
+      </div>
63
+      <!-- END COL -->
64
+      <div class="col">
65
+      	<h4>Documentation</h4>
66
+        <ul>
67
+          <li><a href="<page docs/tor-manual>">Manuals</a></li>
68
+          <li><a href="<page docs/documentation>">Installation Guides</a></li>
69
+          <li><a href="<wiki>">Tor Wiki</a></li>
70
+          <li><a href="<page docs/faq>">General Tor FAQ</a></li>
71
+        </ul>
72
+      </div>
73
+      <!-- END COL -->
74
+
75
+	<!-- List available languages -->
76
+	<div class="col wider">
77
+	<h4>Languages</h4>
78
+	<: if (has_translations()) {  :>
79
+		<p>
80
+		This page is also available in the following languages:
81
+		<: print list_translations() :>.<br />
82
+		How to set <a href="http://www.debian.org/intro/cn#howtoset">the default document language</a>.
83
+		</p>
84
+	<: }; :>
85
+	</div>
86
+
87
+<!-- LANGUAGE SWITCH CGI 
88
+      <div class="col wider">
89
+      	<h4>Languages</h4>
90
+        # this is a cgi trampoline to bounce us to the right page
91
+        # alternately, if the client supports javascript we can redirect that way
92
+        # noscript does not block onclick but clients may have disabled javascript completely
93
+        #
94
+        # for this to work we need to know the relative path from the document root
95
+        # to the current directory that wml is in. 
96
+        <form action="$(DOCROOT)/cgi-bin/languageswitch.cgi">
97
+          <select name="Language" id="lang">
98
+          <:{
99
+            #import "perl-globals.wmi";
100
+            use Cwd;
101
+            use Cwd 'abs_path';
102
+            use File::Spec;
103
+            my $urlbase = File::Spec->abs2rel(getcwd(),abs_path("$(DOCROOT)"));
104
+            my $LANGUAGES;
105
+            my $page = $WML_SRC_FILENAME;
106
+            opendir(DIR, getcwd()) or die $!;
107
+            # take a look and see what language support we have
108
+            while (my $file = readdir(DIR)) {
109
+                if (-d $file) {
110
+                    if (-e "$file/$page") {
111
+                        my $url = $urlbase.'/'.$WML_SRC_BASENAME.'.html.'.$file;
112
+                        my $url2js = $WML_SRC_BASENAME.'.html.'.$file;
113
+                        print '<option value="'.$url.'" onclick="window.location=\''.$url2js.'\'">'.$LANGUAGES{$file}.'</option>'."\n" unless not defined $LANGUAGES{$file};
114
+                    }
115
+                }
116
+            }
117
+            closedir(DIR);
118
+          }:>
119
+          </select>
120
+          <input class="go" type="submit" name="submit" value="Go">
121
+        </form>
122
+        <p>Questions on this? Visit <a href="http://www.debian.org/intro/cn#howtoset">how to set the default document language</a>.</p>
123
+      </div>
124
+-->
125
+    </div>
126
+    <!-- END FOOTER -->
127
+
128
+  </div>
129
+  <!-- END WRAP -->
130
+</body>
131
+</html>
... ...
@@ -0,0 +1,142 @@
1
+#! /usr/bin/wml
2
+<: use strict; :>
3
+<: use warnings; :>
4
+#use "perl-globals.wmi"
5
+#use "links.wmi"
6
+#use "versions.wmi"
7
+#use "navigation.wmi"
8
+
9
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
10
+<html>
11
+<head>
12
+  <title>$(TITLE)</title>
13
+  <link rel="shortcut icon" type="image/x-icon" href="$(IMGROOT)/favicon.ico">
14
+  <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT)">">
15
+  <ifneq "$(REDIRECT_GLOBAL)" "" "<meta http-equiv="refresh" content="0;url=$(REDIRECT_GLOBAL)">">
16
+  <ifeq "$(ANNOUNCE_RSS)" "yes" "<link rel="alternate" title="Tor Project OR-announce" href="http://rss.gmane.org/gmane.network.onion-routing.announce"
17
+type="application/rss+xml">">
18
+
19
+  # begin WML to generate css/js paths 
20
+  <ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)">">
21
+  <ifeq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/master.css">">
22
+
23
+  #<link href="css/master.css" rel="stylesheet" type="text/css">
24
+  <!--[if lte IE 7]>
25
+  <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie7-and-down.css">
26
+  <![endif]-->
27
+  <!--[if IE 6]>
28
+  <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie6.css">
29
+  <![endif]-->
30
+#  <script language="javascript" type="text/javascript" src="$(DOCROOT)/global.js"></script>
31
+  # end WML to generate css/js paths 
32
+
33
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
34
+  <meta name="author" content="The Tor Project, Inc.">
35
+  <meta name="keywords" content="anonymity online, tor, tor project, censorship circumvention, traffic analysis, anonymous communications research">
36
+</head>
37
+<body>
38
+<div id="wrap">
39
+  <div id="header">
40
+    <h1 id="logo"><a href="<page index>">Tor</a></h1>
41
+      # navigation menu generation
42
+      <div id="nav">
43
+        <ul>
44
+        <:{
45
+            # create a hash and maintain order of keys
46
+            my %navigation;
47
+            my @keys;
48
+            while (@navigation) {
49
+              my $key = shift @navigation;
50
+              my $val = shift @navigation;
51
+              push @keys, $key;
52
+              $navigation{$key} = $val;
53
+            }
54
+
55
+            my $page = $WML_SRC_BASENAME;
56
+            my $lang = "$(LANG)";
57
+
58
+            for my $key (@keys) {
59
+              my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;  
60
+
61
+              # in directory of active link, set class active 
62
+              my $class;
63
+              if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
64
+                $class = 'class="active"';
65
+              } else {
66
+                $class = '';
67
+              }
68
+
69
+	            $dir = '.' unless defined $dir;
70
+                
71
+              # translated version
72
+              if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
73
+                  printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
74
+                         stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$navigation{$key};
75
+              } 
76
+              # english version
77
+              elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
78
+              	printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
79
+                  stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $navigation{$key};
80
+              }
81
+              # full url
82
+              elsif ($key =~/^http/) {
83
+                printf '<li><a href="%s">%s</a></li>'."\n", $key, $navigation{$key};
84
+              } else {
85
+                warn "$WML_SRC_FILENAME has a [page $key] (parses to
86
+docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
87
+              }
88
+            }
89
+        }:>
90
+        </ul>
91
+      </div>
92
+      <!-- END NAV -->
93
+     # end navigation generation
94
+      <div id="calltoaction">
95
+        <ul>
96
+          <:{
97
+            my %calltoaction;
98
+            my @keys;
99
+            while (@calltoaction) {
100
+              my $key = shift @calltoaction;
101
+              my $val = shift @calltoaction;
102
+              push @keys, $key;
103
+              $calltoaction{$key} = $val;
104
+            } 
105
+
106
+            my $page = $WML_SRC_BASENAME;
107
+            my $lang = "$(LANG)";
108
+            for my $key (@keys) {
109
+              my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;  
110
+
111
+              # in directory, set active 
112
+              my $class;
113
+              if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
114
+              #if ($WML_SRC_BASENAME eq $base) {
115
+                $class = 'class="active"';
116
+              } else {
117
+                $class = '';
118
+              }
119
+
120
+	          $dir = '.' unless defined $dir;
121
+              # try to use a translated version
122
+              if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
123
+                  printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
124
+                         stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$calltoaction{$key};
125
+              } 
126
+              # default to english version
127
+              elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
128
+              	printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
129
+                  stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $calltoaction{$key};
130
+              } else {
131
+                warn "$WML_SRC_FILENAME has a [page $key] (parses to docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
132
+              }
133
+            }    
134
+          }:>
135
+        </ul>
136
+      </div>
137
+      <!-- END CALLTOACTION -->
138
+  </div>
139
+  <!-- END HEADER -->
140
+
141
+#<ifneq "$(REDIRECT)" "" "Redirecting to <a href="$(DOCROOT)/$(REDIRECT)">$(DOCROOT)/$(REDIRECT)</a>.">
142
+#<ifneq "$(REDIRECT_GLOBAL)" "" "Redirecting to <a href="$(REDIRECT_GLOBAL)">$(REDIRECT_GLOBAL)</a>.">
... ...
@@ -0,0 +1,10 @@
1
+#!/usr/bin/env wml
2
+<div class="img-shadow">
3
+  <div class="infoblock">
4
+    <h2 class="bulb">Tor Tip</h2>
5
+    <p>Tor is written for and supported by people like you. <a href="<page
6
+donate/donate>">Donate today</a>!</p>
7
+  </div>
8
+  <!-- END INFOBLOCK -->              
9
+</div>
10
+<!-- END IMG-SHADOW -->              
... ...
@@ -0,0 +1,25 @@
1
+#!/usr/bin/wml
2
+
3
+## translation metadata
4
+# Revision: $Revision$
5
+# Translation-Priority: 1-high
6
+
7
+<:
8
+    # path                              link text
9
+    my @navigation = (
10
+        'index'                       , 'Startseite',
11
+        'about/overview'                 , '�ber Tor',
12
+        'docs/documentation'          , 'Dokumentation',
13
+        'projects/projects'         , 'Projekte',
14
+        'press/press'                 , 'Presse',
15
+        '<blog>'                      , 'Blog',
16
+        'http://printfection.com/torprojectstore' , 'Shop',
17
+    );
18
+    my @calltoaction = (
19
+        'download/download'                , 'Download',
20
+        'donate/donate'                    , 'Spenden',
21
+        'getinvolved/volunteer'          , 'Sich Engagieren',
22
+    );      
23
+
24
+:>
25
+
... ...
@@ -0,0 +1,91 @@
1
+#! /usr/bin/wml
2
+<: use strict; :>
3
+<: use warnings; :>
4
+#use "perl-globals.wmi"
5
+#use "links.wmi"
6
+#use "versions.wmi"
7
+#use "sidenav.wmi"
8
+<div class="img-shadow">
9
+  <div id="sidenav">
10
+    <:
11
+      # recursively search menu structure to see if it contains a given page
12
+      sub containsSub($$);
13
+      sub containsSub($$) {
14
+          my ($elements, $page) = @_;
15
+          for my $ele (@{$elements}) {
16
+              if (containsSub($ele->{'subelements'},$page)){
17
+                  return 1;
18
+              } elsif ($page eq $ele->{'url'}) {
19
+                  return 1;
20
+              }
21
+
22
+          }
23
+          return 0;
24
+      } 
25
+
26
+      # generate navigation menu
27
+      sub printNavMenu($$$);
28
+      sub printNavMenu($$$) {
29
+          my ($navmenu, $page, $lang) = @_;
30
+          print '<ul>'."\n";
31
+          for my $navmenu (@{$navmenu}) {
32
+              # this menu entry is the current (active) page
33
+              if ($navmenu->{'url'} eq $page) {
34
+      
35
+                  # the current page has nested menu elements
36
+                  if ($navmenu->{'subelements'}) { # menu has dropdown
37
+                      printf '<li class="dropdown active"><a class="active" href="%s">%s</a></li>'."\n",
38
+                             pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'}; 
39
+      
40
+                      print '<li>'."\n";
41
+                      printNavMenu($navmenu->{'subelements'},$page,$lang); 
42
+                      print '</li>'."\n";
43
+
44
+                  # the current (active) page does not have sub elements
45
+                  } else {
46
+                      printf '<li class="active"><a class="active" href="%s">%s</a></li>'."\n",
47
+                             pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'}; 
48
+                  }
49
+      
50
+              # a subelement of this menu item is the current (active) page
51
+              } elsif (containsSub($navmenu->{'subelements'}, $page)) {
52
+                  printf '<li class="dropdown"><a class="active" href="%s">%s</a></li>'."\n",
53
+                         pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
54
+
55
+                  print '<li>'."\n"; #encapsulate subelements
56
+                  # recurse to generate the expanded menu
57
+                  printNavMenu($navmenu->{'subelements'},$page,$lang); 
58
+                  print '</li>'."\n"; #encapsulate subelements
59
+      
60
+              # the menu entry is not active and does not enclose the active page
61
+              } else {
62
+
63
+                  # if there are subelements, set collapsed style
64
+                  if ($navmenu->{'subelements'}) {
65
+                      printf '<li class="dropdown"><a href="%s">%s</a></li>'."\n",
66
+                             pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
67
+                  # regular menu entry
68
+                  } else {
69
+                      printf '<li><a href="%s">%s</a></li>'."\n",
70
+                             pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
71
+                  }
72
+              }
73
+          }
74
+          print '</ul>'."\n";
75
+      }
76
+
77
+      my $lang = "$(LANG)";
78
+
79
+      use Cwd;
80
+      use Cwd 'abs_path';
81
+      use File::Spec;
82
+      
83
+      # get document path from site root
84
+      my $path = File::Spec->abs2rel(getcwd(),abs_path("$(DOCROOT)"));
85
+      my $page = $WML_SRC_BASENAME; 
86
+      printNavMenu($sidenav, $path.'/'.$page, $lang);
87
+    :>
88
+  </div>
89
+  <!-- END SIDENAV -->
90
+</div>
91
+<!-- END IMG-SHADOW -->
0 92