[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pppoeconf translations to update



On Sun, Nov 07, 2004 at 09:30:18PM +0100, Eduard Bloch wrote:
> Hello,
> 
> I wish someone would review the attached translations from the pppoeconf
> package, update or remove fuzzy tags. Please keep Cc'ing to me since I
> am not subscribed to the list.

Eduard, many translated strings cannot be displayed because of variable
substitution.  When you write
  dialog --title $"SCANNING DEVICE" \
         --gauge $"Looking for PPPoE Access Concentrator on $iface..." \
         10 60 0
$iface is substituted before gettext lookups and msgids never match.

Gettext 0.13 provides a much better interface, you can source
/usr/bin/gettext.sh and use the eval_gettext function.
Moreover your overquotation is error prone, so in the attached patch
I removed those extra escapes (and played a bit with plural forms, which
cause few fuzzy strings but they can be fixed very easily).
You have first to run:
  $ cd debian/po
  $ for f in *.po pppoeconf.pot
  do
      msgcat -w 0 $f |\
          sed -e 's/\\\\n/\\n/g' -e 's/\\\\\\"/\\"/g' |\
          msgcat - > $f.new && mv $f.new $f
  done
  $ cd ../..
Then apply pppoeconf.patch

Gettext 0.13 is needed both in Build-Depends-Indep (because xgettext -L
Shell was introduced in this version) and Depends, but you can easily relax
these rules by defining your own functions if /usr/bin/gettext.sh or
/usr/bin/gettext do not exist.

Denis
diff -ur pppoeconf-1.0.12.sed/debian/po/update-and-compile.sh pppoeconf-1.0.12/debian/po/update-and-compile.sh
--- pppoeconf-1.0.12.sed/debian/po/update-and-compile.sh	2004-11-08 22:29:29.000000000 +0100
+++ pppoeconf-1.0.12/debian/po/update-and-compile.sh	2004-11-08 22:48:23.000000000 +0100
@@ -5,7 +5,7 @@
 
 set -e
 
-bash --dump-po-strings $DIR/$PACKAGE > pppoeconf.pot
+xgettext -L Shell -o pppoeconf.pot $DIR/$PACKAGE
 cp pppoeconf.pot templates.pot
 
 if [ "$1" == "clean" ] ; then
Seulement dans pppoeconf-1.0.12/debian/po: usr
diff -ur pppoeconf-1.0.12.sed/pppoeconf pppoeconf-1.0.12/pppoeconf
--- pppoeconf-1.0.12.sed/pppoeconf	2004-11-04 15:47:59.000000000 +0100
+++ pppoeconf-1.0.12/pppoeconf	2004-11-08 23:02:48.000000000 +0100
@@ -24,6 +24,8 @@
 PATH="/bin:/sbin:/usr/bin:/usr/sbin"
 export PATH
 
+. /usr/bin/gettext.sh
+
 # for non-root, try to reexec with sudo, warn otherwise
 if [ "`id -u`" != "0" ]; then
    # sudo only 
@@ -32,8 +34,10 @@
   elif which su-to-root >/dev/null; then
     exec su-to-root $X11 -c "$0" "$@"  || exit 1
   else
-    echo $"Please become root before running pppoeconf!"
-    echo $"Press return to continue..."
+    gettext "Please become root before running pppoeconf!"
+    echo
+    gettext "Press return to continue..."
+    echo
     read
     exit 1
   fi
@@ -77,10 +81,12 @@
 export sectempfile="`mktemp -p $TMP`"
 trap "rm -rf '$TMP'" 0 HUP INT TRAP TERM
 
-echo -e $"
-Most providers send the needed login information per mail. Some providers describe it in odd ways, assuming the user to input the data in their \"user-friendly\" setup programs. But in fact, these applications generate usuall PPP user names and passwords from the entered data. You can find the real names too and input the correct data in the dialog box.\n\nFor example, this are methods used some german providers:
+gettext '
+Most providers send the needed login information per mail. Some providers describe it in odd ways, assuming the user to input the data in their "user-friendly" setup programs. But in fact, these applications generate usuall PPP user names and passwords from the entered data. You can find the real names too and input the correct data in the dialog box.
+
+For example, this are methods used some german providers:
 
-Sample username (alias \"login\" or \"login name\"): 11111111111
+Sample username (alias "login" or "login name"): 11111111111
 
 T-Online T-DSL:
   additional data:
@@ -122,7 +128,7 @@
 Webnetix:
 
   complete username: sdt/11111111111
-" > $TMP/namehelp.txt
+' > $TMP/namehelp.txt
 
 if test "$*" ; then 
    list="$*"
@@ -131,9 +137,26 @@
 fi
 
 if test "$list" ; then
-   test "$DIALOG" = "whiptail" && escmsg=$"Or press ESC to abort here."
+   test "$DIALOG" = "whiptail" && escmsg=$(gettext 'Or press ESC to abort here.')
   number=`echo $list | wc -w| tr -d " "`
-  $DIALOG --title $"ALL DEVICES FOUND?" --clear --yesno $"I found $number ethernet device(s):\n$list\n\nAre all your ethernet interfaces listed above?\n(If No, modconf will be started so you can load the card drivers manually).\n\n$escmsg" 15 60
+  text=$(eval_ngettext \
+  'I found $number ethernet device:
+$list
+
+Are all your ethernet interfaces listed above?
+(If No, modconf will be started so you can load the card drivers manually).
+
+$escmsg' \
+  'I found $number ethernet devices:
+$list
+
+Are all your ethernet interfaces listed above?
+(If No, modconf will be started so you can load the card drivers manually).
+
+$escmsg' \
+  "$number" )
+  title=$(gettext 'ALL DEVICES FOUND?')
+  $DIALOG --title "$title" --clear --yesno "$text" 15 60
   case $? in
     1)
     # configure and restart
@@ -154,18 +177,27 @@
         touch $TMP/pppoe.scan
         ifconfig $iface up
         ($DISCOVERY_PROGRAM -A -I $iface > $TMP/$iface.pppoe ; rm $TMP/pppoe.scan) &
-        ( time=0 ; while test -f $TMP/pppoe.scan ; do time=`expr $time + 6`; echo $time; sleep 1; done ) | $DIALOG --title $"SCANNING DEVICE" --gauge $"Looking for PPPoE Access Concentrator on $iface..." 10 60 0
+        title=$(gettext 'SCANNING DEVICE')
+        text=$(eval_gettext 'Looking for PPPoE Access Concentrator on $iface...')
+        ( time=0 ; while test -f $TMP/pppoe.scan ; do time=`expr $time + 6`; echo $time; sleep 1; done ) | $DIALOG --title "$title" --gauge "$text" 10 60 0
 
      fi
   done
   cd "$TMP"
   iface=`grep -l AC *.pppoe| cut -f1 -d"." | head -n1`
   if test -z "$iface" ; then
-    $DIALOG --title $"NOT CONNECTED" --clear --msgbox $"Sorry, I scanned $number interface(s), but the Access Concentrator of your provider did not respond. Please check your network and modem cables. Another reason for the scan failure may also be another running pppoe process which controls the modem." 15 60
+    title=$(gettext 'NOT CONNECTED')
+    text=$(eval_ngettext \
+    'Sorry, I scanned $number interface, but the Access Concentrator of your provider did not respond. Please check your network and modem cables. Another reason for the scan failure may also be another running pppoe process which controls the modem.' \
+    'Sorry, I scanned $number interfaces, but the Access Concentrator of your provider did not respond. Please check your network and modem cables. Another reason for the scan failure may also be another running pppoe process which controls the modem.' \
+    $number)
+    $DIALOG --title "$title" --clear --msgbox "$text" 15 60
     rm -rf "$TMP"
     exit 1;
   fi
-  $DIALOG --title $"DSL CONNECTION FOUND" --clear --yesno $"I found an Access Concentrator on $iface. Should I setup PPPOE for this connection?" 15 60
+  title=$(gettext 'DSL CONNECTION FOUND')
+  text=$(eval_gettext 'I found an Access Concentrator on $iface. Should I setup PPPOE for this connection?')
+  $DIALOG --title "$title" --clear --yesno "$text" 15 60
   if test "$?" = "0"; then
      if [ "$kernel_pppoe" ]; then
         # sanity check first
@@ -203,7 +235,11 @@
   # STATUS: interface is $iface, we can continue
   
   if ! test "$fresh_optsfile" ; then 
-     $DIALOG --title $"OKAY TO MODIFY" --clear --yesno $"If you continue with this program, the configuration file $OPTSFILE will be modified. Please make sure that you have a backup copy before saying Yes.\n\nContinue with configuration?" 22 70
+     title=$(gettext 'OKAY TO MODIFY')
+     text=$(eval_gettext 'If you continue with this program, the configuration file $OPTSFILE will be modified. Please make sure that you have a backup copy before saying Yes.
+
+Continue with configuration?')
+     $DIALOG --title "$title" --clear --yesno "$text" 22 70
      if test "$?" != "0" ; then
         rm -rf "$TMP"
         exit 0
@@ -212,7 +248,9 @@
 
   # ask about sane options
   #$DIALOG --title $"POPULAR OPTIONS" --clear --yesno $"Most people using popular dialup providers prefer the options 'noauth' and 'defaultroute' in their configuration and remove the 'nodetach' option. Further, for busy providers the lcp-echo-interval could be increased. Should I check your configuration file and change these settings where neccessary?" 22 70
-  $DIALOG --title $"POPULAR OPTIONS" --clear --yesno $"Most people using popular dialup providers prefer the options 'noauth' and 'defaultroute' in their configuration and remove the 'nodetach' option. Should I check your configuration file and change these settings where neccessary?" 22 70
+  title=$(gettext 'POPULAR OPTIONS')
+  text=$(gettext "Most people using popular dialup providers prefer the options 'noauth' and 'defaultroute' in their configuration and remove the 'nodetach' option. Should I check your configuration file and change these settings where neccessary?")
+  $DIALOG --title "$title" --clear --yesno "$text" 22 70
   if test "$?" = "0" ; then
     grep -q '^noauth' $OPTSFILE || echo 'noauth' >> $OPTSFILE
     grep -q '^defaultroute' $OPTSFILE  || echo 'defaultroute' >> $OPTSFILE
@@ -225,7 +263,9 @@
   user=`grep ^user $OPTSFILE|cut -f2 -d" " | tr -d '"'`
   test -z "$user" && user="username"
   while test "$goahead" != "yes" ; do
-    $DIALOG --nocancel --title $"ENTER USERNAME" --clear --inputbox $"Please enter the username which you usually need for the PPP login to your provider in the input box below. If you wish to see the help screen, delete the username and press OK." 15 60 $user 2> "$sectempfile"
+    title=$(gettext 'ENTER USERNAME')
+    text=$(gettext 'Please enter the username which you usually need for the PPP login to your provider in the input box below. If you wish to see the help screen, delete the username and press OK.')
+    $DIALOG --nocancel --title "$title" --clear --inputbox "$text" 15 60 $user 2> "$sectempfile"
     user=`cat "$sectempfile"`
     case $? in
     0)
@@ -245,7 +285,11 @@
     esac
   done
 
-  $DIALOG --nocancel --title $"ENTER PASSWORD" --clear --inputbox $"Please enter the password which you usually need for the PPP login to your provider in the input box below.\n\nNOTE: you can see the password in plain text while typing." 15 60 2> "$sectempfile"
+  title=$(gettext 'ENTER PASSWORD')
+  text=$(gettext 'Please enter the password which you usually need for the PPP login to your provider in the input box below.
+
+NOTE: you can see the password in plain text while typing.')
+  $DIALOG --nocancel --title "$title" --clear --inputbox "$text" 15 60 2> "$sectempfile"
   pass=`cat "$sectempfile"`
   case $? in
   0)
@@ -263,7 +307,9 @@
   esac
 
   # ask about DNS
-  $DIALOG --title $"USE PEER DNS" --clear --yesno $"You need at least one DNS IP addresses to resolve the normal host names. Normally your provider sends you addresses of useable servers when the connection is established. Would you like to add these addresses automaticaly to the list on nameservers in your local /etc/resolv.conf file? (recommended)" 15 60
+  title=$(gettext 'USE PEER DNS')
+  text=$(gettext 'You need at least one DNS IP addresses to resolve the normal host names. Normally your provider sends you addresses of useable servers when the connection is established. Would you like to add these addresses automaticaly to the list on nameservers in your local /etc/resolv.conf file? (recommended)')
+  $DIALOG --title "$title" --clear --yesno "$text" 15 60
   case $? in
      0)
      grep -q "^usepeerdns" $OPTSFILE || echo "usepeerdns" >> $OPTSFILE
@@ -271,7 +317,15 @@
   esac
   
   # ask about MSS limitation
-  $DIALOG --title $"LIMITED MSS PROBLEM" --clear --yesno $"Many providers have routers that do not support TCP packets with a MSS higher than 1460. Usually, outgoing packets have this MSS when they go trough one real Ethernet link with the default MTU size (1500). Unfortunately, if you are forwarding packets from another hosts (ie. doing masquerading) the MSS may be increased depending on the packet size and the route to the client hosts. So your client machines won't be able to connect to some sites. There is a solution: the maximum MSS can be limited by pppoe. You can find more details about this issue in the pppoe documentation.\n\nShould pppoe clamp MSS at 1452 bytes?\n\nIf unsure, say yes.\n\n(If you still get problems described above, try setting to 1412 in the dsl-provider file.)" 22 70
+  title=$(gettext 'LIMITED MSS PROBLEM')
+  text=$(gettext "Many providers have routers that do not support TCP packets with a MSS higher than 1460. Usually, outgoing packets have this MSS when they go trough one real Ethernet link with the default MTU size (1500). Unfortunately, if you are forwarding packets from another hosts (ie. doing masquerading) the MSS may be increased depending on the packet size and the route to the client hosts. So your client machines won't be able to connect to some sites. There is a solution: the maximum MSS can be limited by pppoe. You can find more details about this issue in the pppoe documentation.
+
+Should pppoe clamp MSS at 1452 bytes?
+
+If unsure, say yes.
+
+(If you still get problems described above, try setting to 1412 in the dsl-provider file.)")
+  $DIALOG --title "$title" --clear --yesno "$text" 22 70
   case $? in
      0)
      if [ "$kernel_pppoe" ]; then
@@ -290,7 +344,9 @@
   esac
 
   if test -z "`mount | grep KNOPPIX`" ; then
-     $DIALOG --title $"DONE" --clear --yesno $"Your PPPD is configured now. Would you like to start the connection at boot time?" 15 60
+     title=$(gettext 'DONE')
+     text=$(gettext 'Your PPPD is configured now. Would you like to start the connection at boot time?')
+     $DIALOG --title "$title" --clear --yesno "$text" 15 60
      if test "$?" = "0"; then
         if [ ! -f /etc/ppp/ppp_on_boot ] ; then
            ln -s ppp_on_boot.dsl /etc/ppp/ppp_on_boot || true
@@ -303,12 +359,16 @@
   # end of story
   rm -rf "$TMP"
   
-  $DIALOG --title $"ESTABLISH A CONNECTION" --clear --yesno $"Now, you can make a DSL connection with \"pon dsl-provider\" and terminate it with \"poff\". Would you like to start the connection now?" 15 60
+  title=$(gettext 'ESTABLISH A CONNECTION')
+  text=$(gettext 'Now, you can make a DSL connection with "pon dsl-provider" and terminate it with "poff". Would you like to start the connection now?')
+  $DIALOG --title "$title" --clear --yesno "$text" 15 60
   case $? in
   0)
     cd /
     pon dsl-provider
-    $DIALOG --title $"CONNECTION INITIATED" --clear --msgbox $"The DSL connection has been triggered. You can use the \"plog\" command to see the status or \"ifconfig ppp0\" for general interface info." 10 60
+    title=$(gettext 'CONNECTION INITIATED')
+    text=$(gettext 'The DSL connection has been triggered. You can use the "plog" command to see the status or "ifconfig ppp0" for general interface info.')
+    $DIALOG --title "$title" --clear --msgbox "$text" 10 60
     ;;
   *)
     exit 0
@@ -316,7 +376,9 @@
   esac
 
 else
-  $DIALOG --title $"NO INTERFACE FOUND" --clear --yesno $"Sorry, no working ethernet card could be found. If you do have an interface card which was not autodetected so far, you probably wish to load the driver manually using the modconf utility. Run modconf now?" 20 70
+  title=$(gettext 'NO INTERFACE FOUND')
+  text=$(gettext 'Sorry, no working ethernet card could be found. If you do have an interface card which was not autodetected so far, you probably wish to load the driver manually using the modconf utility. Run modconf now?')
+  $DIALOG --title "$title" --clear --yesno "$text" 20 70
   case $? in
   0)
     rm -rf "$TMP"

Reply to: