Jump to content

Custom Language files

Recommended Posts

Hi guys,


Not sure if someone has already posted a solution to the following problem, but il post my solution anyway.



The problem is language files, they get overwritten on upgrades and sometimes when adding mods which can be very frustrating.


My Solution:

My solution is simple, we create a new folder in "/lang/" named "extralang",

Then we add this code into the bottom of our original whmcs lang file:

foreach (glob("extralang/*.php") as $extralang)
   include $extralang;


After that any additional language entries that we add can go into separate files within that new folder.


with future updates the only change you will need to do is add that code to the bottom.


This is simple, dirty and could probably be greatly improved, but it works so thought id share it.


if anyone can improve it then feel free to update us below.

Link to comment
Share on other sites

Yes. Use overrides: http://docs.whmcs.com/Language_Files#Overriding_Language_Strings. It's already a feature in WHMCS.




Alternatively, for anyone upgrading that previously edited the main language files, they can simply copy them to ./overrides/$lang.php and upload the default.


- We're also working on a solution for this problem.

Link to comment
Share on other sites

Not really. The configuration file is loaded before everything else. That means your custom language files will be overwritten by the defaults. Doesn't matter though as there is a solution for that already which is supported by WHMCS. Did you read the full thread?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated