From: Daintrees <p.d...@pa...> - 2004-09-09 01:31:12
|
Wow this is torture! The original objection to multi-language was the compromise to readability ... with gettext _() this is not really all that bad - it just took me a year to figure out (following Hani/Sherif's departure with OA). However, declaring variables for substitution in other positions gets more messy - another class file which is really only necessary for this and those who don't comile gettext into PHP - pretty few by all accounts is just a waste if we dont use variable substitution. Yes we could use it, but it would be dog slow and introduce more complexity than we need - we don't have to use it and the penalty is variable substituion and one or two (ok Jesse 4 or 5 dodgy translations) Complied in gettext gives us translation with some compromises in the interests of code readability - this makes the decision more simple. The php class could be built on as a hack quite easily for those who can't get gettext proper running as Steve mentions. We could and have gone round and round on this - In the final analysis I would prefer us to use: -gettext compiled in as a necessary requirement for translation - ensuring performance is not an issue -system works without gettext - just passing through the original string - no variable substitution in the interests of simplicity and readability but at the expense of completly accurate translations The good news there are 10 scripts already done this way. The bad news is that this pleases no-one .... Luca wants a db solution. Steve wants the gettext class without substitution - for gettext functionality without compilation/enabling .dlls Jesse wants the gettext class and substition - I think Hani and Jesse are on the same wavelength. I do hope you guys will all get in behind me though. Thanks for all the comments. Phil ----- Original Message ----- From: "Hani Naguib" <ha...@na...> To: <web...@li...> Sent: Thursday, September 09, 2004 1:45 AM Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > 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... > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > |