jpayne@68: #!/bin/sh jpayne@68: # jpayne@68: # Copyright (C) 2001, 2007, 2019 Free Software Foundation, Inc. jpayne@68: # Written by Bruno Haible , 2001. jpayne@68: # jpayne@68: # This program is free software: you can redistribute it and/or modify jpayne@68: # it under the terms of the GNU General Public License as published by jpayne@68: # the Free Software Foundation; either version 3 of the License, or jpayne@68: # (at your option) any later version. jpayne@68: # jpayne@68: # This program is distributed in the hope that it will be useful, jpayne@68: # but WITHOUT ANY WARRANTY; without even the implied warranty of jpayne@68: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jpayne@68: # GNU General Public License for more details. jpayne@68: # jpayne@68: # You should have received a copy of the GNU General Public License jpayne@68: # along with this program. If not, see . jpayne@68: jpayne@68: # Print the team's address (to stdout) and output additional instructions jpayne@68: # (to stderr). jpayne@68: jpayne@68: projectsdir="$1" jpayne@68: progdir="$2" jpayne@68: catalog="$3" # e.g. "pt_BR" jpayne@68: language="$4" # e.g. "pt" jpayne@68: jpayne@68: url=`cat "$projectsdir/TP/teams.url"` jpayne@68: url_parent=`echo "$url" | sed -e 's,/[^/]*\$,/,'` jpayne@68: url_grandparent=`echo "$url" | sed -e 's,/[^/]*/[^/]*\$,/,'` jpayne@68: sed_absolute_dotdot_urls="s,href=\"\\.\\./,href=${url_grandparent},g" jpayne@68: html=`"$progdir/urlget" "$url" "$projectsdir/TP/teams.html" | sed -e "$sed_absolute_dotdot_urls"` jpayne@68: sed_addnl='s,,\ jpayne@68: ,g' jpayne@68: address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*$catalog[^<>]*[^<>]*.*\$,\\1,p" | sed 1q` jpayne@68: if test -n "$address"; then jpayne@68: case "$address" in jpayne@68: mailto:*) address=`echo "$address" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;; jpayne@68: esac jpayne@68: (echo "Please visit your translation team's homepage at" jpayne@68: echo " ${url_parent}"`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*[^<>]*[^<>]*$catalog.*\$,\\1,p" | sed 1q` jpayne@68: echo " https://translationproject.org/team/index.html" jpayne@68: echo " https://translationproject.org/html/translators.html" jpayne@68: echo " https://translationproject.org/html/welcome.html" jpayne@68: echo "and consider joining your translation team's mailing list" jpayne@68: echo " $address" jpayne@68: ) 1>&2 jpayne@68: echo "$address" jpayne@68: exit 0 jpayne@68: fi jpayne@68: address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*$language[^<>]*[^<>]*.*\$,\\1,p" | sed 1q` jpayne@68: if test -n "$address"; then jpayne@68: case "$address" in jpayne@68: mailto:*) address=`echo "$address" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;; jpayne@68: esac jpayne@68: (echo "A translation team exists for your language ($language) but not for" jpayne@68: echo "your local dialect ($catalog). You can either join the existing" jpayne@68: echo "translation team for $language or create a new translation team for $catalog." jpayne@68: echo jpayne@68: echo "Please visit the existing translation team's homepage at" jpayne@68: echo " ${url_parent}"`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*[^<>]*[^<>]*$language.*\$,\\1,p" | sed 1q` jpayne@68: echo " https://translationproject.org/team/index.html" jpayne@68: echo " https://translationproject.org/html/translators.html" jpayne@68: echo " https://translationproject.org/html/welcome.html" jpayne@68: echo "and consider joining the translation team's mailing list" jpayne@68: echo " $address" jpayne@68: echo jpayne@68: echo "If you want to create a new translation team for $catalog, please visit" jpayne@68: echo " https://translationproject.org/team/index.html" jpayne@68: echo " https://translationproject.org/html/leaders.html" jpayne@68: echo " https://translationproject.org/html/welcome.html" jpayne@68: ) 1>&2 jpayne@68: echo "$address" jpayne@68: exit 0 jpayne@68: fi jpayne@68: (echo "A translation team for your language ($language) does not exist yet." jpayne@68: echo "If you want to create a new translation team for $language"`test "$catalog" = "$language" || echo " or $catalog"`", please visit" jpayne@68: echo " https://translationproject.org/team/index.html" jpayne@68: echo " https://translationproject.org/html/leaders.html" jpayne@68: echo " https://translationproject.org/html/welcome.html" jpayne@68: ) 1>&2 jpayne@68: exit 0