From: skaill <sk...@ro...> - 2004-09-02 11:21:49
|
Sure, I think I can do those pages but I can only superficially test them as I'm honestly not that familiar with those areas and may not know if I've introduced an error. Unfortunately you may need to do some extended testing if you want to have good confidence in all the translation code changes. After we do each section we should get someone who is using webERP and wants translation to use it for a week or two to make sure there are no errors with what we've done. After that, proceed to the next set. The types of changes we are making theoretically should not get us into much trouble though. Although the value gets changed in the Submit (and other inputs) the name should remain the same to keep the code all in one language (English). One tricky circumstance is if 'Y' and 'N' have been used for boolean. These values get stored as data. The data cannot be translated from Y or N as stored or the logic test of if TestFlag == "Y" wouldn't work when you changed languages. It would work if you changed the right half but only for one language! The best solution is to translate when displayed. It all has to do with display time as opposed to code logic. Steve ----- Original Message ----- From: "Phil Daintree" <we...@pa...> To: <web...@li...> Sent: Thursday, September 02, 2004 6:28 AM Subject: [Web-erp-developers] Translation > Gentlemen, > > I have been having a play with gettext and have it working - it needs to > be enabled on your server.... if its not the system will product only > english. The CVS has a couple of strings in the italian messages.po for > the purposes I certainly would not vouch for the accuracy of the > translations !! However, clearly shows that it is going to work > brilliantly.... IF WE have the determination and staying power to > convert every string assigment/print statement and echo statement in the > whole system. > > Frankly, I am seriously daunted by the propsect and will not be able to > do it on my own. > > A few points about the conversion ... > > Page $title = _('Page Title'); should also be encapsulated in the get > text function. > > Single quotes ' are faster than double quotes " - PHP has to parse the > contents of double quotes for variable substitutions but doesn't for > single quotes. Strings that have variables in the middle and spaces or > html tags need to be broken up ideally eg. > > echo "<P>A long string full of $NumberOfCharacters characters"; > > would need to be re-written as: > > echo '<P>' . _('A long string full of') . ' ' . $NumberOfCharacters . ' > ' . _('characters'); > > I think it would be better to avoid having html or trailing spaces in > the translation strings. > > Jessie Peterson made a modification to the DB_query function such that > the repetitive use of > > if (DB_error_no($db) !=0) { ..... > > is no longer necessary - all you need to do is send DB_query the error > message as the 3rd parameter, the 4th parameter is the Debug message and > the 5th is whether the query is inside a transaction that should > rollback. This might be a good opportunity to tidy up calls to DB_query > to use these extra parameters too? This would take quite a bit of code > out of the scripts. > > Some submit buttons have their value checked - clearly the value of a > submit button - what is displayed on the face of it - will need to be > inside a gettext function call - so too must the comparison string eg. > > say a submit button named 'Search' is tested to see if it is hit - the > value of the button will need to be changed to the local language - > assuming the button is to have a local language label.... > > if ($_POST['Search'] == _('Search Now')){ > > Steve's approach to "eating the elephant" seemed good - lets break it > down to bite sized chunks .... > > I'll kick off with: > > AccountGroups.php > AgedDebtors.php > AgedSuppliers.php > Areas.php > BOMInquiry.php > BOMListing.php > > Steve - would you have a go at: > > BOMs.php > BankAccounts.php > BankMatching.php > BankReconciliation.php > COGSGLPostings.php > CompanyPreferences.php > > Luca - would you have a go at: > > ConfirmDispatchControlled_Invoice.php > ConfirmDispatch_Invoice.php > CreditItemsControlled.php > CreditStatus.php > Credit_Invoice.php > Currencies.php > > Rom - would you have a go at: > > CustEDISetup.php > CustWhereAlloc.php > CustomerBranches.php > CustomerInquiry.php > CustomerReceipt.php > CustomerTransInquiry.php > > > The major worry here is introducing new bugs so please test the scripts > individually and thoroughly before emailing me with them. > > Any other offers to help would be fantastic. > > Let me know if there are any other ideas or areas of ambiguity. > > If you need to see how to convert a script look at index.php or > UserSettings.php > > 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 |