From: Hani N. <ha...@na...> - 2004-09-08 13:45:41
|
Phil Daintree wrote: > >If the _ function is already there - ie gettext already compiled into >PHP then how can the variable stuff work. It would simply by-pass the >class altogether would it not?? Your shortcut function only works as >mine did to see if ! function_exists('_'). How could we over-ride the >existing function to use this class - which appears to use gettext >native if it can then if not fall back to parsing the .po file into an >array. > > > Good point, does the compiled version of gettext define a _(), I had assumed it only had the gettext() method. If it does you would need to call GetText::gettext() or create a more suitable alias. >I think Luca's DB method might be preferrable to this albeit we are into >cut and paste big time - which gettext overcomes fantastically with >xgettext. With the DB method at least we only retrieve the strings for >the script not the whole lot. > > > Just a thought if you go down this way you can still use xgettext to extract the strings for you. You could then create a couple of scripts for populating your db etc... |