I am translating an existing script into another human language. I am
putting all human language stuff in one file.
At the moment I use constants in the following way:
<?php
define("LNG_Cha nges_saved_OK", "Changes saved OK");
define("LNG_Del ete_Are_you_sur e", "Delete: Are you sure???");
?>
It is not too late yet to change to variables (array of strings) like this:
<?php
$lng["Changes_saved_ OK"]="Changes saved OK";
$lng["Delete_Are_you _sure"]="Delete: Are you sure???";
?>
What is better and why? Are there alternative ways of doing this and why
would they be better? Please consider in your answer things like server
load, memory usage and speed etc.
putting all human language stuff in one file.
At the moment I use constants in the following way:
<?php
define("LNG_Cha nges_saved_OK", "Changes saved OK");
define("LNG_Del ete_Are_you_sur e", "Delete: Are you sure???");
?>
It is not too late yet to change to variables (array of strings) like this:
<?php
$lng["Changes_saved_ OK"]="Changes saved OK";
$lng["Delete_Are_you _sure"]="Delete: Are you sure???";
?>
What is better and why? Are there alternative ways of doing this and why
would they be better? Please consider in your answer things like server
load, memory usage and speed etc.
Comment