[or-cvs] More languages in the top right and also add them in the fo...

Peter Palfrader weasel at seul.org
Fri Jan 20 20:34:09 UTC 2006


Update of /home/or/cvsroot/website/include
In directory moria:/tmp/cvs-serv4587/include

Modified Files:
	functions.wmi head.wmi 
Log Message:
More languages in the top right and also add them in the footer

Index: functions.wmi
===================================================================
RCS file: /home/or/cvsroot/website/include/functions.wmi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -d -r1.6 -r1.7
--- functions.wmi	8 Oct 2005 12:16:45 -0000	1.6
+++ functions.wmi	20 Jan 2006 20:34:01 -0000	1.7
@@ -70,4 +70,23 @@ sub file_is_obsolete($$) {
 	return (exists $translation->{'Status'} && ($translation->{'Status'} eq 'obsolete'))
 };
 
+sub list_translations() {
+  my @links = ();
+  my $page = $WML_SRC_FILENAME;
+  my $numlangs = 0;
+  $page =~ s/\.wml//;
+  for my $dir (sort {$LANGUAGES{$a} cmp $LANGUAGES{$b}} @LANGUAGES) {
+    if (-e "$dir/$WML_SRC_FILENAME") {
+      if ($dir ne '$(LANG)') {
+        push @links, sprintf('<a href="%s.html.%s">%s</a>', $page, $dir, $LANGUAGES{$dir});
+      };
+    };
+  };
+  return join(', ', @links);
+};
+
+sub has_translations() {
+  return list_translations() ne '';
+};
+
 :>

Index: head.wmi
===================================================================
RCS file: /home/or/cvsroot/website/include/head.wmi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -d -r1.8 -r1.9
--- head.wmi	20 Jan 2006 06:46:18 -0000	1.8
+++ head.wmi	20 Jan 2006 20:34:03 -0000	1.9
@@ -57,11 +57,15 @@
 	  my $numlangs = 0;
 	  $page =~ s/\.wml//;
 	  for my $dir (sort {$LANGUAGES{$a} cmp $LANGUAGES{$b}} @LANGUAGES) {
-	    next if $dir eq '$(LANG)';
 	    if (-e "$dir/$WML_SRC_FILENAME") {
-	      printf('<a href="%s.html.%s"><img src="$(IMGROOT)/%s.png" alt="%s" /></a>', $page, $dir, $dir, $LANGUAGES{$dir});
-	      last if ++$numlangs >= 3;
-	    }
+	      if ($dir eq '$(LANG)') {
+	        printf('<img src="$(IMGROOT)/%s.png" alt="%s" /> ', $dir, $LANGUAGES{$dir});
+	      } else {
+	        printf('<a href="%s.html.%s"><img src="$(IMGROOT)/%s.png" alt="%s" /></a> ', $page, $dir, $dir, $LANGUAGES{$dir});
+	      };
+	    } else {
+	      printf('<img src="$(IMGROOT)/green-flagspace.png"/> ');
+	    };
 	  };
 	}:>
         </td>



More information about the tor-commits mailing list