Forums / Basic Configuration / Editing blocks of defines

Editing blocks of defines

Started by blarney on 29 Aug 2012, 2:04 AM · Views: 572

Results 1 to 4 of 4
29 Aug 2012, 2:04 AM
#1
blarney avatar

blarney

New Zenner

Join Date:
Oct 2005
Location:
Connectiuct
Posts:
69
Plugin Contributions:
1

Editing blocks of defines

I have a client wanting to translate their website to various languages. Part of that entails FTP'ing into the language files and changing things like this:

define('NAVBAR_TITLE_1', 'My Account');
define('NAVBAR_TITLE_2', 'Change Password');

define('HEADING_TITLE', 'It\s My Password');

define('MY_PASSWORD_TITLE', 'It\'s My Password');

I fear that this client will accidentally cut a beginning or ending apostrophe or forget to escape something (been there/done that!). I thought about striping everything out and putting it in a spreadsheet but that is quite a task. Is there a PHP editor that can make that task a bit more manageable or foolproof? Some easy way to parse those out for editing?

Thanks,
Jim

29 Aug 2012, 2:49 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,741
Plugin Contributions:
56

Re: Editing blocks of defines

If you download the language pack your client wants to translate to from the Plugins area at the top of this page, the job might already be done for you.

As for the subsequent changes he might want to make though, your best path is to test before you deploy. Get him to send you his changes. If you run them through php, the interpreter will tell you if there's a missing quotation mark. (A PHP Editor is likely more than he wants.)

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

29 Aug 2012, 1:04 PM
#3
blarney avatar

blarney

New Zenner

Join Date:
Oct 2005
Location:
Connectiuct
Posts:
69
Plugin Contributions:
1

Re: Editing blocks of defines

swguy:

If you download the language pack your client wants to translate to from the Plugins area at the top of this page, the job might already be done for you.
Yes, those are helpful but this client loves to tweak the various defines to meet his expectations. So there are quite a few overrides to contend with.

swguy:

As for the subsequent changes he might want to make though, your best path is to test before you deploy. Get him to send you his changes. If you run them through php, the interpreter will tell you if there's a missing quotation mark. (A PHP Editor is likely more than he wants.)

He's a do-it-yourselfer (and hates to pay me for any more than stuff he can't grasp or stuff he screws up :frusty: ). But him sending the changes to me for a once-over is probably the compromise we'll end up with. Just thought I'd see if there was some other solution I overlooked.

js

29 Aug 2012, 1:16 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Editing blocks of defines

Perhaps recommend that he use a syntax-aware editor like Notepad++ so that he can see when he messes up any quote marks, etc. Might save you both some trouble in the long run.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.