Language Files

From WHMCS Documentation

Revision as of 17:22, 26 October 2011 by John (talk | contribs) (Language Overrides)

The language files in WHMCS contain all the text strings shown to clients. This allows you to customise any of the text your clients see.

Adding Support for a New Language

If WHMCS doesn't currently have a language file for your language then you can create your own. This is a fairly simple thing to do but will take some time to translate all the text strings.

  1. Begin by duplicating an existing language file in the lang directory.
  2. Save this with the name you want shown in the language selection dropdown menu of WHMCS - it should not contain any special characters.
  3. Once the file is duplicated, you can begin translating all the text strings in it for your language.
  4. Once complete, just save and upload the file to your live WHMCS lang directory. You will then find the language available as an option in the language dropdown in the admin and client areas.

Be careful not to delete any of the quotation marks (") around the text strings or the semi-colons on the ends of each line (;). Doing so will result in errors occuring when you select your language from within WHMCS.

Overriding Existing Language Strings

The language files in the /lang directory are the defaults but as of version 5 you can change any of the text displayed in the WHMCS Client Area by creating an override file containing the new strings, these will then be used to override the defaults. All text strings in the client area can be found in the language file and modified in any way you want.

  1. Begin by opening a text editor (such as Notepad) and copying in the language strings to be changed from the default language file
  2. Edit the string in the new file as necessary
  3. Save it with the same name as the default language file (eg. english.php, french.php etc.)
  4. Then upload it to the /lang/overrides/ directory

For example if you wanted to change the "You are here" text to say "Current Page" then you would copy the following string from /lang/english.php and paste it into the new file:

 $_LANG["globalyouarehere"] = "You are here";

Then edit so it reads:

 $_LANG["globalyouarehere"] = "Current Page";

The advantage of using the overrides method instead of editing the default language files directly is that any changes made here won't be lost with each upgrade.