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