jpayne@68: #!/bin/sh jpayne@68: # jpayne@68: # Copyright (C) 2001 Free Software Foundation, Inc. jpayne@68: # Written by Bruno Haible , 2001. jpayne@68: # jpayne@68: # This program is free software: you can redistribute it and/or modify jpayne@68: # it under the terms of the GNU General Public License as published by jpayne@68: # the Free Software Foundation; either version 3 of the License, or jpayne@68: # (at your option) any later version. jpayne@68: # jpayne@68: # This program is distributed in the hope that it will be useful, jpayne@68: # but WITHOUT ANY WARRANTY; without even the implied warranty of jpayne@68: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jpayne@68: # GNU General Public License for more details. jpayne@68: # jpayne@68: # You should have received a copy of the GNU General Public License jpayne@68: # along with this program. If not, see . jpayne@68: jpayne@68: # Print the team's address (to stdout) and output additional instructions jpayne@68: # (to stderr). jpayne@68: jpayne@68: projectsdir="$1" jpayne@68: progdir="$2" jpayne@68: catalog="$3" # e.g. "pt_BR" jpayne@68: language="$4" # e.g. "pt" jpayne@68: jpayne@68: url=`cat "$projectsdir/KDE/teams.url"` jpayne@68: html=`"$progdir/urlget" "$url" "$projectsdir/KDE/teams.html"` jpayne@68: # The HTML page says they are "presently switching from the 2-letter codes jpayne@68: # to the 3-letter codes". So it is safest to use the English name and jpayne@68: # translate ourselves... jpayne@68: case "$catalog" in jpayne@68: af) english=Afrikaans;; jpayne@68: ar) english=Arabic;; jpayne@68: az) english=Azerbaijani;; jpayne@68: bg) english=Bulgarian;; jpayne@68: bn) english=Bengali;; jpayne@68: bo) english=Tibetan;; jpayne@68: br) english=Breton;; jpayne@68: bs) english=Bosnian;; jpayne@68: ca) english=Catalan;; jpayne@68: cs) english=Czech;; jpayne@68: cy) english=Welsh;; jpayne@68: da) english=Danish;; jpayne@68: de) english=German;; jpayne@68: el) english=Greek;; jpayne@68: en_GB) english="British English";; jpayne@68: eo) english=Esperanto;; jpayne@68: es) english=Spanish;; jpayne@68: et) english=Estonian;; jpayne@68: eu) english=Basque;; jpayne@68: fa) english=Farsi;; jpayne@68: fi) english=Finnish;; jpayne@68: fo) english=Faroese;; jpayne@68: fr) english=French;; jpayne@68: ga) english=Irish;; jpayne@68: gl) english=Gallegan;; jpayne@68: gu) english=Gujarati;; jpayne@68: he) english=Hebrew;; jpayne@68: hi) english=Hindi;; jpayne@68: hr) english=Croatian;; jpayne@68: hu) english=Hungarian;; jpayne@68: id) english=Indonesian;; jpayne@68: is) english=Icelandic;; jpayne@68: it) english=Italian;; jpayne@68: ja) english=Japanese;; jpayne@68: km) english=Khmer;; jpayne@68: ko) english=Korean;; jpayne@68: ku) english=Kurdish;; jpayne@68: lt) english=Lithuanian;; jpayne@68: lv) english=Latvian;; jpayne@68: mi) english=Maori;; jpayne@68: mk) english=Macedonian;; jpayne@68: mr) english=Marathi;; jpayne@68: mt) english=Maltese;; jpayne@68: nl) english=Dutch;; jpayne@68: no) english="Norwegian (Bokm";; jpayne@68: nn) english="Norwegian (Nynorsk)";; jpayne@68: oc) english=Occitan;; jpayne@68: pl) english=Polish;; jpayne@68: pt) english=Portuguese;; jpayne@68: pt_BR) english="Brazilian Portuguese";; jpayne@68: ro) english=Romanian;; jpayne@68: ru) english=Russian;; jpayne@68: sk) english=Slovak;; jpayne@68: sl) english=Slovenian;; jpayne@68: sr) english=Serbian;; jpayne@68: sv) english=Swedish;; jpayne@68: ta) english=Tamil;; jpayne@68: tg) english=Tajik;; jpayne@68: th) english=Thai;; jpayne@68: tr) english=Turkish;; jpayne@68: uk) english=Ukrainian;; jpayne@68: vi) english=Vietnamese;; jpayne@68: # ??) english=Walloon;; jpayne@68: xh) english=Xhosa;; jpayne@68: zh_CN) english="Simplified Chinese";; jpayne@68: zh_TW) english="Traditional Chinese";; jpayne@68: *) english=;; jpayne@68: esac jpayne@68: if test -n "$english"; then jpayne@68: (echo "Please consider joining your translation team, and visit" jpayne@68: sed_addnl='s,,\ jpayne@68: ,g' jpayne@68: anchor=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e 's,^.*.*>'"$english"'[^<>]*team<.*$,\1,p'` jpayne@68: if test -n "$anchor"; then jpayne@68: echo " $url#$anchor" jpayne@68: fi jpayne@68: echo " $url" jpayne@68: echo " https://l10n.kde.org/" jpayne@68: ) 1>&2 jpayne@68: address1=`echo "$html" | tr '\012' '|' | sed -n -e 's,^.*>'"$english"'[^<>]*team<\(.*\)$,\1,p' | sed -e "$sed_addnl" | sed -e 2q -e 1d | sed -n -e 's,^.*mailing list\(.*\)$,\1,p' | sed -e 's,.*,,' | sed -e 's,.*,,' | sed -n -e 's,^.*HREF="\([^"]*\)">[^<>]*.*$,\1,p'` jpayne@68: case "$address1" in jpayne@68: mailto:*) address1=`echo "$address1" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;; jpayne@68: esac jpayne@68: address1=`echo "$address1" | sed -e 's,-request@,@,'` jpayne@68: address2=`echo "$html" | tr '\012' '|' | sed -n -e 's,^.*>'"$english"'[^<>]*team<\(.*\)$,\1,p' | sed -e "$sed_addnl" | sed -e 2q -e 1d | sed -n -e 's,^.*web site\(.*\)$,\1,p' | sed -e 's,.*,,' | sed -e 's,.*,,' | sed -n -e 's,^.*HREF="\([^"]*\)">[^<>]*.*$,\1,p'` jpayne@68: if test -n "$address1" && test -n "$address2"; then jpayne@68: address="$address1 $address2" jpayne@68: else jpayne@68: address="$address1$address2" jpayne@68: fi jpayne@68: # address can be empty or contain 1 or more space separated URLs. jpayne@68: else jpayne@68: (echo "A translation team for your "`if test "$catalog" = "$language"; then echo "language ($language)"; else echo "local dialect ($catalog)"; fi` jpayne@68: echo "may not exist yet. Please visit" jpayne@68: echo " $url" jpayne@68: echo " https://l10n.kde.org/" jpayne@68: echo "and decide whether you want to create a new translation team." jpayne@68: ) 1>&2 jpayne@68: address= jpayne@68: fi jpayne@68: exit 0