From: Jesse P. <je...@st...> - 2004-09-05 05:45:50
|
php is interpreted in it's execution, but these functions occur within the execution, so it was a crap shoot as to which way gettext is written. Phil has repsonded to say he tested and that gettext in fact does parse & interpret the string before matching it for translation. jesse skaill wrote: >I could be way off track but I'm thinking that PHP is interpreted, not >compiled. Therefore, it does not know what to do with a string until it is >executing the function/command upon that string. For instance, the function >could be to simply copy the string. This means you would want to copy "Hi >$UserID" as "Hi $UserID", not "Hi Tom". If so, it would be the echo that >indicates what to do with the string. Since the echo is executed after the >gettext then the string passed to gettext would contain the variable name >and not the contents of the variable. > >Steve > >----- Original Message ----- >From: "Jesse Peterson" <je...@st...> >To: <web...@li...> >Sent: Sunday, September 05, 2004 12:57 AM >Subject: Re: [Web-erp-developers] file imports for serial items > > > > >>No, my thought was the translator would be told that things starting >>with $ were a variable, usually a number, (and I suppose a possible >>explanation of that) so they could just move them around in the >>translated string. I suppose a way to think of what I'm taking about is >>an array keyed by a full string, including variable, that had values of >>the translated string that should be used. >>Alas, as you said, it does not work like that with gettext - I supposed >>the 'smart' it is depends on how you might wish it to work ;) And I >>wasn't just suggesting it work the shorter code, it was really for the >>more accurate translation to help make things look that much better in >>the eyes of others. Still, being able to attract the user base of most >>any language is a very good thing, so this project you guys have >>undertaken is quite admirable. Glad I can help. >> >>jesse >> >> >>Phil Daintree wrote: >> >> >> >>>Thinking a little more - we dont really want variable names translated >>>anyway - the scripts will always be in English and using the variables >>>would be tough if they were actually translated to something else. >>> >>>gettext works on a bunch on languages as well as PHP but it is really >>>only working purely with strings. >>> >>>Phil >>> >>>On Sun, 2004-09-05 at 16:19, Jesse Peterson wrote: >>> >>> >>> >>> >>>>>>That would be a great help re internationalization. >>>>>> >>>>>> >>>>>> >>>>>> >>>>One question on this... I saw that you asked that this be done: >>>> >>>> >>>> >>>> >>>> >>>>>>echo "<P>A long string full of $NumberOfCharacters characters"; >>>>>>would need to be re-written as: >>>>>>echo '<P>' . _('A long string full of') . ' ' . $NumberOfCharacters . >>>>>> >>>>>> >' > > >>>>>>' . _('characters'); >>>>>> >>>>>> >>>>>> >>>>>> >>>>It makes perfect senses and is easy to follow. I also do not know >>>> >>>> >gettext much at all. The root of what I am wondering is if php evaluates a >variable in a "num = $TheNum" style string before gettext translates it or >not. If not, it would probably make things a lot easier on potential >translators to work with: > > >>>> _("A long string full of $NumberOfCharacters characters"); >>>>instead of: >>>> _('A long string full of') . ' ' . $NumberOfCharacters . ' ' . >>>> >>>> >_('characters'); > > >>>>Luckily our code keeper is committed to readable code, so the variable >>>> >>>> >name should generally describe what it is. That would give a translator 2 >things - more full context to what they are translating and one less >translation to do. I also know languages just enough to know that piecing >together english translations in the manner underway does not necessarily >produce coherent output. The more a message can be presented with context, >the better the translation will be. > > >>>>Just a thought - not sure how feasible it is... >>>> >>>> >>>>jesse >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>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 >>>> >>>> >>>> >>>> >>>> >>> >>>------------------------------------------------------- >>>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 >>> >>> >>> >>> >> >>------------------------------------------------------- >>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 >> >> > > > >------------------------------------------------------- >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 > > |