* * * * *

         Is separation of logic, display and language even possible?

I was just given a new project from Smirk, with one hard requirement (other
than the specification of what the program is supposed to do)—it has to be in
PHP [1] (primarily because a) it's a web-based application and b) because
it's interfacing to a bunch of other web-based applications written in PHP).

There is a chance down the road that this new project will be released as
open source (much like X-Grey [2]), and in order to gain traction as an open
source PHP web-based application, it needs to support MySQL [3], although for
our own use, we need to support PostgreSQL [4], which is nice, since then
right out of the box, it'll support two popular database engines.

The only other sticky problem is i18n (Internationalization). I mean, other
than character set issues [5], I want to make it easy to translate the
software into other languages, which means keeping most of the text separated
from the actual code. And while this is possible with PHP (with lots of self-
discipline on the part of the programmer), I would also like a way to
separate the language from the layout mechanics.

In other words, I would like to have the program logic, display logic and
language independent (as much as possible) from each other, so that it's easy
to translate to another langauge, and it's possible to change the look and
feel of the program (to match an existing website).

Tall order, and I'm not even sure of the best way to go about handing this.
I've seen how some other PHP web-based applications handle it (such as
osCommerce [6] and SugarCRM [7]) and to say it's an ugly hack is an
understatement.

[1] http://www.php.net/
[2] http://www.x-grey.com/
[3] http://www.mysql.org/
[4] http://www.postgresql.org/
[5] gopher://gopher.conman.org/0Phlog:2006/08/08.1
[6] http://www.oscommerce.com/
[7] http://www.sugarcrm.com/

Email author at [email protected]