team-address 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh
  2. # Print the team's address (to stdout) and output additional instructions
  3. # (to stderr).
  4. projectsdir="$1"
  5. progdir="$2"
  6. catalog="$3" # e.g. "pt_BR"
  7. language="$4" # e.g. "pt"
  8. url=`cat "$projectsdir/TP/teams.url"`
  9. html=`"$progdir/urlget" "$url" "$projectsdir/TP/teams.html"`
  10. sed_addnl='s,</tr>,</tr>\
  11. ,g'
  12. address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*<td>$catalog</td>[^<>]*<td>[^|]*</td>[^<>]*<td><a href=\"\\([^\"]*\\)\">[^<>]*</a></td>.*\$,\\1,p" | sed 1q`
  13. if test -n "$address"; then
  14. case "$address" in
  15. mailto:*) address=`echo "$address" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;;
  16. esac
  17. (echo "Please visit your translation team's homepage at"
  18. echo " "`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*<td>$catalog</td>[^<>]*<td><a href=\"\\([^\"]*\\)\">[^<>]*</a></td>.*\$,\\1,p" | sed 1q`
  19. echo " http://www.iro.umontreal.ca/contrib/po/HTML/teams.html"
  20. echo " http://www.iro.umontreal.ca/contrib/po/HTML/translators.html"
  21. echo " http://www.iro.umontreal.ca/contrib/po/HTML/index.html"
  22. echo "and consider joining your translation team's mailing list"
  23. echo " $address"
  24. ) 1>&2
  25. echo "$address"
  26. exit 0
  27. fi
  28. address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*<td>$language</td>[^<>]*<td>[^|]*</td>[^<>]*<td><a href=\"\\([^\"]*\\)\">[^<>]*</a></td>.*\$,\\1,p" | sed 1q`
  29. if test -n "$address"; then
  30. case "$address" in
  31. mailto:*) address=`echo "$address" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;;
  32. esac
  33. (echo "A translation team exists for your language ($language) but not for"
  34. echo "your local dialect ($catalog). You can either join the existing"
  35. echo "translation team for $language or create a new translation team for $catalog."
  36. echo
  37. echo "Please visit the existing translation team's homepage at"
  38. echo " "`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*<td>$language</td>[^<>]*<td><a href=\"\\([^\"]*\\)\">[^<>]*</a></td>.*\$,\\1,p" | sed 1q`
  39. echo " http://www.iro.umontreal.ca/contrib/po/HTML/teams.html"
  40. echo " http://www.iro.umontreal.ca/contrib/po/HTML/translators.html"
  41. echo " http://www.iro.umontreal.ca/contrib/po/HTML/index.html"
  42. echo "and consider joining the translation team's mailing list"
  43. echo " $address"
  44. echo
  45. echo "If you want to create a new translation team for $catalog, please visit"
  46. echo " http://www.iro.umontreal.ca/contrib/po/HTML/teams.html"
  47. echo " http://www.iro.umontreal.ca/contrib/po/HTML/leaders.html"
  48. echo " http://www.iro.umontreal.ca/contrib/po/HTML/index.html"
  49. ) 1>&2
  50. echo "$address"
  51. exit 0
  52. fi
  53. (echo "A translation team for your language ($language) does not exist yet."
  54. echo "If you want to create a new translation team for $language"`test "$catalog" = "$language" || echo " or $catalog"`", please visit"
  55. echo " http://www.iro.umontreal.ca/contrib/po/HTML/teams.html"
  56. echo " http://www.iro.umontreal.ca/contrib/po/HTML/leaders.html"
  57. echo " http://www.iro.umontreal.ca/contrib/po/HTML/index.html"
  58. ) 1>&2
  59. exit 0