File size: 4,600 Bytes
1d777c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/sh
#
# Copyright (C) 2001 Free Software Foundation, Inc.
# Written by Bruno Haible <[email protected]>, 2001.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# Print the team's address (to stdout) and output additional instructions
# (to stderr).

projectsdir="$1"
progdir="$2"
catalog="$3"  # e.g. "pt_BR"
language="$4" # e.g. "pt"

url=`cat "$projectsdir/KDE/teams.url"`
html=`"$progdir/urlget" "$url" "$projectsdir/KDE/teams.html"`
# The HTML page says they are "presently switching from the 2-letter codes
# to the 3-letter codes". So it is safest to use the English name and
# translate ourselves...
case "$catalog" in
  af) english=Afrikaans;;
  ar) english=Arabic;;
  az) english=Azerbaijani;;
  bg) english=Bulgarian;;
  bn) english=Bengali;;
  bo) english=Tibetan;;
  br) english=Breton;;
  bs) english=Bosnian;;
  ca) english=Catalan;;
  cs) english=Czech;;
  cy) english=Welsh;;
  da) english=Danish;;
  de) english=German;;
  el) english=Greek;;
  en_GB) english="British English";;
  eo) english=Esperanto;;
  es) english=Spanish;;
  et) english=Estonian;;
  eu) english=Basque;;
  fa) english=Farsi;;
  fi) english=Finnish;;
  fo) english=Faroese;;
  fr) english=French;;
  ga) english=Irish;;
  gl) english=Gallegan;;
  gu) english=Gujarati;;
  he) english=Hebrew;;
  hi) english=Hindi;;
  hr) english=Croatian;;
  hu) english=Hungarian;;
  id) english=Indonesian;;
  is) english=Icelandic;;
  it) english=Italian;;
  ja) english=Japanese;;
  km) english=Khmer;;
  ko) english=Korean;;
  ku) english=Kurdish;;
  lt) english=Lithuanian;;
  lv) english=Latvian;;
  mi) english=Maori;;
  mk) english=Macedonian;;
  mr) english=Marathi;;
  mt) english=Maltese;;
  nl) english=Dutch;;
  no) english="Norwegian (Bokm";;
  nn) english="Norwegian (Nynorsk)";;
  oc) english=Occitan;;
  pl) english=Polish;;
  pt) english=Portuguese;;
  pt_BR) english="Brazilian Portuguese";;
  ro) english=Romanian;;
  ru) english=Russian;;
  sk) english=Slovak;;
  sl) english=Slovenian;;
  sr) english=Serbian;;
  sv) english=Swedish;;
  ta) english=Tamil;;
  tg) english=Tajik;;
  th) english=Thai;;
  tr) english=Turkish;;
  uk) english=Ukrainian;;
  vi) english=Vietnamese;;
  # ??) english=Walloon;;
  xh) english=Xhosa;;
  zh_CN) english="Simplified Chinese";;
  zh_TW) english="Traditional Chinese";;
  *) english=;;
esac
if test -n "$english"; then
  (echo "Please consider joining your translation team, and visit"
   sed_addnl='s,</TR>,</TR>\
,g'
   anchor=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e 's,^.*<TR.*<A NAME="\([^"]*\)">.*>'"$english"'[^<>]*team<.*</TR>$,\1,p'`
   if test -n "$anchor"; then
     echo "  $url#$anchor"
   fi
   echo "  $url"
   echo "  https://l10n.kde.org/"
  ) 1>&2
  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,</LI>.*,,' | sed -e 's,</A>.*,</A>,' | sed -n -e 's,^.*HREF="\([^"]*\)">[^<>]*</A>.*$,\1,p'`
  case "$address1" in
    mailto:*) address1=`echo "$address1" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;;
  esac
  address1=`echo "$address1" | sed -e 's,-request@,@,'`
  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,</LI>.*,,' | sed -e 's,</A>.*,</A>,' | sed -n -e 's,^.*HREF="\([^"]*\)">[^<>]*</A>.*$,\1,p'`
  if test -n "$address1" && test -n "$address2"; then
    address="$address1 $address2"
  else
    address="$address1$address2"
  fi
  # address can be empty or contain 1 or more space separated URLs.
else
  (echo "A translation team for your "`if test "$catalog" = "$language"; then echo "language ($language)"; else echo "local dialect ($catalog)"; fi`
   echo "may not exist yet.  Please visit"
   echo "  $url"
   echo "  https://l10n.kde.org/"
   echo "and decide whether you want to create a new translation team."
  ) 1>&2
  address=
fi
exit 0