# HG changeset patch # User Pascal Bellard # Date 1243686926 -7200 # Node ID 66d6688657feddfcb13101cd5edde48644c68dd3 # Parent 0193bd5b5e89bbafae4b45ede62a05782824256f mirror-tools/search.cgi: auto select language diff -r 0193bd5b5e89 -r 66d6688657fe mirror-tools/stuff/var/www/pkgs/search.cgi --- a/mirror-tools/stuff/var/www/pkgs/search.cgi Sat May 30 12:44:33 2009 +0000 +++ b/mirror-tools/stuff/var/www/pkgs/search.cgi Sat May 30 14:35:26 2009 +0200 @@ -63,6 +63,16 @@ # unescape query SEARCH="$(echo $SEARCH | sed 's/%2B/+/g' | sed 's/%3A/:/g' | sed 's|%2F|/|g')" +if [ -z "$LANG" ]; then + for i in $(echo $HTTP_ACCEPT_LANGUAGE | sed 's/[,;]/ /g'); do + case "$i" in + fr|de|pt|cn) + LANG=$i + break;; + esac + done +fi + package="Package" file="File" desc="Description" @@ -89,6 +99,7 @@ file="Fichier";; de) package="Paket" depends="Abhängigkeiten" + desc="Beschreibung" search="Suche" cooking="Cooking" stable="Stable" @@ -107,6 +118,7 @@ deptree="Árvore de dependências para: $SEARCH" rdeptree="Árvore de dependências reversa para: $SEARCH" depends="Dependências" + desc="Descrição" file_list="Arquivo lista" file="Arquivo";; cn) package="软件包:" @@ -166,7 +178,7 @@ - +