jpayne@68
|
1 #!/bin/sh
|
jpayne@68
|
2 #
|
jpayne@68
|
3 # Copyright (C) 2001, 2005, 2010 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/GNOME/teams.url"`
|
jpayne@68
|
28 html=`"$progdir/urlget" "$url" "$projectsdir/GNOME/teams.html"`
|
jpayne@68
|
29 sed_addnl='s,</li>,</li>\
|
jpayne@68
|
30 ,g'
|
jpayne@68
|
31 sed_extract_address='s,^.*"/teams/'"$catalog"'">[^<>]*</a>.*<a href=[^<>]*>\(.*\)</a>.*<a href=[^<>]*>.*</a>.*,\1,p'
|
jpayne@68
|
32 address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "$sed_extract_address"`
|
jpayne@68
|
33 if test -n "$address"; then
|
jpayne@68
|
34 (echo "Please consider joining your translation team, and visit"
|
jpayne@68
|
35 echo " $address"
|
jpayne@68
|
36 echo " https://l10n.gnome.org/"
|
jpayne@68
|
37 ) 1>&2
|
jpayne@68
|
38 else
|
jpayne@68
|
39 (echo "A translation team for your "`if test "$catalog" = "$language"; then echo "language ($language)"; else echo "local dialect ($catalog)"; fi`
|
jpayne@68
|
40 echo "may not exist yet. Please visit"
|
jpayne@68
|
41 echo " $url"
|
jpayne@68
|
42 echo " https://l10n.gnome.org/"
|
jpayne@68
|
43 echo "and decide whether you want to create a new translation team."
|
jpayne@68
|
44 ) 1>&2
|
jpayne@68
|
45 address=
|
jpayne@68
|
46 fi
|
jpayne@68
|
47 exit 0
|