]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Internationalize the user-email script.
authorBruno Haible <bruno@clisp.org>
Fri, 7 Nov 2003 14:01:31 +0000 (14:01 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:13 +0000 (12:11 +0200)
gettext-tools/ChangeLog
gettext-tools/configure.ac
gettext-tools/po/ChangeLog
gettext-tools/po/POTFILES.in
gettext-tools/src/ChangeLog
gettext-tools/src/FILES
gettext-tools/src/user-email.sh.in

index 9ae2db44fe7be0aba940e1fca9a736f49cfa17a4..adf0dec65e9ed017f6f8e378adfff26c7c5a265b 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-05  Bruno Haible  <bruno@clisp.org>
+
+       * configure.ac (localedir): New variable.
+       (src/user-email): Generate from src/user-email.sh.in.
+
 2003-11-04  Bruno Haible  <bruno@clisp.org>
 
        * configure.ac: Invoke gl_XSIZE.
index bda1dee38a9b48a76454b3d1bbbc1064f2833dc0..bf7bcbb9967d109e1c7507a0c46203e2a62001d5 100644 (file)
@@ -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])
 
index dc675b62e53e0d61b6e41f2d1b9b73cf98cceb1f..0cbbffee41ea7d4f5deb173c452dbeb9e2f35c33 100644 (file)
@@ -1,3 +1,7 @@
+2003-11-05  Bruno Haible  <bruno@clisp.org>
+
+       * POTFILES.in: Add src/user-email.sh.in.
+
 2003-10-19  Bruno Haible  <bruno@clisp.org>
 
        * POTFILES.in: Add src/format-qt.c and src/write-qt.c.
index 6c2eba26a8051a6c858f9f661aa5f37d79745ba6..76d80c6af06735360193d6c36bfd3eae86fd13b0 100644 (file)
@@ -94,3 +94,4 @@ src/x-smalltalk.c
 src/x-tcl.c
 src/x-ycp.c
 src/xgettext.c
+src/user-email.sh.in
index 8afa0f486d8919548788e489b580f3e49365575d..f6b3b343553bf100e63a1baaea19be8a405a89de 100644 (file)
@@ -1,3 +1,9 @@
+2003-11-05  Bruno Haible  <bruno@clisp.org>
+
+       * user-email.sh.in: Renamed from user-email.in. Internationalize, use
+       localedir and gettext.
+       * FILES: Update.
+
 2003-10-23  Bruno Haible  <bruno@clisp.org>
 
        * read-stringtable.c (read_string, stringtable_parse): Cast
index 677132a0a9907b71d27b3f83f894822dc72453ec..41165df03a02e491c23b76422334f107a0d08f78 100644 (file)
@@ -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.
index bd4a7c9ac8bccd173ee975a4d47e3c81b5a861b6..8f89dd7535e164343fe5aa09c5868411ba24f470 100644 (file)
 # 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/^<//' -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/^<//' -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/^<//' -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