1. Computing

Discuss in my forum

Seperate Language Files

Why you should keep language separate from code

By , About.com Guide

If you are planning on releasing a script online, it is important to remember that it is a global market, and not everyone speaks your native language. One simple way to make it easier for people to customize your script is to include all the language in a separate file. This allows users to change the wording to better suite their site, translate the script into another language, or preform other changes to the text without messing with the code.

What does keeping the language separate mean? Basically this means that any words, instructions, and messages the user receives are written in the code as variables. All of the variable data (the actual text) is stored in a separate file. So instead of having "Enter your login information" in your code, youu just have $login, and in a separate file, $login would be set to equal "Enter your login information".

Ok, I have all the language in a separate file, how do I include it? You can do this using the include () command.

Related Video
Zip File 101
Basic PHP Syntax
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Advanced PHP
  5. Separate Language File - PHP Language File - PHP Language Separate

©2013 About.com. All rights reserved.