From: Bruno Haible Date: Fri, 7 Nov 2003 14:01:31 +0000 (+0000) Subject: Internationalize the user-email script. X-Git-Tag: v0.13~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=602de3c1640069fa1144357d768c7104517df552;p=thirdparty%2Fgettext.git Internationalize the user-email script. --- diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index 9ae2db44f..adf0dec65 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -1,3 +1,8 @@ +2003-11-05 Bruno Haible + + * configure.ac (localedir): New variable. + (src/user-email): Generate from src/user-email.sh.in. + 2003-11-04 Bruno Haible * configure.ac: Invoke gl_XSIZE. diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index bda1dee38..bf7bcbb99 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -26,6 +26,7 @@ AM_INIT_AUTOMAKE(gettext-tools, $VERSION_NUMBER) AM_CONFIG_HEADER(config.h) dnl Installation directories. +AC_SUBST([localedir], ['${datadir}/locale']) dnl Prefer modern Filesystem Hierarchy Standard over antiquated GNU standards. test "$mandir" != '${prefix}/man' || mandir='${datadir}/man' @@ -254,7 +255,7 @@ AC_CONFIG_FILES([libuniname/Makefile], AC_CONFIG_FILES([src/Makefile], [FIX_MAKEFILE_COMPILE]) -AC_CONFIG_FILES([src/user-email]) +AC_CONFIG_FILES([src/user-email:src/user-email.sh.in]) AC_CONFIG_FILES([po/Makefile.in]) diff --git a/gettext-tools/po/ChangeLog b/gettext-tools/po/ChangeLog index dc675b62e..0cbbffee4 100644 --- a/gettext-tools/po/ChangeLog +++ b/gettext-tools/po/ChangeLog @@ -1,3 +1,7 @@ +2003-11-05 Bruno Haible + + * POTFILES.in: Add src/user-email.sh.in. + 2003-10-19 Bruno Haible * POTFILES.in: Add src/format-qt.c and src/write-qt.c. diff --git a/gettext-tools/po/POTFILES.in b/gettext-tools/po/POTFILES.in index 6c2eba26a..76d80c6af 100644 --- a/gettext-tools/po/POTFILES.in +++ b/gettext-tools/po/POTFILES.in @@ -94,3 +94,4 @@ src/x-smalltalk.c src/x-tcl.c src/x-ycp.c src/xgettext.c +src/user-email.sh.in diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 8afa0f486..f6b3b3435 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,9 @@ +2003-11-05 Bruno Haible + + * user-email.sh.in: Renamed from user-email.in. Internationalize, use + localedir and gettext. + * FILES: Update. + 2003-10-23 Bruno Haible * read-stringtable.c (read_string, stringtable_parse): Cast diff --git a/gettext-tools/src/FILES b/gettext-tools/src/FILES index 677132a0a..41165df03 100644 --- a/gettext-tools/src/FILES +++ b/gettext-tools/src/FILES @@ -150,7 +150,7 @@ plural-table.c +-------------- The 'msginit' program | hostname.c | The 'hostname' program. -| user-email.in +| user-email.sh.in | Determine the user's email address. | urlget.c | The 'urlget' program. diff --git a/gettext-tools/src/user-email.sh.in b/gettext-tools/src/user-email.sh.in index bd4a7c9ac..8f89dd753 100644 --- a/gettext-tools/src/user-email.sh.in +++ b/gettext-tools/src/user-email.sh.in @@ -17,11 +17,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Prerequisites for using @libdir@. +# Prerequisites for using @libdir@ and @localedir@. prefix="@prefix@" exec_prefix="@exec_prefix@" -# Set variable @libdir@. +datadir="@datadir@" +# Set variables libdir, localedir. libdir="@libdir@" +localedir="@localedir@" # Support for relocatability. if test "@RELOCATABLE@" = yes; then @@ -45,8 +47,16 @@ if test "@RELOCATABLE@" = yes; then done # Now relocate the directory variables that we use. libdir=`echo "$libdir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'` + localedir=`echo "$localedir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'` fi +# Internationalization. +. gettext.sh +TEXTDOMAIN=gettext-tools +export TEXTDOMAIN +TEXTDOMAINDIR="$localedir" +export TEXTDOMAINDIR + # Redirect fileno 3 to interactive I/O. exec 3>/dev/tty @@ -327,9 +337,9 @@ case "$addresses" in " done while true; do - echo "Which is your email address?" 1>&3 + { gettext "Which is your email address?"; echo; } 1>&3 echo "$lines" 1>&3 - echo "Please choose the number, or enter your email address." 1>&3 + { gettext "Please choose the number, or enter your email address."; echo; } 1>&3 read answer < /dev/tty case "$answer" in *@*) ;; @@ -347,10 +357,10 @@ case "$addresses" in "<"*">") answer=`echo "$answer" | sed -e 's/^$//'` ;; esac case "$answer" in - *" "*) echo "Invalid email address: invalid character." 1>&3 ; echo 1>&3 ; continue ;; + *" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;; *@*.*) ;; - *@*) echo "Invalid email address: need a fully qualified host name or domain name." 1>&3 ; echo 1>&3 ; continue ;; - *) echo "Invalid email address: missing @" 1>&3 ; echo 1>&3 ; continue ;; + *@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;; + *) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;; esac addr=`echo "$answer" | sed -n -e "$lowercase_sed"` break @@ -359,9 +369,9 @@ case "$addresses" in " "*) # One address. while true; do - echo "Is the following your email address?" 1>&3 + { gettext "Is the following your email address?"; echo; } 1>&3 echo " $addresses" 1>&3 - echo "Please confirm by pressing Return, or enter your email address." 1>&3 + { gettext "Please confirm by pressing Return, or enter your email address."; echo; } 1>&3 read answer < /dev/tty if test -z "$answer"; then addr=`echo "$addresses" | sed -e 's/^ //'` @@ -371,10 +381,10 @@ case "$addresses" in "<"*">") answer=`echo "$answer" | sed -e 's/^$//'` ;; esac case "$answer" in - *" "*) echo "Invalid email address: invalid character." 1>&3 ; echo 1>&3 ; continue ;; + *" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;; *@*.*) ;; - *@*) echo "Invalid email address: need a fully qualified host name or domain name." 1>&3 ; echo 1>&3 ; continue ;; - *) echo "Invalid email address: missing @" 1>&3 ; echo 1>&3 ; continue ;; + *@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;; + *) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;; esac addr=`echo "$answer" | sed -n -e "$lowercase_sed"` break @@ -382,18 +392,18 @@ case "$addresses" in ;; "") # No address. - echo "Couldn't find out about your email address." 1>&3 + { gettext "Couldn't find out about your email address."; echo; } 1>&3 while true; do - echo "Please enter your email address." 1>&3 + { gettext "Please enter your email address."; echo; } 1>&3 read answer < /dev/tty case "$answer" in "<"*">") answer=`echo "$answer" | sed -e 's/^$//'` ;; esac case "$answer" in - *" "*) echo "Invalid email address: invalid character." 1>&3 ; echo 1>&3 ; continue ;; + *" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;; *@*.*) ;; - *@*) echo "Invalid email address: need a fully qualified host name or domain name." 1>&3 ; echo 1>&3 ; continue ;; - *) echo "Invalid email address: missing @" 1>&3 ; echo 1>&3 ; continue ;; + *@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;; + *) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;; esac addr=`echo "$answer" | sed -n -e "$lowercase_sed"` break