You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(20) |
Aug
(21) |
Sep
(12) |
Oct
(2) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
(46) |
Mar
(65) |
Apr
(49) |
May
(33) |
Jun
(5) |
Jul
(79) |
Aug
(228) |
Sep
(347) |
Oct
(272) |
Nov
(270) |
Dec
(424) |
2005 |
Jan
(549) |
Feb
(232) |
Mar
(134) |
Apr
(103) |
May
(57) |
Jun
(74) |
Jul
(67) |
Aug
(45) |
Sep
(99) |
Oct
(187) |
Nov
(238) |
Dec
(127) |
2006 |
Jan
(81) |
Feb
(137) |
Mar
(46) |
Apr
(55) |
May
(62) |
Jun
(152) |
Jul
(137) |
Aug
(154) |
Sep
(176) |
Oct
(104) |
Nov
(65) |
Dec
(64) |
2007 |
Jan
(56) |
Feb
(303) |
Mar
(88) |
Apr
(80) |
May
(72) |
Jun
(20) |
Jul
(47) |
Aug
(28) |
Sep
(113) |
Oct
(49) |
Nov
(89) |
Dec
(24) |
2008 |
Jan
(24) |
Feb
(61) |
Mar
(43) |
Apr
(51) |
May
(12) |
Jun
(10) |
Jul
(49) |
Aug
(26) |
Sep
(7) |
Oct
(50) |
Nov
(19) |
Dec
(15) |
2009 |
Jan
(87) |
Feb
(144) |
Mar
(54) |
Apr
(72) |
May
(32) |
Jun
(23) |
Jul
(27) |
Aug
(90) |
Sep
(349) |
Oct
(174) |
Nov
(320) |
Dec
(110) |
2010 |
Jan
(162) |
Feb
(39) |
Mar
(80) |
Apr
(126) |
May
(45) |
Jun
(44) |
Jul
(75) |
Aug
(32) |
Sep
(100) |
Oct
(57) |
Nov
(49) |
Dec
(125) |
2011 |
Jan
(72) |
Feb
(41) |
Mar
(63) |
Apr
(18) |
May
(123) |
Jun
(100) |
Jul
(96) |
Aug
(84) |
Sep
(83) |
Oct
(39) |
Nov
(166) |
Dec
(103) |
2012 |
Jan
(158) |
Feb
(148) |
Mar
(77) |
Apr
(43) |
May
(126) |
Jun
(82) |
Jul
(67) |
Aug
(28) |
Sep
(109) |
Oct
(30) |
Nov
(23) |
Dec
(34) |
2013 |
Jan
(14) |
Feb
(16) |
Mar
(7) |
Apr
(79) |
May
(76) |
Jun
(13) |
Jul
(76) |
Aug
(36) |
Sep
(22) |
Oct
(35) |
Nov
(167) |
Dec
(93) |
2014 |
Jan
(64) |
Feb
(14) |
Mar
(57) |
Apr
(63) |
May
(60) |
Jun
(15) |
Jul
(24) |
Aug
(19) |
Sep
(56) |
Oct
(70) |
Nov
(45) |
Dec
(52) |
2015 |
Jan
(56) |
Feb
(73) |
Mar
(34) |
Apr
(11) |
May
(24) |
Jun
(19) |
Jul
(11) |
Aug
(8) |
Sep
(25) |
Oct
(22) |
Nov
(38) |
Dec
(7) |
2016 |
Jan
(7) |
Feb
(34) |
Mar
(17) |
Apr
(10) |
May
(17) |
Jun
(7) |
Jul
(17) |
Aug
(31) |
Sep
(3) |
Oct
(34) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
|
Feb
(4) |
Mar
(18) |
Apr
(6) |
May
(10) |
Jun
(13) |
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
(1) |
2018 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
(10) |
May
(5) |
Jun
|
Jul
(7) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(2) |
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(6) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
(3) |
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(30) |
Nov
|
Dec
(2) |
From: Phil D. <we...@pa...> - 2004-09-09 10:27:13
|
That makes sense Steve. I think it may be more interesting with PDF report scripts (not that they will work in multi-language) since the LanguageSetup.php is included in PDFStarter_ros.php and we need to handle errors with html so header.inc gets included before any html output. Phil On Thu, 2004-09-09 at 21:53, skaill wrote: > I've noticed this type of thing in some scripts... > > $title = 'Receive Controlled Items'; > $PageSecurity = 11; > > /* Session started in header.inc for password checking and > authorisation level check */ > include('includes/DefinePOClass.php'); > include('includes/DefineSerialItems.php'); > include('includes/session.inc'); > include('includes/header.inc'); > > If $title was moved below session.inc and above header.inc that would > be good for $title. However, DefineSerialItems.php has a string in it > which means it also needs to be after session.inc. > > session.inc never uses any includes before it and verifies access so > I'm thinking session.inc should always be the first include anyway. > Can you confirm this Phil? > > Steve |
From: Phil D. <we...@pa...> - 2004-09-09 10:24:13
|
On Thu, 2004-09-09 at 22:08, skaill wrote: > I did a compare of all files and found a couple of issues... > > 1) In InputSerialItemsFile the last echo near the bottom of the script > needs Multilanguage done on it. There's bound to be the odd string > that gets missed. I just happened to notice this one. > > 2) CustomerTransInquiry, GoodsReceived > and GoodsReceivedControlled need $title moved below session.inc. For > both Goods session.inc should probably be moved up to be the first > include as well. > > Steve Jesse has re-hashed these I am yet to test/commit them. Phil |
From: skaill <sk...@ro...> - 2004-09-09 10:07:47
|
I did a compare of all files and found a couple of issues... 1) In InputSerialItemsFile the last echo near the bottom of the script = needs Multilanguage done on it. There's bound to be the odd string that = gets missed. I just happened to notice this one. 2) CustomerTransInquiry, GoodsReceived and GoodsReceivedControlled need = $title moved below session.inc. For both Goods session.inc should = probably be moved up to be the first include as well. Steve |
From: skaill <sk...@ro...> - 2004-09-09 09:58:39
|
Phil, in SelectCustomer, SelectProduct and SelectSupplier the following = line If ($j =3D=3D 11 AND ($RowIndex+1 !=3D = $_SESSION['DisplayRecordsMax'])){ needs to be changed to If (($j =3D=3D 11) AND ($RowIndex+1 !=3D = $_SESSION['DisplayRecordsMax'])){ I'm thinking it's probably easier just to tell you about a small change = like this as opposed to changing and sending the file. Let me know if = you want me to change and send in the future. Steve |
From: skaill <sk...@ro...> - 2004-09-09 09:52:17
|
I've noticed this type of thing in some scripts... $title =3D 'Receive Controlled Items'; $PageSecurity =3D 11; /* Session started in header.inc for password checking and authorisation = level check */ include('includes/DefinePOClass.php'); include('includes/DefineSerialItems.php'); include('includes/session.inc'); include('includes/header.inc'); If $title was moved below session.inc and above header.inc that would be = good for $title. However, DefineSerialItems.php has a string in it = which means it also needs to be after session.inc. session.inc never uses any includes before it and verifies access so I'm = thinking session.inc should always be the first include anyway. Can you = confirm this Phil? Steve |
From: skaill <sk...@ro...> - 2004-09-09 09:25:52
|
I think the include for LanguageSetup.php in session.inc needs to be = moved from the bottom of the script to the top. Same reason as $title. = session.inc calls _() but it will not be defined when gettext is not = built in. Steve |
From: skaill <sk...@ro...> - 2004-09-09 01:58:29
|
There has always been a better way to do things since the beginning of time. We could take the opportunity to rework a bazillion other things too but would it get done and would it be done right?!Decisions have to be made at some point and they need to be made with the direction and interests of the project. I am fine with your decision as always Phil. I will build the software gettext in if and when I need it. Let's remember that it's a tough position we have put Phil in considering he wasn't that crazy about Multilanguage in the first place! Steve ----- Original Message ----- From: "Daintrees" <p.d...@pa...> To: <web...@li...> Sent: Wednesday, September 08, 2004 9:33 PM Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > 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 > > > > > > ------------------------------------------------------- > 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 |
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 > |
From: skaill <sk...@ro...> - 2004-09-08 20:48:52
|
Whatever you decide, Phil I am just happy to have Multilanguage and will work on changing the scripts accordingly. I am, however, still not keen on the variable interpolation (embedded variables within strings). I just see dangers. I see the translator screwing up the variable name, dropping it all together, etc. Unless it uses the built in gettext for ALL but strings with variable interpolation then I see much more demand on the server. They are my main concerns from what I understand so far. I would, however, like an alternative software gettext included for those who can't have a built in gettext. Variable interpolation and a software gettext for those that don't have are, however, two separate issues. It's just that the software gettext has the ability to address both issues if wanted. Steve ----- Original Message ----- From: "Daintrees" <p.d...@pa...> To: <web...@li...> Sent: Wednesday, September 08, 2004 4:00 PM Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > I have yet to test them out and you mentioned they are yet to go through the > translation exercise anyway. > I should make a call on the translation stuff later class or no class. > > Phil > ----- Original Message ----- > From: "Jesse Peterson" <je...@st...> > To: <web...@li...> > Sent: Wednesday, September 08, 2004 10:55 PM > Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > > > > Phil, if you like a Class like this but need help unnecessary > > dependencies, let me/us know and I'll see what I can do. > > I'd rather see what I believe to be more complete translations, but will > > certainly support whatever is decided upon. > > > > btw, are you just sitting on the updated set of scripts I sent you > > recently waiting for this to play out? Do let me know if you have > > problems - I will work out any bugs if you find them, but I feel much > > more confident about the updated set. let me know. > > > > jesse > > > > Phil Daintree wrote: > > > > >Looks like we crossed messages. > > >I will have a look at this class in more detail - if I must :-( It would > > >be a good feature not to be dependent on gettext being compiled in. It > > >does say stable. Its miserable to have to declare variables like this > > >though! > > > > > >P > > > > > >On Wed, 2004-09-08 at 22:05, Hani Naguib wrote: > > > > > > > > >>Hi Phil, > > >>The class you mention below is the one I was talking about. It depends > > >>on PEAR but > > >>removing this dependency was really simple although I can't remember > > >>exactly what > > >>the dependency was, but it only took 30 mins to figure it out last time. > > >> > > >>In the end you end up with this extra class (one php file) and I also > > >>had another php > > >>file (language.php) in which I wrote some shortcut functions. This > > >>removes the need for > > >>having gettext compiled into php. Remember most translators will > > >>probably be working > > >>on their home pc, which probably does not have gettext. I seem to > > >>remember it was an > > >>involving process to get gettext into php. > > >> > > >>As for the variables issue I guess it will boil down to your > > >>preferrence, since it is not a very > > >>common thing, it should not affect 80% of the translations, but would > > >>mean someone > > >>translating into a new language may one day need to change the code. > > >> > > >>By the way there is also an even less common feature to keep in mind > > >>that has to do with > > >>the quantity of objects within translations. For example > > >> > > >>'You have 2 ITEMS in your bag" is fine for numbers above 1, but > > >>'You have 1 ITEMS in your bag" is incorrect. > > >> > > >>In Arabic it is even worse :) since there are three forms to consider, > > >>single, dual and plural. :) > > >> > > >>Hani > > >> > > >>Phil Daintree wrote: > > >> > > >> > > >> > > >>>*This message was transferred with a trial version of CommuniGate(tm) > Pro* > > >>>This is a good example. > > >>> > > >>>Why couldn't the translation string in messages.po be as follows > > >>> > > >>>msgid = "Display" > > >>>msgstr = "Mostra opzioni per il modulo" > > >>> > > >>>msgid = "options" > > >>>msgstr =' ' > > >>> > > >>>the output for the English version is: > > >>> > > >>>Display $module options > > >>> > > >>>the output for the Italian version is: > > >>> > > >>>Mostra opzioni per il modulo $module > > >>> > > >>>Ok, I know this wouldn't work in some situations but the point is that > > >>>there are work arounds that might involve more imaginative use of > > >>>language rather than complex code and additional classes that would > work > > >>>in a good proportion of cases. I would rather us explore these options > > >>>first. > > >>> > > >>>If we absolutely had to, > > >>>as a last resort, > > >>>after every other avenue had failed, > > >>>and there really is no other way ..... > > >>> > > >>>and AFTER we have all the scripts 'gettextified' using the absolute > bare > > >>>minimum of "fancy stuff" and if then there is still dissatisfaction I > > >>>would prefer to use a gettext class: > > >>> > > > >>>http://phptal.sourceforge.net/bagpack/GetText/doc/gettext.variableinterpo > lation.html > > >>> > > >>>this creates another dependence though and I really really only want to > > >>>depend on PHP and a DB - nothing else. If it comes to this then it > would > > >>>be better if we could include the minimal additional files in the > > >>>distribution so there is nothing extra to worry about in terms of PEAR > > >>>classes to install. > > >>> > > >>>Phil > > >>> > > >>> > > >>>On Wed, 2004-09-08 at 20:31, luc...@pd... wrote: > > >>> > > >>> > > >>> > > >>> > > >>>>Hello all. > > >>>>As stated in my previous message, I was trying to solve the problem of > sentences with one or more parameters. As an example just consider -"Display > ". $ModuleName . " options:"- in www_users. > > >>>>Here's my proposed solution. > > >>>>I am using special tags in the tobetranslated and translated sentence, > i.e : > > >>>>ENGLISH: Display __Parameter1__ options > > >>>>ITALIAN: Mostra opzioni per il modulo __Parameter1__ > > >>>> > > >>>>when I have to translate this sentence I make this call: > > >>>>translate('Display __Parameter1__ options',$ModuleName) > > >>>> > > >>>>Here's the definition of the function translate: > > >>>>function translate($idOfLabelToBeTranslated) > > >>>>{ > > >>>> global $lang; > > >>>> if ($lang[$idOfLabelToBeTranslated]!=null){ > > >>>> $numargs = func_num_args(); > > >>>> if($numargs >1){ > > >>>> $arg_list = func_get_args(); > > >>>> $returnString=$lang[$idOfLabelToBeTranslated]; > > >>>> for ($i = 0; $i < $numargs; $i++) { > > >>>> //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; > > >>>> $returnString = > str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); > > >>>> } > > >>>> return $returnString; > > >>>> } > > >>>> else //number of arguments is 1 > > >>>> return $lang[$idOfLabelToBeTranslated]; > > >>>> } > > >>>> else //there is no translated label in the array > > >>>> return $idOfLabelToBeTranslated; > > >>>>} > > >>>> > > >>>>As you can see it takes a variable number of arguments. If we have > more than 1 argumentes, i.e. some parameters have to be inserted in the > sentence, it simply gets the translated label, which contains the varios > strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter > string with the values passed as arguments. > > >>>> > > >>>>The main concern I still have on this solution is: > > >>>>"__ParameterN__" as the tobereplaced string is cabled, thus every > translator has to keep in mind to strictly use this formalism. Of course any > suggestion on how to choose a formalism wich can be surely not confused with > any real life word, will be appreciated. > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> > > >>> > > >>> > > >>>------------------------------------------------------- > > >>>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 > > > > > > ------------------------------------------------------- > 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 |
From: Daintrees <p.d...@pa...> - 2004-09-08 19:59:07
|
I have yet to test them out and you mentioned they are yet to go through the translation exercise anyway. I should make a call on the translation stuff later class or no class. Phil ----- Original Message ----- From: "Jesse Peterson" <je...@st...> To: <web...@li...> Sent: Wednesday, September 08, 2004 10:55 PM Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > Phil, if you like a Class like this but need help unnecessary > dependencies, let me/us know and I'll see what I can do. > I'd rather see what I believe to be more complete translations, but will > certainly support whatever is decided upon. > > btw, are you just sitting on the updated set of scripts I sent you > recently waiting for this to play out? Do let me know if you have > problems - I will work out any bugs if you find them, but I feel much > more confident about the updated set. let me know. > > jesse > > Phil Daintree wrote: > > >Looks like we crossed messages. > >I will have a look at this class in more detail - if I must :-( It would > >be a good feature not to be dependent on gettext being compiled in. It > >does say stable. Its miserable to have to declare variables like this > >though! > > > >P > > > >On Wed, 2004-09-08 at 22:05, Hani Naguib wrote: > > > > > >>Hi Phil, > >>The class you mention below is the one I was talking about. It depends > >>on PEAR but > >>removing this dependency was really simple although I can't remember > >>exactly what > >>the dependency was, but it only took 30 mins to figure it out last time. > >> > >>In the end you end up with this extra class (one php file) and I also > >>had another php > >>file (language.php) in which I wrote some shortcut functions. This > >>removes the need for > >>having gettext compiled into php. Remember most translators will > >>probably be working > >>on their home pc, which probably does not have gettext. I seem to > >>remember it was an > >>involving process to get gettext into php. > >> > >>As for the variables issue I guess it will boil down to your > >>preferrence, since it is not a very > >>common thing, it should not affect 80% of the translations, but would > >>mean someone > >>translating into a new language may one day need to change the code. > >> > >>By the way there is also an even less common feature to keep in mind > >>that has to do with > >>the quantity of objects within translations. For example > >> > >>'You have 2 ITEMS in your bag" is fine for numbers above 1, but > >>'You have 1 ITEMS in your bag" is incorrect. > >> > >>In Arabic it is even worse :) since there are three forms to consider, > >>single, dual and plural. :) > >> > >>Hani > >> > >>Phil Daintree wrote: > >> > >> > >> > >>>*This message was transferred with a trial version of CommuniGate(tm) Pro* > >>>This is a good example. > >>> > >>>Why couldn't the translation string in messages.po be as follows > >>> > >>>msgid = "Display" > >>>msgstr = "Mostra opzioni per il modulo" > >>> > >>>msgid = "options" > >>>msgstr =' ' > >>> > >>>the output for the English version is: > >>> > >>>Display $module options > >>> > >>>the output for the Italian version is: > >>> > >>>Mostra opzioni per il modulo $module > >>> > >>>Ok, I know this wouldn't work in some situations but the point is that > >>>there are work arounds that might involve more imaginative use of > >>>language rather than complex code and additional classes that would work > >>>in a good proportion of cases. I would rather us explore these options > >>>first. > >>> > >>>If we absolutely had to, > >>>as a last resort, > >>>after every other avenue had failed, > >>>and there really is no other way ..... > >>> > >>>and AFTER we have all the scripts 'gettextified' using the absolute bare > >>>minimum of "fancy stuff" and if then there is still dissatisfaction I > >>>would prefer to use a gettext class: > >>> > >>>http://phptal.sourceforge.net/bagpack/GetText/doc/gettext.variableinterpo lation.html > >>> > >>>this creates another dependence though and I really really only want to > >>>depend on PHP and a DB - nothing else. If it comes to this then it would > >>>be better if we could include the minimal additional files in the > >>>distribution so there is nothing extra to worry about in terms of PEAR > >>>classes to install. > >>> > >>>Phil > >>> > >>> > >>>On Wed, 2004-09-08 at 20:31, luc...@pd... wrote: > >>> > >>> > >>> > >>> > >>>>Hello all. > >>>>As stated in my previous message, I was trying to solve the problem of sentences with one or more parameters. As an example just consider -"Display ". $ModuleName . " options:"- in www_users. > >>>>Here's my proposed solution. > >>>>I am using special tags in the tobetranslated and translated sentence, i.e : > >>>>ENGLISH: Display __Parameter1__ options > >>>>ITALIAN: Mostra opzioni per il modulo __Parameter1__ > >>>> > >>>>when I have to translate this sentence I make this call: > >>>>translate('Display __Parameter1__ options',$ModuleName) > >>>> > >>>>Here's the definition of the function translate: > >>>>function translate($idOfLabelToBeTranslated) > >>>>{ > >>>> global $lang; > >>>> if ($lang[$idOfLabelToBeTranslated]!=null){ > >>>> $numargs = func_num_args(); > >>>> if($numargs >1){ > >>>> $arg_list = func_get_args(); > >>>> $returnString=$lang[$idOfLabelToBeTranslated]; > >>>> for ($i = 0; $i < $numargs; $i++) { > >>>> //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; > >>>> $returnString = str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); > >>>> } > >>>> return $returnString; > >>>> } > >>>> else //number of arguments is 1 > >>>> return $lang[$idOfLabelToBeTranslated]; > >>>> } > >>>> else //there is no translated label in the array > >>>> return $idOfLabelToBeTranslated; > >>>>} > >>>> > >>>>As you can see it takes a variable number of arguments. If we have more than 1 argumentes, i.e. some parameters have to be inserted in the sentence, it simply gets the translated label, which contains the varios strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter string with the values passed as arguments. > >>>> > >>>>The main concern I still have on this solution is: > >>>>"__ParameterN__" as the tobereplaced string is cabled, thus every translator has to keep in mind to strictly use this formalism. Of course any suggestion on how to choose a formalism wich can be surely not confused with any real life word, will be appreciated. > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>>------------------------------------------------------- > >>>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 > |
From: skaill <sk...@ro...> - 2004-09-08 14:47:27
|
I think I'm confused. I thought the script was an alternative to the built in gettext. Guess I just don't understand how it can use the built in gettext when the variables are embedded in the strings unless it ends up using the alternative software gettext every time. I'm not crazy about the db solution. It's a one shot instead of well known and tested. I think there are other ways such as building a tool that extracts the strings in the po and puts them into a database if you want to work with the database for other reasons. Building another tool that takes the database and makes a po. From what I've seen it would not be difficult to build such tools. Steve ----- Original Message ----- From: "Hani Naguib" <ha...@na...> To: <web...@li...> Sent: Wednesday, September 08, 2004 10:06 AM Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > skaill wrote: > > >When using the built in gettext you cannot have variables interpolated > >within strings. Therefore I would still suggest not to do it or you are > >relying on the software version always. I do believe the software version > >should be included though for those who cannot have it installed. It also > >sounds easy enough to include it and you're saying it's stable. > > > > > Using the script will give you the ability of having variables > interpolated, so I would suggest using it. > If you have gettext it will use it AND give you variable interpolation, > if you dont it will still work. > This is a tiny 18k script I dont see why you would not want to use it. > To me it boils down to this; > If you are going to use gettext then you should use this script if you > are going to use a db approach > do it in a way that allows you to use gettext tools such as xgettext. I > would go further and say > in a db approach you should be able to give translators .po and .pot > files which they can use in > a proper translation oriented editor. That might mean creating a few > scripts that populate/merge/update the db given .po files. > > Having said that I think the db version is overkill. > > > ------------------------------------------------------- > 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 |
From: Hani N. <ha...@na...> - 2004-09-08 14:06:30
|
skaill wrote: >When using the built in gettext you cannot have variables interpolated >within strings. Therefore I would still suggest not to do it or you are >relying on the software version always. I do believe the software version >should be included though for those who cannot have it installed. It also >sounds easy enough to include it and you're saying it's stable. > > Using the script will give you the ability of having variables interpolated, so I would suggest using it. If you have gettext it will use it AND give you variable interpolation, if you dont it will still work. This is a tiny 18k script I dont see why you would not want to use it. To me it boils down to this; If you are going to use gettext then you should use this script if you are going to use a db approach do it in a way that allows you to use gettext tools such as xgettext. I would go further and say in a db approach you should be able to give translators .po and .pot files which they can use in a proper translation oriented editor. That might mean creating a few scripts that populate/merge/update the db given .po files. Having said that I think the db version is overkill. |
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... |
From: skaill <sk...@ro...> - 2004-09-08 13:45:37
|
When using the built in gettext you cannot have variables interpolated within strings. Therefore I would still suggest not to do it or you are relying on the software version always. I do believe the software version should be included though for those who cannot have it installed. It also sounds easy enough to include it and you're saying it's stable. Checking whether the built in function exists and to call it or call the software version is the only other thing that needs to be done. Other than that we would be on the same plan we were on as far as changing the pages to provide translation. Nothing would change about that. Steve ----- Original Message ----- From: "Phil Daintree" <we...@pa...> To: <web...@li...> Sent: Wednesday, September 08, 2004 7:01 AM Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > > > > on PEAR but > > > removing this dependency was really simple although I can't remember > > > exactly what > > > the dependency was, but it only took 30 mins to figure it out last time. > > > Looks like it was just the raiseerror function ? > I had a look at OA GetText.php class and looked at a diff between them > and the current class. > > This class is actually pretty minimal ;-) > > As I understand it this will read the .po file into an array every > page... must be a shocker performance wise!! I guess it is only a fall > back though. > > 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. > > 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. > > This needs even more thought!! > > Phil > > Phil > > > > > ------------------------------------------------------- > 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 |
From: skaill <sk...@ro...> - 2004-09-08 13:35:45
|
I don't think you have to declare the variable though if you break the strings up into pieces the way we have been. That's only if the variables are embedded in the string. Steve ----- Original Message ----- From: "Phil Daintree" <we...@pa...> To: <web...@li...> Sent: Wednesday, September 08, 2004 6:19 AM Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > Looks like we crossed messages. > I will have a look at this class in more detail - if I must :-( It would > be a good feature not to be dependent on gettext being compiled in. It > does say stable. Its miserable to have to declare variables like this > though! > > P > > On Wed, 2004-09-08 at 22:05, Hani Naguib wrote: > > Hi Phil, > > The class you mention below is the one I was talking about. It depends > > on PEAR but > > removing this dependency was really simple although I can't remember > > exactly what > > the dependency was, but it only took 30 mins to figure it out last time. > > > > In the end you end up with this extra class (one php file) and I also > > had another php > > file (language.php) in which I wrote some shortcut functions. This > > removes the need for > > having gettext compiled into php. Remember most translators will > > probably be working > > on their home pc, which probably does not have gettext. I seem to > > remember it was an > > involving process to get gettext into php. > > > > As for the variables issue I guess it will boil down to your > > preferrence, since it is not a very > > common thing, it should not affect 80% of the translations, but would > > mean someone > > translating into a new language may one day need to change the code. > > > > By the way there is also an even less common feature to keep in mind > > that has to do with > > the quantity of objects within translations. For example > > > > 'You have 2 ITEMS in your bag" is fine for numbers above 1, but > > 'You have 1 ITEMS in your bag" is incorrect. > > > > In Arabic it is even worse :) since there are three forms to consider, > > single, dual and plural. :) > > > > Hani > > > > Phil Daintree wrote: > > > > >*This message was transferred with a trial version of CommuniGate(tm) Pro* > > >This is a good example. > > > > > >Why couldn't the translation string in messages.po be as follows > > > > > >msgid = "Display" > > >msgstr = "Mostra opzioni per il modulo" > > > > > >msgid = "options" > > >msgstr =' ' > > > > > >the output for the English version is: > > > > > >Display $module options > > > > > >the output for the Italian version is: > > > > > >Mostra opzioni per il modulo $module > > > > > >Ok, I know this wouldn't work in some situations but the point is that > > >there are work arounds that might involve more imaginative use of > > >language rather than complex code and additional classes that would work > > >in a good proportion of cases. I would rather us explore these options > > >first. > > > > > >If we absolutely had to, > > >as a last resort, > > >after every other avenue had failed, > > >and there really is no other way ..... > > > > > >and AFTER we have all the scripts 'gettextified' using the absolute bare > > >minimum of "fancy stuff" and if then there is still dissatisfaction I > > >would prefer to use a gettext class: > > > > > >http://phptal.sourceforge.net/bagpack/GetText/doc/gettext.variableinterpola tion.html > > > > > >this creates another dependence though and I really really only want to > > >depend on PHP and a DB - nothing else. If it comes to this then it would > > >be better if we could include the minimal additional files in the > > >distribution so there is nothing extra to worry about in terms of PEAR > > >classes to install. > > > > > >Phil > > > > > > > > >On Wed, 2004-09-08 at 20:31, luc...@pd... wrote: > > > > > > > > >>Hello all. > > >>As stated in my previous message, I was trying to solve the problem of sentences with one or more parameters. As an example just consider -"Display ". $ModuleName . " options:"- in www_users. > > >>Here's my proposed solution. > > >>I am using special tags in the tobetranslated and translated sentence, i.e : > > >>ENGLISH: Display __Parameter1__ options > > >>ITALIAN: Mostra opzioni per il modulo __Parameter1__ > > >> > > >>when I have to translate this sentence I make this call: > > >>translate('Display __Parameter1__ options',$ModuleName) > > >> > > >>Here's the definition of the function translate: > > >>function translate($idOfLabelToBeTranslated) > > >>{ > > >> global $lang; > > >> if ($lang[$idOfLabelToBeTranslated]!=null){ > > >> $numargs = func_num_args(); > > >> if($numargs >1){ > > >> $arg_list = func_get_args(); > > >> $returnString=$lang[$idOfLabelToBeTranslated]; > > >> for ($i = 0; $i < $numargs; $i++) { > > >> //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; > > >> $returnString = str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); > > >> } > > >> return $returnString; > > >> } > > >> else //number of arguments is 1 > > >> return $lang[$idOfLabelToBeTranslated]; > > >> } > > >> else //there is no translated label in the array > > >> return $idOfLabelToBeTranslated; > > >>} > > >> > > >>As you can see it takes a variable number of arguments. If we have more than 1 argumentes, i.e. some parameters have to be inserted in the sentence, it simply gets the translated label, which contains the varios strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter string with the values passed as arguments. > > >> > > >>The main concern I still have on this solution is: > > >>"__ParameterN__" as the tobereplaced string is cabled, thus every translator has to keep in mind to strictly use this formalism. Of course any suggestion on how to choose a formalism wich can be surely not confused with any real life word, will be appreciated. > > >> > > >> > > >> > > >> > > > > > > > > > > > > > > >------------------------------------------------------- > > >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 |
From: skaill <sk...@ro...> - 2004-09-08 13:17:56
|
Glad to see there's agreement on which software solution to use. I believe this is the same package Jesse also recommended. It has the variables interpolation within translated strings. Even if it doesn't get built into the base webERP, those of us who need the software answer should be able to build it in with almost no modifications to webERP. It is a self-contained addition where webERP only knows it's calling gettext whether it's built in or calls the "software" answer. Steve ----- Original Message ----- From: "Hani Naguib" <ha...@na...> To: <web...@li...> Sent: Wednesday, September 08, 2004 5:09 AM Subject: Re: [Web-erp-developers] Translation of sentence with parameters... > Hi guys just a thought, > When we did this stuff in OA we felt there was a strong > requirement not to require gettext compiled into php. I am not sure > it should have been such a strong requirement, but I did not want to > have to install it at home and my stupid host did not have it installed at > the time (he has it now). I also don't think it hurts anyway, so you might > as well have it. > We used this: > http://phptal.sourceforge.net/bagpack/GetText/ > I modified it slightly to remove the dependency to pear and also created > a lang.php which created a few shortcut functions (like _() which used > GetText). > > It also provides all this variable stuff. For example > > _set("name",$name); > _set("occupation",$occupation); > echo _("${name} works as a ${occupation}"); > > Once you guys settle on the approach I can give you a hand with some scripts > although you would have to let me know which ones :) > > Good luck, > Hani > > > luc...@pd... wrote: > > >*This message was transferred with a trial version of CommuniGate(tm) Pro* > >Hello all. > >As stated in my previous message, I was trying to solve the problem of sentences with one or more parameters. As an example just consider -"Display ". $ModuleName . " options:"- in www_users. > >Here's my proposed solution. > >I am using special tags in the tobetranslated and translated sentence, i.e : > >ENGLISH: Display __Parameter1__ options > >ITALIAN: Mostra opzioni per il modulo __Parameter1__ > > > >when I have to translate this sentence I make this call: > >translate('Display __Parameter1__ options',$ModuleName) > > > >Here's the definition of the function translate: > >function translate($idOfLabelToBeTranslated) > >{ > > global $lang; > > if ($lang[$idOfLabelToBeTranslated]!=null){ > > $numargs = func_num_args(); > > if($numargs >1){ > > $arg_list = func_get_args(); > > $returnString=$lang[$idOfLabelToBeTranslated]; > > for ($i = 0; $i < $numargs; $i++) { > > //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; > > $returnString = str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); > > } > > return $returnString; > > } > > else //number of arguments is 1 > > return $lang[$idOfLabelToBeTranslated]; > > } > > else //there is no translated label in the array > > return $idOfLabelToBeTranslated; > >} > > > >As you can see it takes a variable number of arguments. If we have more than 1 argumentes, i.e. some parameters have to be inserted in the sentence, it simply gets the translated label, which contains the varios strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter string with the values passed as arguments. > > > >The main concern I still have on this solution is: > >"__ParameterN__" as the tobereplaced string is cabled, thus every translator has to keep in mind to strictly use this formalism. Of course any suggestion on how to choose a formalism wich can be surely not confused with any real life word, will be appreciated. > > > > > > > >------------------------------------------------------- > >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 > > > > > > > > > > > > ------------------------------------------------------- > 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 |
From: Phil D. <we...@pa...> - 2004-09-08 11:01:07
|
> > on PEAR but > > removing this dependency was really simple although I can't remember > > exactly what > > the dependency was, but it only took 30 mins to figure it out last time. Looks like it was just the raiseerror function ? I had a look at OA GetText.php class and looked at a diff between them and the current class. This class is actually pretty minimal ;-) As I understand it this will read the .po file into an array every page... must be a shocker performance wise!! I guess it is only a fall back though. 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. 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. This needs even more thought!! Phil Phil |
From: Jesse P. <je...@st...> - 2004-09-08 10:55:39
|
Phil, if you like a Class like this but need help unnecessary dependencies, let me/us know and I'll see what I can do. I'd rather see what I believe to be more complete translations, but will certainly support whatever is decided upon. btw, are you just sitting on the updated set of scripts I sent you recently waiting for this to play out? Do let me know if you have problems - I will work out any bugs if you find them, but I feel much more confident about the updated set. let me know. jesse Phil Daintree wrote: >Looks like we crossed messages. >I will have a look at this class in more detail - if I must :-( It would >be a good feature not to be dependent on gettext being compiled in. It >does say stable. Its miserable to have to declare variables like this >though! > >P > >On Wed, 2004-09-08 at 22:05, Hani Naguib wrote: > > >>Hi Phil, >>The class you mention below is the one I was talking about. It depends >>on PEAR but >>removing this dependency was really simple although I can't remember >>exactly what >>the dependency was, but it only took 30 mins to figure it out last time. >> >>In the end you end up with this extra class (one php file) and I also >>had another php >>file (language.php) in which I wrote some shortcut functions. This >>removes the need for >>having gettext compiled into php. Remember most translators will >>probably be working >>on their home pc, which probably does not have gettext. I seem to >>remember it was an >>involving process to get gettext into php. >> >>As for the variables issue I guess it will boil down to your >>preferrence, since it is not a very >>common thing, it should not affect 80% of the translations, but would >>mean someone >>translating into a new language may one day need to change the code. >> >>By the way there is also an even less common feature to keep in mind >>that has to do with >>the quantity of objects within translations. For example >> >>'You have 2 ITEMS in your bag" is fine for numbers above 1, but >>'You have 1 ITEMS in your bag" is incorrect. >> >>In Arabic it is even worse :) since there are three forms to consider, >>single, dual and plural. :) >> >>Hani >> >>Phil Daintree wrote: >> >> >> >>>*This message was transferred with a trial version of CommuniGate(tm) Pro* >>>This is a good example. >>> >>>Why couldn't the translation string in messages.po be as follows >>> >>>msgid = "Display" >>>msgstr = "Mostra opzioni per il modulo" >>> >>>msgid = "options" >>>msgstr =' ' >>> >>>the output for the English version is: >>> >>>Display $module options >>> >>>the output for the Italian version is: >>> >>>Mostra opzioni per il modulo $module >>> >>>Ok, I know this wouldn't work in some situations but the point is that >>>there are work arounds that might involve more imaginative use of >>>language rather than complex code and additional classes that would work >>>in a good proportion of cases. I would rather us explore these options >>>first. >>> >>>If we absolutely had to, >>>as a last resort, >>>after every other avenue had failed, >>>and there really is no other way ..... >>> >>>and AFTER we have all the scripts 'gettextified' using the absolute bare >>>minimum of "fancy stuff" and if then there is still dissatisfaction I >>>would prefer to use a gettext class: >>> >>>http://phptal.sourceforge.net/bagpack/GetText/doc/gettext.variableinterpolation.html >>> >>>this creates another dependence though and I really really only want to >>>depend on PHP and a DB - nothing else. If it comes to this then it would >>>be better if we could include the minimal additional files in the >>>distribution so there is nothing extra to worry about in terms of PEAR >>>classes to install. >>> >>>Phil >>> >>> >>>On Wed, 2004-09-08 at 20:31, luc...@pd... wrote: >>> >>> >>> >>> >>>>Hello all. >>>>As stated in my previous message, I was trying to solve the problem of sentences with one or more parameters. As an example just consider -"Display ". $ModuleName . " options:"- in www_users. >>>>Here's my proposed solution. >>>>I am using special tags in the tobetranslated and translated sentence, i.e : >>>>ENGLISH: Display __Parameter1__ options >>>>ITALIAN: Mostra opzioni per il modulo __Parameter1__ >>>> >>>>when I have to translate this sentence I make this call: >>>>translate('Display __Parameter1__ options',$ModuleName) >>>> >>>>Here's the definition of the function translate: >>>>function translate($idOfLabelToBeTranslated) >>>>{ >>>> global $lang; >>>> if ($lang[$idOfLabelToBeTranslated]!=null){ >>>> $numargs = func_num_args(); >>>> if($numargs >1){ >>>> $arg_list = func_get_args(); >>>> $returnString=$lang[$idOfLabelToBeTranslated]; >>>> for ($i = 0; $i < $numargs; $i++) { >>>> //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; >>>> $returnString = str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); >>>> } >>>> return $returnString; >>>> } >>>> else //number of arguments is 1 >>>> return $lang[$idOfLabelToBeTranslated]; >>>> } >>>> else //there is no translated label in the array >>>> return $idOfLabelToBeTranslated; >>>>} >>>> >>>>As you can see it takes a variable number of arguments. If we have more than 1 argumentes, i.e. some parameters have to be inserted in the sentence, it simply gets the translated label, which contains the varios strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter string with the values passed as arguments. >>>> >>>>The main concern I still have on this solution is: >>>>"__ParameterN__" as the tobereplaced string is cabled, thus every translator has to keep in mind to strictly use this formalism. Of course any suggestion on how to choose a formalism wich can be surely not confused with any real life word, will be appreciated. >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>>------------------------------------------------------- >>>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 > > |
From: Phil D. <we...@pa...> - 2004-09-08 10:18:48
|
Looks like we crossed messages. I will have a look at this class in more detail - if I must :-( It would be a good feature not to be dependent on gettext being compiled in. It does say stable. Its miserable to have to declare variables like this though! P On Wed, 2004-09-08 at 22:05, Hani Naguib wrote: > Hi Phil, > The class you mention below is the one I was talking about. It depends > on PEAR but > removing this dependency was really simple although I can't remember > exactly what > the dependency was, but it only took 30 mins to figure it out last time. > > In the end you end up with this extra class (one php file) and I also > had another php > file (language.php) in which I wrote some shortcut functions. This > removes the need for > having gettext compiled into php. Remember most translators will > probably be working > on their home pc, which probably does not have gettext. I seem to > remember it was an > involving process to get gettext into php. > > As for the variables issue I guess it will boil down to your > preferrence, since it is not a very > common thing, it should not affect 80% of the translations, but would > mean someone > translating into a new language may one day need to change the code. > > By the way there is also an even less common feature to keep in mind > that has to do with > the quantity of objects within translations. For example > > 'You have 2 ITEMS in your bag" is fine for numbers above 1, but > 'You have 1 ITEMS in your bag" is incorrect. > > In Arabic it is even worse :) since there are three forms to consider, > single, dual and plural. :) > > Hani > > Phil Daintree wrote: > > >*This message was transferred with a trial version of CommuniGate(tm) Pro* > >This is a good example. > > > >Why couldn't the translation string in messages.po be as follows > > > >msgid = "Display" > >msgstr = "Mostra opzioni per il modulo" > > > >msgid = "options" > >msgstr =' ' > > > >the output for the English version is: > > > >Display $module options > > > >the output for the Italian version is: > > > >Mostra opzioni per il modulo $module > > > >Ok, I know this wouldn't work in some situations but the point is that > >there are work arounds that might involve more imaginative use of > >language rather than complex code and additional classes that would work > >in a good proportion of cases. I would rather us explore these options > >first. > > > >If we absolutely had to, > >as a last resort, > >after every other avenue had failed, > >and there really is no other way ..... > > > >and AFTER we have all the scripts 'gettextified' using the absolute bare > >minimum of "fancy stuff" and if then there is still dissatisfaction I > >would prefer to use a gettext class: > > > >http://phptal.sourceforge.net/bagpack/GetText/doc/gettext.variableinterpolation.html > > > >this creates another dependence though and I really really only want to > >depend on PHP and a DB - nothing else. If it comes to this then it would > >be better if we could include the minimal additional files in the > >distribution so there is nothing extra to worry about in terms of PEAR > >classes to install. > > > >Phil > > > > > >On Wed, 2004-09-08 at 20:31, luc...@pd... wrote: > > > > > >>Hello all. > >>As stated in my previous message, I was trying to solve the problem of sentences with one or more parameters. As an example just consider -"Display ". $ModuleName . " options:"- in www_users. > >>Here's my proposed solution. > >>I am using special tags in the tobetranslated and translated sentence, i.e : > >>ENGLISH: Display __Parameter1__ options > >>ITALIAN: Mostra opzioni per il modulo __Parameter1__ > >> > >>when I have to translate this sentence I make this call: > >>translate('Display __Parameter1__ options',$ModuleName) > >> > >>Here's the definition of the function translate: > >>function translate($idOfLabelToBeTranslated) > >>{ > >> global $lang; > >> if ($lang[$idOfLabelToBeTranslated]!=null){ > >> $numargs = func_num_args(); > >> if($numargs >1){ > >> $arg_list = func_get_args(); > >> $returnString=$lang[$idOfLabelToBeTranslated]; > >> for ($i = 0; $i < $numargs; $i++) { > >> //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; > >> $returnString = str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); > >> } > >> return $returnString; > >> } > >> else //number of arguments is 1 > >> return $lang[$idOfLabelToBeTranslated]; > >> } > >> else //there is no translated label in the array > >> return $idOfLabelToBeTranslated; > >>} > >> > >>As you can see it takes a variable number of arguments. If we have more than 1 argumentes, i.e. some parameters have to be inserted in the sentence, it simply gets the translated label, which contains the varios strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter string with the values passed as arguments. > >> > >>The main concern I still have on this solution is: > >>"__ParameterN__" as the tobereplaced string is cabled, thus every translator has to keep in mind to strictly use this formalism. Of course any suggestion on how to choose a formalism wich can be surely not confused with any real life word, will be appreciated. > >> > >> > >> > >> > > > > > > > > > >------------------------------------------------------- > >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 > |
From: Hani N. <ha...@na...> - 2004-09-08 10:06:00
|
Hi Phil, The class you mention below is the one I was talking about. It depends on PEAR but removing this dependency was really simple although I can't remember exactly what the dependency was, but it only took 30 mins to figure it out last time. In the end you end up with this extra class (one php file) and I also had another php file (language.php) in which I wrote some shortcut functions. This removes the need for having gettext compiled into php. Remember most translators will probably be working on their home pc, which probably does not have gettext. I seem to remember it was an involving process to get gettext into php. As for the variables issue I guess it will boil down to your preferrence, since it is not a very common thing, it should not affect 80% of the translations, but would mean someone translating into a new language may one day need to change the code. By the way there is also an even less common feature to keep in mind that has to do with the quantity of objects within translations. For example 'You have 2 ITEMS in your bag" is fine for numbers above 1, but 'You have 1 ITEMS in your bag" is incorrect. In Arabic it is even worse :) since there are three forms to consider, single, dual and plural. :) Hani Phil Daintree wrote: >*This message was transferred with a trial version of CommuniGate(tm) Pro* >This is a good example. > >Why couldn't the translation string in messages.po be as follows > >msgid = "Display" >msgstr = "Mostra opzioni per il modulo" > >msgid = "options" >msgstr =' ' > >the output for the English version is: > >Display $module options > >the output for the Italian version is: > >Mostra opzioni per il modulo $module > >Ok, I know this wouldn't work in some situations but the point is that >there are work arounds that might involve more imaginative use of >language rather than complex code and additional classes that would work >in a good proportion of cases. I would rather us explore these options >first. > >If we absolutely had to, >as a last resort, >after every other avenue had failed, >and there really is no other way ..... > >and AFTER we have all the scripts 'gettextified' using the absolute bare >minimum of "fancy stuff" and if then there is still dissatisfaction I >would prefer to use a gettext class: > >http://phptal.sourceforge.net/bagpack/GetText/doc/gettext.variableinterpolation.html > >this creates another dependence though and I really really only want to >depend on PHP and a DB - nothing else. If it comes to this then it would >be better if we could include the minimal additional files in the >distribution so there is nothing extra to worry about in terms of PEAR >classes to install. > >Phil > > >On Wed, 2004-09-08 at 20:31, luc...@pd... wrote: > > >>Hello all. >>As stated in my previous message, I was trying to solve the problem of sentences with one or more parameters. As an example just consider -"Display ". $ModuleName . " options:"- in www_users. >>Here's my proposed solution. >>I am using special tags in the tobetranslated and translated sentence, i.e : >>ENGLISH: Display __Parameter1__ options >>ITALIAN: Mostra opzioni per il modulo __Parameter1__ >> >>when I have to translate this sentence I make this call: >>translate('Display __Parameter1__ options',$ModuleName) >> >>Here's the definition of the function translate: >>function translate($idOfLabelToBeTranslated) >>{ >> global $lang; >> if ($lang[$idOfLabelToBeTranslated]!=null){ >> $numargs = func_num_args(); >> if($numargs >1){ >> $arg_list = func_get_args(); >> $returnString=$lang[$idOfLabelToBeTranslated]; >> for ($i = 0; $i < $numargs; $i++) { >> //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; >> $returnString = str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); >> } >> return $returnString; >> } >> else //number of arguments is 1 >> return $lang[$idOfLabelToBeTranslated]; >> } >> else //there is no translated label in the array >> return $idOfLabelToBeTranslated; >>} >> >>As you can see it takes a variable number of arguments. If we have more than 1 argumentes, i.e. some parameters have to be inserted in the sentence, it simply gets the translated label, which contains the varios strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter string with the values passed as arguments. >> >>The main concern I still have on this solution is: >>"__ParameterN__" as the tobereplaced string is cabled, thus every translator has to keep in mind to strictly use this formalism. Of course any suggestion on how to choose a formalism wich can be surely not confused with any real life word, will be appreciated. >> >> >> >> > > > > >------------------------------------------------------- >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 > > > > |
From: Phil D. <we...@pa...> - 2004-09-08 09:14:18
|
This is a good example. Why couldn't the translation string in messages.po be as follows msgid = "Display" msgstr = "Mostra opzioni per il modulo" msgid = "options" msgstr =' ' the output for the English version is: Display $module options the output for the Italian version is: Mostra opzioni per il modulo $module Ok, I know this wouldn't work in some situations but the point is that there are work arounds that might involve more imaginative use of language rather than complex code and additional classes that would work in a good proportion of cases. I would rather us explore these options first. If we absolutely had to, as a last resort, after every other avenue had failed, and there really is no other way ..... and AFTER we have all the scripts 'gettextified' using the absolute bare minimum of "fancy stuff" and if then there is still dissatisfaction I would prefer to use a gettext class: http://phptal.sourceforge.net/bagpack/GetText/doc/gettext.variableinterpolation.html this creates another dependence though and I really really only want to depend on PHP and a DB - nothing else. If it comes to this then it would be better if we could include the minimal additional files in the distribution so there is nothing extra to worry about in terms of PEAR classes to install. Phil On Wed, 2004-09-08 at 20:31, luc...@pd... wrote: > Hello all. > As stated in my previous message, I was trying to solve the problem of sentences with one or more parameters. As an example just consider -"Display ". $ModuleName . " options:"- in www_users. > Here's my proposed solution. > I am using special tags in the tobetranslated and translated sentence, i.e : > ENGLISH: Display __Parameter1__ options > ITALIAN: Mostra opzioni per il modulo __Parameter1__ > > when I have to translate this sentence I make this call: > translate('Display __Parameter1__ options',$ModuleName) > > Here's the definition of the function translate: > function translate($idOfLabelToBeTranslated) > { > global $lang; > if ($lang[$idOfLabelToBeTranslated]!=null){ > $numargs = func_num_args(); > if($numargs >1){ > $arg_list = func_get_args(); > $returnString=$lang[$idOfLabelToBeTranslated]; > for ($i = 0; $i < $numargs; $i++) { > //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; > $returnString = str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); > } > return $returnString; > } > else //number of arguments is 1 > return $lang[$idOfLabelToBeTranslated]; > } > else //there is no translated label in the array > return $idOfLabelToBeTranslated; > } > > As you can see it takes a variable number of arguments. If we have more than 1 argumentes, i.e. some parameters have to be inserted in the sentence, it simply gets the translated label, which contains the varios strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter string with the values passed as arguments. > > The main concern I still have on this solution is: > "__ParameterN__" as the tobereplaced string is cabled, thus every translator has to keep in mind to strictly use this formalism. Of course any suggestion on how to choose a formalism wich can be surely not confused with any real life word, will be appreciated. > > |
From: Hani N. <ha...@na...> - 2004-09-08 09:09:36
|
Hi guys just a thought, When we did this stuff in OA we felt there was a strong requirement not to require gettext compiled into php. I am not sure it should have been such a strong requirement, but I did not want to have to install it at home and my stupid host did not have it installed at the time (he has it now). I also don't think it hurts anyway, so you might as well have it. We used this: http://phptal.sourceforge.net/bagpack/GetText/ I modified it slightly to remove the dependency to pear and also created a lang.php which created a few shortcut functions (like _() which used GetText). It also provides all this variable stuff. For example _set("name",$name); _set("occupation",$occupation); echo _("${name} works as a ${occupation}"); Once you guys settle on the approach I can give you a hand with some scripts although you would have to let me know which ones :) Good luck, Hani luc...@pd... wrote: >*This message was transferred with a trial version of CommuniGate(tm) Pro* >Hello all. >As stated in my previous message, I was trying to solve the problem of sentences with one or more parameters. As an example just consider -"Display ". $ModuleName . " options:"- in www_users. >Here's my proposed solution. >I am using special tags in the tobetranslated and translated sentence, i.e : >ENGLISH: Display __Parameter1__ options >ITALIAN: Mostra opzioni per il modulo __Parameter1__ > >when I have to translate this sentence I make this call: >translate('Display __Parameter1__ options',$ModuleName) > >Here's the definition of the function translate: >function translate($idOfLabelToBeTranslated) >{ > global $lang; > if ($lang[$idOfLabelToBeTranslated]!=null){ > $numargs = func_num_args(); > if($numargs >1){ > $arg_list = func_get_args(); > $returnString=$lang[$idOfLabelToBeTranslated]; > for ($i = 0; $i < $numargs; $i++) { > //echo "Argument $i is: " . $arg_list[$i] . "<br />\n"; > $returnString = str_replace('__Parameter'.$i.'__',$arg_list[$i],$returnString); > } > return $returnString; > } > else //number of arguments is 1 > return $lang[$idOfLabelToBeTranslated]; > } > else //there is no translated label in the array > return $idOfLabelToBeTranslated; >} > >As you can see it takes a variable number of arguments. If we have more than 1 argumentes, i.e. some parameters have to be inserted in the sentence, it simply gets the translated label, which contains the varios strings __Parameter1__ ... __ParameterN__. Then it substitutes the parameter string with the values passed as arguments. > >The main concern I still have on this solution is: >"__ParameterN__" as the tobereplaced string is cabled, thus every translator has to keep in mind to strictly use this formalism. Of course any suggestion on how to choose a formalism wich can be surely not confused with any real life word, will be appreciated. > > > >------------------------------------------------------- >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 > > > > |
From: <luc...@pd...> - 2004-09-08 08:32:19
|
Hello all. As stated in my previous message, I was trying to solve the p= roblem of sentences with one or more parameters. As an example just consi= der -"Display ". $ModuleName . " options:"- in www_users. Here's my prop= osed solution. I am using special tags in the tobetranslated and transla= ted sentence, i.e : ENGLISH: Display __Parameter1__ options ITALIAN: M= ostra opzioni per il modulo __Parameter1__ when I have to translate t= his sentence I make this call: translate('Display __Parameter1__ options= ',$ModuleName) Here's the definition of the function translate: funct= ion translate($idOfLabelToBeTranslated) { global $lang; if ($lan= g[$idOfLabelToBeTranslated]!=3Dnull){ $numargs =3D func_num_args()= ; if($numargs >1){ $arg_list =3D func_get_args(); = $returnString=3D$lang[$idOfLabelToBeTranslated]; for ($i =3D 0= ; $i < $numargs; $i++) { //echo "Argument $i is: " . $arg_list= [$i] . "<br />\n"; $returnString =3D str_replace('__Parameter'= .$i.'__',$arg_list[$i],$returnString); } return $return= String; } else //number of arguments is 1 return = $lang[$idOfLabelToBeTranslated]; } else //there is no translated = label in the array return $idOfLabelToBeTranslated; } As you ca= n see it takes a variable number of arguments. If we have more than 1 arg= umentes, i.e. some parameters have to be inserted in the sentence, it sim= ply gets the translated label, which contains the varios strings __Parame= ter1__ ... __ParameterN__. Then it substitutes the parameter string with = the values passed as arguments. The main concern I still have on this = solution is: "__ParameterN__" as the tobereplaced string is cabled, thus= every translator has to keep in mind to strictly use this formalism. Of = course any suggestion on how to choose a formalism wich can be surely not= confused with any real life word, will be appreciated. |
From: Phil D. <we...@pa...> - 2004-09-08 07:56:32
|
Only one other point to add guys session.inc must be included after $PageSecurity = x; $PageSecurity is checked to see if the user is authorised inside session.inc Phil On Wed, 2004-09-08 at 10:02, skaill wrote: > Couldn't say I was sure so I'm glad we figured out what was happening for > sure. > > Just to emphasize, I'll repeat what you said so everyone knows or all the > pages will be incorrect. > > Whoever is doing the pages for Multilanguage needs to move the line that > sets $title to a string near the top of every page to after the session.inc > include but before header.inc. header.inc uses $title so it must be set and > translated before header.inc. > > Steve > > ----- Original Message ----- > From: "Jesse Peterson" <je...@st...> > To: <web...@li...> > Sent: Tuesday, September 07, 2004 4:58 PM > Subject: RE: [Web-erp-developers] Re: input & goods received mods > > > Ok, I took another look and realized I was just foolish in my original post. > You probably don't have gettext enabled.... I never actually looked, only > grep'd to see if the gettext stuff is in session.inc - it is included in > session.inc . Not having that function defined when gettext is not > functional has to be what is causing you problem. > So, I imagine to make Language support work across the board, your original > statement that session.inc needs to be the first include in every script is > dead-on. > Sorry to have caused doubt/confusion. > > > jesse > > -----Original Message----- > From: skaill [mailto:sk...@ro...] > Sent: Tuesday, September 07, 2004 3:51 PM > To: web...@li... > Subject: Re: [Web-erp-developers] Re: input & goods received mods > > > If I put the $title line at the top before session.inc include then I get an > error. I have not tampered with my session.auto_start or any other php > settings. That was just information I passed on the other day but did not > try. I'm thinking since the _() function is defined in session.inc as far > as I see this would mean that the $title translation call is before the > translation _() function is defined. I can't remember if php sees all > functions in the includes whether before encountered or not though. I'm > thinking not. > > The error is > > Fatal error: Call to undefined function: _() in > /home/weberp/public_html/weberpcvstest/BankAccounts.php on line 4 > > when $title is before the session.inc include. > > Steve > > ----- Original Message ----- > From: "Jesse Peterson" <je...@st...> > To: <web...@li...> > Sent: Monday, September 06, 2004 11:54 AM > Subject: Re: [Web-erp-developers] Re: input & goods received mods > > > > > > >That is interesting that you had to include session.inc before $title > > >was set. This doesn't appear necessary in php 5 and I have not done this > > >in the scripts I have modified - I will go back and modify them. I > > >thought it would be necessary initially. > > > > > > > > I don't have this problem ... I even see some scripts I am running out > > of yesterday's CVS have this change made and seem to work fine. Steve, > > maybe this is a result of mucking with the session.auto_start variable > > you mentioned in a post some days ago?? For the record, I am running > > under php 4.3.4 . > > > ------------------------------------------------------- > 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=ick > _______________________________________________ > 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 > |
From: Daintrees <p.d...@pa...> - 2004-09-08 07:23:18
|
Darn!! I have done quite a few already! Phil ----- Original Message ----- From: "skaill" <sk...@ro...> To: <web...@li...> Sent: Wednesday, September 08, 2004 10:02 AM Subject: Re: [Web-erp-developers] Re: input & goods received mods > Couldn't say I was sure so I'm glad we figured out what was happening for > sure. > > Just to emphasize, I'll repeat what you said so everyone knows or all the > pages will be incorrect. > > Whoever is doing the pages for Multilanguage needs to move the line that > sets $title to a string near the top of every page to after the session.inc > include but before header.inc. header.inc uses $title so it must be set and > translated before header.inc. > > Steve > > ----- Original Message ----- > From: "Jesse Peterson" <je...@st...> > To: <web...@li...> > Sent: Tuesday, September 07, 2004 4:58 PM > Subject: RE: [Web-erp-developers] Re: input & goods received mods > > > Ok, I took another look and realized I was just foolish in my original post. > You probably don't have gettext enabled.... I never actually looked, only > grep'd to see if the gettext stuff is in session.inc - it is included in > session.inc . Not having that function defined when gettext is not > functional has to be what is causing you problem. > So, I imagine to make Language support work across the board, your original > statement that session.inc needs to be the first include in every script is > dead-on. > Sorry to have caused doubt/confusion. > > > jesse > > -----Original Message----- > From: skaill [mailto:sk...@ro...] > Sent: Tuesday, September 07, 2004 3:51 PM > To: web...@li... > Subject: Re: [Web-erp-developers] Re: input & goods received mods > > > If I put the $title line at the top before session.inc include then I get an > error. I have not tampered with my session.auto_start or any other php > settings. That was just information I passed on the other day but did not > try. I'm thinking since the _() function is defined in session.inc as far > as I see this would mean that the $title translation call is before the > translation _() function is defined. I can't remember if php sees all > functions in the includes whether before encountered or not though. I'm > thinking not. > > The error is > > Fatal error: Call to undefined function: _() in > /home/weberp/public_html/weberpcvstest/BankAccounts.php on line 4 > > when $title is before the session.inc include. > > Steve > > ----- Original Message ----- > From: "Jesse Peterson" <je...@st...> > To: <web...@li...> > Sent: Monday, September 06, 2004 11:54 AM > Subject: Re: [Web-erp-developers] Re: input & goods received mods > > > > > > >That is interesting that you had to include session.inc before $title > > >was set. This doesn't appear necessary in php 5 and I have not done this > > >in the scripts I have modified - I will go back and modify them. I > > >thought it would be necessary initially. > > > > > > > > I don't have this problem ... I even see some scripts I am running out > > of yesterday's CVS have this change made and seem to work fine. Steve, > > maybe this is a result of mucking with the session.auto_start variable > > you mentioned in a post some days ago?? For the record, I am running > > under php 4.3.4 . > > > ------------------------------------------------------- > 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=ick > _______________________________________________ > 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 > |