jpayne@68
|
1 #!/bin/sh
|
jpayne@68
|
2 #
|
jpayne@68
|
3 # Copyright (C) 2001, 2007, 2019 Free Software Foundation, Inc.
|
jpayne@68
|
4 # Written by Bruno Haible <bruno@clisp.org>, 2001.
|
jpayne@68
|
5 #
|
jpayne@68
|
6 # This program is free software: you can redistribute it and/or modify
|
jpayne@68
|
7 # it under the terms of the GNU General Public License as published by
|
jpayne@68
|
8 # the Free Software Foundation; either version 3 of the License, or
|
jpayne@68
|
9 # (at your option) any later version.
|
jpayne@68
|
10 #
|
jpayne@68
|
11 # This program is distributed in the hope that it will be useful,
|
jpayne@68
|
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
jpayne@68
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
jpayne@68
|
14 # GNU General Public License for more details.
|
jpayne@68
|
15 #
|
jpayne@68
|
16 # You should have received a copy of the GNU General Public License
|
jpayne@68
|
17 # along with this program. If not, see <https://www.gnu.org/licenses/>.
|
jpayne@68
|
18
|
jpayne@68
|
19 # Print the team's address (to stdout) and output additional instructions
|
jpayne@68
|
20 # (to stderr).
|
jpayne@68
|
21
|
jpayne@68
|
22 projectsdir="$1"
|
jpayne@68
|
23 progdir="$2"
|
jpayne@68
|
24 catalog="$3" # e.g. "pt_BR"
|
jpayne@68
|
25 language="$4" # e.g. "pt"
|
jpayne@68
|
26
|
jpayne@68
|
27 url=`cat "$projectsdir/TP/teams.url"`
|
jpayne@68
|
28 url_parent=`echo "$url" | sed -e 's,/[^/]*\$,/,'`
|
jpayne@68
|
29 url_grandparent=`echo "$url" | sed -e 's,/[^/]*/[^/]*\$,/,'`
|
jpayne@68
|
30 sed_absolute_dotdot_urls="s,href=\"\\.\\./,href=${url_grandparent},g"
|
jpayne@68
|
31 html=`"$progdir/urlget" "$url" "$projectsdir/TP/teams.html" | sed -e "$sed_absolute_dotdot_urls"`
|
jpayne@68
|
32 sed_addnl='s,</tr>,</tr>\
|
jpayne@68
|
33 ,g'
|
jpayne@68
|
34 address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*<td>$catalog</td>[^<>]*<td><a href=\"\\([^\"]*\\)\">[^<>]*</a></td>.*\$,\\1,p" | sed 1q`
|
jpayne@68
|
35 if test -n "$address"; then
|
jpayne@68
|
36 case "$address" in
|
jpayne@68
|
37 mailto:*) address=`echo "$address" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;;
|
jpayne@68
|
38 esac
|
jpayne@68
|
39 (echo "Please visit your translation team's homepage at"
|
jpayne@68
|
40 echo " ${url_parent}"`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*<td><a href=\"\\([^\"]*\\)\">[^<>]*</a></td>[^<>]*<td>$catalog</td>.*\$,\\1,p" | sed 1q`
|
jpayne@68
|
41 echo " https://translationproject.org/team/index.html"
|
jpayne@68
|
42 echo " https://translationproject.org/html/translators.html"
|
jpayne@68
|
43 echo " https://translationproject.org/html/welcome.html"
|
jpayne@68
|
44 echo "and consider joining your translation team's mailing list"
|
jpayne@68
|
45 echo " $address"
|
jpayne@68
|
46 ) 1>&2
|
jpayne@68
|
47 echo "$address"
|
jpayne@68
|
48 exit 0
|
jpayne@68
|
49 fi
|
jpayne@68
|
50 address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*<td>$language</td>[^<>]*<td><a href=\"\\([^\"]*\\)\">[^<>]*</a></td>.*\$,\\1,p" | sed 1q`
|
jpayne@68
|
51 if test -n "$address"; then
|
jpayne@68
|
52 case "$address" in
|
jpayne@68
|
53 mailto:*) address=`echo "$address" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;;
|
jpayne@68
|
54 esac
|
jpayne@68
|
55 (echo "A translation team exists for your language ($language) but not for"
|
jpayne@68
|
56 echo "your local dialect ($catalog). You can either join the existing"
|
jpayne@68
|
57 echo "translation team for $language or create a new translation team for $catalog."
|
jpayne@68
|
58 echo
|
jpayne@68
|
59 echo "Please visit the existing translation team's homepage at"
|
jpayne@68
|
60 echo " ${url_parent}"`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*<td><a href=\"\\([^\"]*\\)\">[^<>]*</a></td>[^<>]*<td>$language</td>.*\$,\\1,p" | sed 1q`
|
jpayne@68
|
61 echo " https://translationproject.org/team/index.html"
|
jpayne@68
|
62 echo " https://translationproject.org/html/translators.html"
|
jpayne@68
|
63 echo " https://translationproject.org/html/welcome.html"
|
jpayne@68
|
64 echo "and consider joining the translation team's mailing list"
|
jpayne@68
|
65 echo " $address"
|
jpayne@68
|
66 echo
|
jpayne@68
|
67 echo "If you want to create a new translation team for $catalog, please visit"
|
jpayne@68
|
68 echo " https://translationproject.org/team/index.html"
|
jpayne@68
|
69 echo " https://translationproject.org/html/leaders.html"
|
jpayne@68
|
70 echo " https://translationproject.org/html/welcome.html"
|
jpayne@68
|
71 ) 1>&2
|
jpayne@68
|
72 echo "$address"
|
jpayne@68
|
73 exit 0
|
jpayne@68
|
74 fi
|
jpayne@68
|
75 (echo "A translation team for your language ($language) does not exist yet."
|
jpayne@68
|
76 echo "If you want to create a new translation team for $language"`test "$catalog" = "$language" || echo " or $catalog"`", please visit"
|
jpayne@68
|
77 echo " https://translationproject.org/team/index.html"
|
jpayne@68
|
78 echo " https://translationproject.org/html/leaders.html"
|
jpayne@68
|
79 echo " https://translationproject.org/html/welcome.html"
|
jpayne@68
|
80 ) 1>&2
|
jpayne@68
|
81 exit 0
|