[MPlayer-dev-eng] New translation system
Michael Niedermayer
michaelni at gmx.at
Thu Nov 30 19:15:55 CET 2006
Hi
On Thu, Nov 30, 2006 at 07:37:20PM +0200, Uoti Urpala wrote:
> On Thu, 2006-11-30 at 17:50 +0100, Michael Niedermayer wrote:
> > i am too very strongly against string based "indices"
>
> Why? Your opinion doesn't have much weight if you don't have any
> arguments to support it.
yes i know
> Using integer indices has practical drawbacks;
> so far the only arguments expressed against string indices (not against
> gettext specifically, which certainly does have valid arguments both for
> and against) have been Rich's performance arguments which do not make
> any difference in reality.
ok here are some arguments
* slower (this does matter if there is alot of text output, i dunno if there
are any cases where there is alot of translatebale output though as higher
level debuging stuff generally isnt translated but still ...)
* if the english string is used as only key then there is the serious problem
that the same string might depening on context need different translations
* also if strings are used then these will end in the object files and
depening on linker and compiler ill likely get duplicated all over the
final binary increasing its size
* if english isnt wanted then your out of luck space saving wise, as the
strings are hardcoded all over the place
* and a pretty important one how do you actually find a turkish string from
an english key? do you have a table with the english and turkish string
pairs if so the english keys would be dupllicated once for every language
thats huge amount of space waste, and the alternative to map the english
text first to an integer and then use that as index into an array of
turkish strings or similar well uhm in that case the string-key is just
a useless extra layer which need mem space, disk space and cpu time
OTOH what advantage does a string-key have?
i cant see any, if you want the string in the source then a preprocessor
macro or enum whos name matches the string will do too
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the MPlayer-dev-eng
mailing list