crazyR Posted May 12, 2013 Share Posted May 12, 2013 Hi guys, Not sure if someone has already posted a solution to the following problem, but il post my solution anyway. Problem: 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. 0 Quote Link to comment Share on other sites More sharing options...
getup Posted May 12, 2013 Share Posted May 12, 2013 if anyone can improve it then feel free to update us below. Yes. Use overrides: http://docs.whmcs.com/Language_Files#Overriding_Language_Strings. It's already a feature in WHMCS. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Chris Posted May 12, 2013 Share Posted May 12, 2013 Yes. Use overrides: http://docs.whmcs.com/Language_Files#Overriding_Language_Strings. It's already a feature in WHMCS. +1 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. 0 Quote Link to comment Share on other sites More sharing options...
crazyR Posted May 12, 2013 Author Share Posted May 12, 2013 Dont know why i didnt see that info. lol. think i need more sleep. thanks for the update. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Chris Posted May 12, 2013 Share Posted May 12, 2013 Dont know why i didnt see that info. lol. think i need more sleep. thanks for the update. We all do Thanks for conjuring up thoughts and ideas though. It was such a good idea, that it was already implemented 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted May 18, 2013 Share Posted May 18, 2013 Why are you adding it to the language files? the configuration file is called up on every single page within whmcs. Add your foreach to that file just once and its added? unless whmcs will suddenly fall down because if it. 0 Quote Link to comment Share on other sites More sharing options...
getup Posted May 18, 2013 Share Posted May 18, 2013 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? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.