admin
Karma: 57
|
Language files - 2005/08/28 20:15
Many components (also sometimes modules or mambots) have language files. This is a good principle, as it allows for text that is displayed to be kept separate from the code, so that versions in different languages are easily substituted.
There is another useful feature of language files, and that is that users can easily alter the text themselves. However, this use can create a problem when the user is faced with the task of doing the edits all over again when a new version of the software is released with a different language file.
My recommendation is that all language files avoid the simple use of define, instead first checking whether the definition is there already. So a typical line of a language file should be:
if (!defined('NAME')) define ('NAME','VALUE');
This way, the user can use simple defines in a block prior to the standard definitions. Any item that has been defined by the user will not get its standard definition. The user defines are all together and easily moved to a future version.
Martin Brampton aka Counterpoint http://black-sheep-research.com http://mamboguru.com |