From: Jesse P. <je...@st...> - 2004-09-07 22:27:26
|
From the discussions the past few days, I'm kinda confused as to if or which translation technique has been settled/re-settled on. Should we be progressing with the _() method? going with some other syntax/functions to support strings w/ embedded variables? something else? Phil - can you point me straight? jesse Daintrees wrote: >Glad to have you back Luca. > >As noted previosuly, I am also very keen on having the ability to make >translations in a web-form that feed through into the application >immediately. I have been exchanging email with Rom regarding this and have >basically spec'd up the way this could be done by reading in a meesages.po >file and showing the original msgid strings and the following msgstr string. >Having edited and re-written the messages.po file using a simple php scrip >behind the scenes re-running the gettext utility to create the .mo file. >Stopping and starting apache does not seem to be required. Rom is keen to >get into this project - it would certainly have wider appeal than just >webERP and would give us the advantages you are seeking as well as the >generic localisation code used by most php applications. > >The way we have things will allow for the translation effort to proceed with >no impact on the usability of the system. > >The two issues important to you are also citical for me to: > >1. having the application working at any time, even during translation >2. having a simple way to translate without the danger of destroying the >application. > >We have to modify the scripts under either scenario - the gettext method I >believe will be a heck of a lot less work and could be done with concerted >effort by us all within the month. > >The .po file can be edited at will an copied around for translators to work >on at their leisure - notebook or wherever without connectivity. The system >still clicks over. Using the web form translation proposed by Rom this could >also be done on line. > >Having gone a little way down this track I feel committed to this approach >Luca. The web-form editing application Rom has suggested also looks to >address our key concerns too. > > > >>A translation with the gettext approach is done without >>simultaneously looking at the application. >> >> > >This is a problem although the .po file does tell you in which script the >string appears - so you can look at the english application. > >All approaches are a compromise and with the method we have chosen - I think >we can build a pretty good system. > >Phil > >----- Original Message ----- >From: "ing. Luca Turlon Donà" <luc...@pd...> >To: <web...@li...> >Sent: Tuesday, September 07, 2004 2:34 AM >Subject: [Web-erp-developers] Italian Translation > > > > >>Hello Phil, >>sorry for my silence, but I had some troubles that kept me away from work. >>I've seen that you started to work on the gettext solution. >> >>I've spent some time last week to study the approach of gettext, and my >>opinion is that we the gettext solution is efficient but has the problem >> >> >that > > >>the translations can be done without any control, i.e. you simply change a >>text file. >> >>Given thsi I have started thinking how I could get the best from the >> >> >gettext > > >>approach and still keeping the db repository for the languages. >>I made some experiment and sorted out the following. >> >>In my "language.php" file I've defined a function translate(), which >> >> >receives > > >>a parameter which can be a string or an identifier. The function uses the >>$lang array, which contains all the translations needed, and which is >> >> >loaded > > >>at the beginning. >> >>function translate($idOfLabelToBeTranslated) >>{ >> global $lang; >> if ($lang[$idOfLabelToBeTranslated]!=null) >> return $lang[$idOfLabelToBeTranslated]; >> else >> return $idOfLabelToBeTranslated; >>} >> >>As you can see translate simply returns the translated message, which has >> >> >then > > >>to be echoed (so it is very similar to gettext_noop...) >> >>I also enlarged the db column containing the label identifier: now it's >> >> >100 > > >>chars and can be enlarged again. >>Since $idOfLabelToBeTranslated can be a string you can maintain code >>readability, as you can see in the following chunk of code from >>SelectCustomer.php >> >>.... >>if ($_POST['Search']==translate("Search Now")){ >> >>If ($_POST['Keywords'] AND $_POST['CustCode']) { >>$msg= translate("Customer name keywords have been used in >>preference to the customer code extract entered."); >>$_POST["Keywords"] = strtoupper($_POST["Keywords"]); >>} >>If ($_POST['Keywords']=="" AND $_POST['CustCode']=="") { >>$msg=translate("At least one customer name keyword OR an >>extract of a customer code must be entered for the search"); >>..... >> >>As you can understand, using this approach I am addressing your main >> >> >concern, > > >>which is maintaining the code easy to read. >> >>But also I am addressing my 2 concerns: having the application working at >> >> >any > > >>time, even during translation, and having a simple way to translate >> >> >without > > >>the danger of destroying the application. These issues are very important >> >> >to > > >>me; since I believe that a translator have to be free to see exactly where >> >> >a > > >>certain sentence appears, in order to deeply understand the meaning and >> >> >give a > > >>proper translation. A translation with the gettext approach is done >> >> >without > > >>simultaneously looking at the application. Using my approach you can have >> >> >one > > >>browser on the application and the other one in the application created >> >> >for > > >>translation (i.e. some php pages that show the original and let you write >> >> >the > > >>translation in a form) >> >>Now I am trying to solve the problem of parameters within a sentence, and >> >> >in > > >>particular the fact that the position of parameters can change from one >>language to another (see the english-german example in the gettext >>documentation).. >> >>Finally: Phil, if you don't like this approach, i am going to bend down >> >> >and > > >>conform to you decision. The use of "translate" function is exactly as >>gettext_noop, so it'll be easy to adapt. But please first try to consider >> >> >the > > >>db solution. >>Luca >> >> >>------------------------------------------------------- >>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_idP47&alloc_id808&op=click >_______________________________________________ >Web-erp-developers mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/web-erp-developers > > |