Hi!
When translating initscripts, I've found this:
#: /etc/rc.d/init.d/functions:441 msgid "Start service $1 (Y)es/(N)o/(C)ontinue? [Y] "
I see in Spanish they translate it as "...(S)i/(N)o/(C)ontinuar? [S] "
Same for Welsh (but different letters :), Italian, and the rest... So we'll translate it as such. But I am a little bit curious, is there some magic in the script that will understand it? How does this work?
Thanks a lot!
Regards, /Josep
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@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
On Sun, Mar 07, 2004 at 04:53:51PM +0100, Josep Puigdemont wrote:
echo -n $"Start service $1 (Y)es/(N)o/(C)ontinue? [Y] " read answer if strstr $"yY" "$answer" || [ "$answer" = "" ] ; then
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)
It is translatable (see $"yY" above). The only trouble is that the extractor script ignores it. Patch is in bugzilla. Mirek
On Sun, Mar 07, 2004 at 04:53:51PM +0100, Josep Puigdemont wrote:
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?
echo -n $"Start service $1 (Y)es/(N)o/(C)ontinue? [Y] "
Translated input string
read answer if strstr $"yY" "$answer" || [ "$answer" = "" ] ; then
Translated match letters. So there should be yY nN and cC translations
Alan -- The clouds are dark, the rain does pour But its sunny down at number four Across the road its foggy still And its snowing hard upon the hill - A guide to Swansea weather
On Sun, 2004-03-07 at 17:57, Alan Cox wrote:
On Sun, Mar 07, 2004 at 04:53:51PM +0100, Josep Puigdemont wrote:
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?
echo -n $"Start service $1 (Y)es/(N)o/(C)ontinue? [Y] "
Translated input string
read answer if strstr $"yY" "$answer" || [ "$answer" = "" ] ; then
Translated match letters. So there should be yY nN and cC translations
Couldn't find it, but Miloslav Trmac said there was a patch in bugzilla, I suppose he refers to this match letters. I'll wait until it hits CVS.
Thanks to both of you for helping.
/Josep