initscripts

Josep Puigdemont baldrick at terra.es
Sun Mar 7 15:53:51 UTC 2004


Hi!

A few days ago I was asking something in i18n list, but unfortunately
the mail was so poorly written that no one answered. Let me try again =)
I CC to fedora-devel-list at redhat.com because I think they might also be
interested.

When we have strings to translate which are part of a script (I believe
in bash) like this one:

#: /etc/rc.d/init.d/functions:441
msgid "Start service $1 (Y)es/(N)o/(C)ontinue? [Y] "

how should be proceed in respect to the answers expected by the script?

It seems that the script would expect either 'Y', 'N' or 'C'.
Translating the string using as proposed answers the initial letters in
our language for each word might break the script.

I looked at the script and, unless I'm mistaken, it confirms that it is
not prepared for localization:

--------------------------------------------------------------------
# Confirm whether we really want to run this service
confirm() {
  [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --details=yes
  while : ; do
      echo -n $"Start service $1 (Y)es/(N)o/(C)ontinue? [Y] "
      read answer
      if strstr $"yY" "$answer" || [ "$answer" = "" ] ; then
         return 0
      elif strstr $"cC" "$answer" ; then
         rm -f /var/run/confirm
         [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client
--details=no
         return 2
      elif strstr $"nN" "$answer" ; then
         return 1
      fi
  done
}
--------------------------------------------------------------------
note: strstr is a function in that script that "returns OK if $1
contains $2".

Would it be a good suggestion to make a translatable string called
something like $YES that would hold the possible answers for Yes ("Yy")?
(and same for No and Continue)

I checked with other languages and all translate the string using that
language's initial letters as possible answers. I'm a little bit puzzled
since I think those translations will break the script, but I might be
wrong, any ideas?

Thanks!

/Josep






More information about the fedora-devel-list mailing list