Re: Localization and Customization of Application

From: Date: Tue, 22 Jul 2003 21:38:59 +0000
Subject: Re: Localization and Customization of Application
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-156342@lists.php.net to get a copy of this message
Chris: Thanks for the suggestion - I have peeked through Smarty - not bad - but it seems that the designer would still need to learn a different syntax. That is not an issue for this application however - I have really no need for separating the template and the code, since the template is already modifiable through an administration of configs, the problem is strictly the text modifications. From what I see in Smarty (and granted I have not spent hours going through the docs, just the high level here) I would still have the problem of creating an interface for the 'merchant' to modify their text in, then stream that text out to a file.... If that is what it ends up being - I am cool with that and can do it - I was hoping that there may be some convention for doing this that I missed somewhere (i.e. Using regex to do the text replacements, using SED to do them or something like that) But thanks for the suggestion! On 7/22/03 5:03 PM, "Chris Hubbard" <chris@wildcharacters.com> wrote: > Mike, > the easiest way to do this would be to use smarty. (smarty.php.net) > abstract out your language specific strings into a file that is called by > the template. Use a variable to define the language and use an assign to > dynamically change the language file in the template. > > Then build a function that displays a form, one input box per string, that > then writes to the language specific string file. > Chris > > > -----Original Message----- > From: Mike Morton [mailto:mike@webtraxx.com] > Sent: Tuesday, July 22, 2003 12:39 PM > To: PHP List > Subject: [PHP] Localization and Customization of Application > > > I am building a shopping cart application similar to OS Commerce. I am > trying to build it for expansion and customization right from the start, so > I have decided to start from the beginning with localization support. > > Basically, I have a file for each shopping cart 'section' that contains the > text labels as constants: > define('CART_TITLE',"Shopping Cart"); > define('CART_PAGETEXT',"Click on 'Continue Shopping' to return to the > website and continue your shopping. Click on 'Empty Cart' to clear out all > the products currently in your shopping cart. Click on \"Checkout\" to fill > out your billing information and complete your order."); > define('CART_SKU',"Sku"); > define('CART_NAME',"Name"); > define('CART_QTY',"Qty"); > define('CART_PRICE',"Price"); > define('CART_EXT',"Ext."); > define('CART_DELETE',"del"); > define('CART_EDIT',"edit"); > > The merchant has an administration where they can edit any label in the > shopping cart to be the language of their choice, or to just change a label > to be more customized to their needs. > > In the past, I have always done this with databases, i.e. CART_TITLE is a > database field that gets loaded in the shoppingcart page, and the value is > the label. > > The trouble that I am having conceptually right now is how to make a user > interface to modify the text files that define the labels without making the > merchant download, modify and then upload the file. That would involve > 'teaching' them how to do it properly - the whole purpose of this > application is that it is supposed to be easy for ANYONE to use, no HTML or > programming experience necessary. > > My first inclination is in the adminitration, to load the label file as an > array, and split out the fields for editing, then after validation, re-write > the label file using streams. > > I guess I am wondering if anyone has a more elegant solution than this? > User interface in the administration is the key here, and the method above > leaves some UI questions such as 'when viewing the administration page, how > can the user relate the label called CART_EDIT to the edit button in the > cart page?' > > If anyone has some experience in doing this, I would appreciate any > tips/insights, or even recommendations on whether this is a good way of > localizing the application! > > TIA! > -- > Cheers > > Mike Morton > > **************************************************** > * > * Tel: 905-465-1263 > * Email: mike@webtraxx.com > * > **************************************************** > > "Indeed, it would not be an exaggeration to describe the history of the > computer industry for the past decade as a massive effort to keep up with > Apple." > - Byte Magazine > > Given infinite time, 100 monkeys could type out the complete works of > Shakespeare. Win 98 source code? Eight monkeys, five minutes. > -- NullGrey > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Cheers Mike Morton **************************************************** * * Tel: 905-465-1263 * Email: mike@webtraxx.com * **************************************************** "Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple." - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey

« previous php.general (#156342) next »