Recently I am working into the ability of translating a PHP web application from one language to another. Well, most of those I read involves having language files, then display the selected one like this:
en.lang.php:
<?php
$_TEXT = array();
$_TEXT['welcome'] = 'Welcome to My Application';
?>
fr.lang.php: // french (i translated that with Google =x)
<?php
$_TEXT = array();
$_TEXT['welcome'] = 'Bienvenue sur mon application Web';
?>
I would like to ask if there's any better workflow or algorithm than this? Because value may be inserted into the text and so on - pretty hairy situation. Any help thanks!
Also to note that: this application must work cross-platform (or I should say platform-independent) as such no additional extensions are required based from PHP 4.4.2