1. Home
  2. Computing & Technology
  3. PHP / MySQL

Seperate Language Files
Why you should keep language separate from code

By Angela Bradley, About.com

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.

More PHP / MySQL Quick Tips
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Advanced PHP
  5. Separate Language File - PHP Language File - PHP Language Separate

©2009 About.com, a part of The New York Times Company.

All rights reserved.