[MPlayer-dev-eng] New translation system

Rich Felker dalias at aerifal.cx
Thu Nov 30 19:00:01 CET 2006


On Thu, Nov 30, 2006 at 05:50:10PM +0100, Michael Niedermayer wrote:
> Hi
> 
> On Thu, Nov 30, 2006 at 02:33:25PM +0200, Uoti Urpala wrote:
> [...]
> > 
> > > > 5 Outdated, broken or intentionally harmful translation files should not
> > > >   cause crashes or security holes.
> > > 
> > > Unreasonable requirement.
> > 
> > It is doable without too much trouble and a useful property to have, so
> > in no way an unreasonable requirement.
> 
> checking all strings for validity is not terribly difficult, just search for
> all % and check that number order and type match between all corresponding
> pairs from 2 translation files
> the only thing required is the ability to enumerate all strings ...

Apparently you haven't studied the subtleties of printf. There are the
XSI extended format strings (%1$d etc.) as well as issues like
specifying the width and/or precision as arguments (%*.*s). Anyway the
greater problem is that this is a _runtime_ issue, not a compiletime
issue.

> > > Using strings as keys for looking up strings is idiotic and plain
> > > wrong, both semantically and in terms of implementation sanity.
> > > Indices are numbers not strings. We code in C not PHP.
> > 
> > Completely baseless drivel.
> 
> i am too very strongly against string based "indices"
> 
> 
> one simple implementation would be something like:
[...]

What you described is just the obvious implementation of catgets,
except that the translations are in a mmapped binary file containing
those data structures instead of in the mplayer binary.

Rich




More information about the MPlayer-dev-eng mailing list