Re: Bug#383321: su-to-root => localisation ;-)
On Mon, Aug 21, 2006 at 01:54:34PM +0200, Michelle Konzack wrote:
> Am 2006-08-20 08:28:26, schrieb Christian Perrier:
> > > I have attached the 5 files (su-to-root, su-to-root.pot, su-to-root_de.po
> > > and su-to-root_fr.po su-to-root.1) which are tested and they are working.
> > >
> > > Additionaly I have attached the su-to-root_de.mo and su-to-root_fr.mo.
> >
> > There are several glitches here and there with regard to i18n:
> >
> > > usage() {
> > > GT1=$(gettext 'usage')
> > > GT2=$(gettext 'user')
> > > GT3=$(gettext 'command')
> > > GT4=$(gettext 'command is a X11 program')
> > > echo "${GT1}: $0 '[-X] [-p <${GT2}>] -c <${GT3}>" >&2
> > > echo "-X: ${GT4}" >&2
> > > exit 1
> >
> > This makes a few assumptions about the languages syntax. Indeed,
> > concatenating strings to rebuild sentences is generally a bad idea in
> > i18n programs as various languages can have various syntax.
>
> As you can see from the "echo" command, I took only the words which are
> there, and changed nothing. e.g.
>
> echo "${GT1}: $0 '[-X] [-p <${GT2}>] -c <${GT3}>" >&2
> was
> echo "usage: $0 '[-X] [-p <user>] -c <command>" >&2
>
> which will be in german
>
> echo "anwendung: $0 '[-X] [-p <benutzer>] -c <befehl>" >&2
>
> which is correct.
> The french version would be:
>
> echo "Syntaxe: $0 '[-X] [-p <utilisatur>] -c <command>" >&2
>
> So I see there no problem.
The obvious problem is that translators won't know what to do with
those single words. You should instead write something like
usage1=$(gettext 'usage: %s [-X] [-p <user>] -c <command>')
usage2=$(gettext ' -X: command is a X11 program')
printf "$usage1\n" $0 >&2
printf "$usage2\n" >&2
Denis
Reply to: