WHMCS supports numerous languages, in both in the client and admin areas. To enable this, all text used throughout the system is stored within language files.
Language files are stored in the /lang/ sub-folders of both the client and admin directories.
WHMCS includes 20 client area translations by default. These are:
Arabic, Catalan, Croatian, Czech, Danish, Dutch, English, Farsi, French, German, Hungarian, Italian, Norwegian, Brazilian & Native Portuguese, Russian, Spanish, Swedish, Turkish & Ukranian
And for the admin area there are 6 translations included:
Czech, English, French, Portuguese, Russian & Spanish
We rely on the dedication and generosity of our users for contributing translations, as we find real life translations are a much higher quality compared with using automated translation systems as some softwares do. So if you have any suggestions for improvements, or a new language file you are willing to contribute, please get in touch.
Adding a New Language
If a language you operate in is not available as standard, then you can create your own translation. Here's how:
- Begin by opening an existing language file
- Save this file with a new name - the name you want to be shown in the language selection dropdown menu in WHMCS - the name should only consist of a-z0-9 characters and end with the extension ".php"
- Once the file has been created, you can then begin going through and translating the lines within it
- An example line is as follows - you should only change the part in bold:
$_LANG['accountinfo'] = "Account Information";
Be careful not to delete any of the quotation marks (") around the text strings or the semi-colons on the ends of each line (;). Also should you want to use a quote character (") within your translated text, you must escape it - for example: \" The language files are written in PHP syntax so valid PHP code must be maintained.
By default the language files in WHMCS use the UTF-8 encoding without a Byter Order Marker character at the start. When modifying these files it is important to maintain the same encoding.
If you have chosen to change the system charset setting to something other than UTF-8 (eg. iso-8859-1) then the language files will need to be re-saved with ANSI encoding without a Byte Order Marketer. Most text editors have this option (including Notepad).
Overriding Language Strings
The language files are provided unencoded to allow you to view the language strings that WHMCS uses.
However we do not recommend editing these files directly. They are often overwritten during software upgrades to introduce new and updated text.
Instead we recommend that you use overrides which allow you to customise the default variables with your own in a way which can be safely preserved through the upgrade process.
Steps for customising language strings via overrides are as follows:
1. Create the folder 'overrides' within the 'lang' folder.
2. Create or copy the language file you want to override. For example, to create an override for the English language you create ./lang/overrides/english.php
3. Open the newly created file in your preferred editor.
4. Start the file with a PHP tag '<?php' indicating PHP code is to be used.
5. Enter the variable(s) you wish to override. For example, if you wanted to change "Welcome to our members area" you would locate the proper variable within ./lang/english.php and place it into the overrides english file with your preferred change:
$_LANG['headertext'] = "Welcome to our members area.";
$_LANG['headertext'] = "Welcome home!";
6. For each variable you wish you change, repeat step #5. For example, a completed overrides file should look something like this:
<?php $_LANG['headertext'] = "Welcome home!"; $_LANG['addtocart'] = "Add to Basket"; $_LANG['cartproductaddons'] = "Product Extras";
7. Save, and you're done!
By default the language files in WHMCS use the UTF-8 encoding without a Byte Order Marker character at the start. When creating language override files it is important to maintain the same encoding.
If you have chosen to change the system charset setting to something other than UTF-8 (eg. iso-8859-1) then the language override files will need to be re-saved with ANSI encoding without a Byte Order Marketer. Most text editors have this option (including Notepad).