[xliff-tools] Re: Format-tags placeholders
Asgeir Frimannsson
asgeirf at redhat.com
Tue May 3 02:56:04 PDT 2005
Hi David,
On Tue, 3 May 2005 16:47, David Fraser wrote:
> >I'm all for this approach (extracting parameters to <ph> elements), if
> > it's correctly implemented. Gettext supports a wide variety of source
> > formats, and extraction should occur when one of the following flags are
> > present: awk-format
> >c-format
> >csharp-format
> >elips-format
> >gcc-internal-format
> >java-format
> >librep-format
> >lisp-format
> >objc-format
> >perl-format
> >perl-brace-format
> >php-format
> >python-format
> >sh-format
> >tcl-format
> >ycp-format
> >
> >(might have missed some)
>
> Is there a reference somewhere for these?
grep in the gettext sources did the trick for me :)
A recent manual should also contain the list:
http://info2html.sourceforge.net/cgi-bin/info2html-demo/info2html?
(gettext.info.gz)Top
(then do a text search for c-format)
> >And all these languages have different rules for how a parameter is
> >represented (E.g. {1,number} for Java, %d for C), and validating/parsing
> > all these can get complex.
> >
> >..Then you have the side-cases, like when handling parameters in Farsi,
> > you have to change %d to %Id [1].
> >
> >But yeah, it's fully possible, and I hope to implement this (including
> >re-ordering) for at least c-format in my filters. But I don't think we
> > should have it as a requirement in the guide, -but we should further
> > discuss the options.
> >
> >Another issue: Are we are using a too low level of abstraction in c-based
> > opne source applications? In Qt/KDE we're using %1, %2 etc, and do
> > further formatting of the parameters in the source code, and I see this
> > as a better approach than having complex c-parameters.
> >
> >Maybe we should start using something like:
> >printf( _("My name is %1s and I have %2s in my bank account"), name
> >format_currency(value, current_locale) )
> >
> >in favour of this approach:
> >printf( _("My name is %1s and I have USD %2d.02 in my bank account",name,
> >value)
>
> Yes, that looks Good.
> In OpenOffice.org we have to deal with the menace of having at least 9
> different styles of declaring variables:
> &xmlstyle;
> %percentbeforeandafter%
> %percentbefore
> $(dollarparentheses)
> $dollarbeforeandafter$
> $[dollarsquarebrackets]
> ${dollarcurlybrackets}
> #hashbeforeandafter#
> ($justtoconfuseeveryone)
Very interesting! Are these in different types of source files, or mixed
inside one type of sources?
cheers,
asgeir
More information about the xliff-tools
mailing list