Jump to content

[Tutorial] Completely disable inactive languages in back-end


daquity36

Recommended Posts

If you use only one or two languages on your website, it is very inefficient and costly to have 5 separate entries for a category, product, attribute, etc. in the database. (one for each english, french, german, etc...) It is like increasing the size of your database by several times. Even if you disable languages in the Back Office, there are still entries made for other languages in the database. (e.g. when you add a product or category)

 

If you want to completely disable languages so that only the data of the active language get stored in the database, go to classes/Language.php. Go to line 610 and find loadLanguages().

Change $result to the following:

 

$result = $db->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'lang` WHERE `active` = 1', false); //only load active languages!!

 

That's it. Now your database's size is minimized and your server-side speed maximized.

Link to comment
Share on other sites

Yes, it is definitely better to override the language class rather than modify the core. Thanks for the suggestion. But then I have edited the core too much already XD

 

As for suggesting the mod on Github, Prestashop is made to serve as much functionality as possible, so I don't think the staff will make this change.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...