Thoughts about moving translation call to inside gui template - Printable Version +- ispCP - Board - Support (http://www.isp-control.net/forum) +-- Forum: ispCP Omega Development Area (/forum-1.html) +--- Forum: Suggestions (/forum-2.html) +--- Thread: Thoughts about moving translation call to inside gui template (/thread-12009.html) |
Thoughts about moving translation call to inside gui template - kassah - 10-31-2010 02:23 AM As I have been exploring making a new theme, I noticed that I am restricted to strings that are passed to the smarty template. I'm just pondering if you'd be open to moving the tr("string") call from the PHP files into the templates themselves (making a callback in the pTemplate engine for dealing with it). I'd be happy to make up the bug & patch for it, just want to check into the community for 1. would the developers like such a thing 2. would this overwhelmingly screw up those who already made custom templates? Thanks, Will Edit: Changed question to apply to pTemplate per sci2tech's response below. RE: Thoughts about moving translation call to inside gui template - sci2tech - 10-31-2010 03:47 AM We do not use smarty . It`s pTemplate RE: Thoughts about moving translation call to inside gui template - kassah - 10-31-2010 03:59 AM (10-31-2010 03:47 AM)sci2tech Wrote: We do not use smarty . It`s pTemplate Huh... you're right what do ya know! =P Looking over it (I could be wrong), but it doesn't look like it would be to hard to add a callback setup for dealing with translations. Course it doesn't change the core of the question =). RE: Thoughts about moving translation call to inside gui template - kassah - 10-31-2010 06:30 AM (10-31-2010 03:47 AM)sci2tech Wrote: We do not use smarty . It`s pTemplate Did up a quick example patch:
You can see my changes at my github as well: http://github.com/kassah/ispCP/commit/831a62438791bceab5238ac08e563a78e9ce300b (Keep in mind this is the second of two commits, the patch attached to the forum post includes both, first one fixes a bug) RE: Thoughts about moving translation call to inside gui template - sci2tech - 10-31-2010 06:43 AM Why you want do this change? See that your modification break automated string extract used for po creation (not a big deal, script can be rewritten). BTW, If you want to involve more, I`ll propose you for dev team. RE: Thoughts about moving translation call to inside gui template - kassah - 10-31-2010 07:13 AM (10-31-2010 06:43 AM)sci2tech Wrote: Why you want do this change? See that your modification break automated string extract used for po creation (not a big deal, script can be rewritten). Well it just frees me up on custom theming, I don't have to be limited to the strings that the php gives me, instead I can grab the ones I want in the template. (10-31-2010 06:43 AM)sci2tech Wrote: BTW, If you want to involve more, I`ll propose you for dev team. I do want to be involved more, but I don't want to be on the dev team just yet. This is my second week messing around with ispCP, and only second day really wading into the code. The reason for my initial flurry of activity is trying to bring ispCP features wise up to around where Plesk is (or at least the features my customers use), so that I can move my hosting company over to it. Of course, I want to get as many of those features accepted into stock ispCP, so I have less to maintain on the side by myself . Once I've moved my company to actually using it, then I would love to revisit becoming a dev. Because then I will have a lasting interest in ispCP Also, my goals for my move are very pointed, and they may not match up with ispCP's long term goals. You guys might want to be able to sort through my patches and understand what you actually want to add to ispCP, and what doesn't match your mission =). All that being said, if there is something you want attention to, but don't have time. I'd be happy to drop some attention on it . RE: Thoughts about moving translation call to inside gui template - sci2tech - 10-31-2010 07:21 AM From my point of view, should not be a problem to add your patch. The only problem will be that po generation will take longer because theme files must be parsed too for strings needed to be translated. Lets wait other devs opinion (especially Nuxwin which is Dev Team leader). RE: Thoughts about moving translation call to inside gui template - kassah - 11-03-2010 01:12 PM I did notice there is a Smarty branch, might be worth waiting on them depending on their timeline. I am not a paticular fan of Smarty, but it does make some things easier. I generally clone ZF's template system, just phtml files (i.e. php files with lots of html). The more advanced you get with Smarty stuff, the harder it becomes to debug. Ref: Convert pTemplates into Smarty Templates RE: Thoughts about moving translation call to inside gui template - zpin - 11-03-2010 09:05 PM If you consider making a theme I'd definitely wait for the Smarty change. It should make your life much easier. Getting translations inside the templates is also something we've been talking about when doing the Smarty conversion and it would be pretty easy to implement (there already seems to be a Smarty gettext plugin). The branch is ready for use, the only thing missing is some serious testing by people other than the ones working on it Then it could be reintegrated. There's of course other stuff we can and will do on the Smarty side, but the task of converting the templating system 1:1 has been complete for a while now. RE: Thoughts about moving translation call to inside gui template - kassah - 11-04-2010 12:49 AM (11-03-2010 09:05 PM)zpin Wrote: The branch is ready for use, the only thing missing is some serious testing by people other than the ones working on it Then it could be reintegrated. There's of course other stuff we can and will do on the Smarty side, but the task of converting the templating system 1:1 has been complete for a while now. Well... see... now... when I cloned out svn to git, I didn't grab branches, stupid me! I'll have to remedy that and give your branch some work. I'm already tracking and syncing trunk with my own internal branch for my theme. |