Adding custom labels/translations

NOTE 1: The following instructions require some basic knowledge of Linux file management and PHP programming.

NOTE 2: Currently Elegant 6 interface supports only the English language, but using the described techniques you can translate it to different language or replace some labels/text with custom values for the whole application or only for specific site(s)

  • Let’s say we want to use word “cart” instead of “basket”.
  • Assume your Elegant 6 is installed at “/var/www/html/elegant6” (a usual default path) and you want to change all instances of “basket” to display as “cart”. Navigate to folder “/var/www/html/elegant6/protected/messages/en”
  • Here you can see two files "frontend.php" and "backend.php". These are simple .php files that contain textual information for Elegant 6 user (frontend) and admin (backend) interfaces in form of key=>value pairs.

Virtual host configuring, img #01.1

  • In the folder “/var/www/html/elegant6/protected/messages/en” create a file called custom.php and paste the structure as shown above (you may delete sample key=>value pairs).
  • Now find all lines that contain values with “basket” or “Basket” in frontend.php and copy them into custom.php.
  • Rename all occurrences of “basket” to “cart” in “custom.php” and save the file.
  • Login to your Elegant 6 to check the results.

It is possible to assign a custom language file to a specific site.

  • Let’s say you have a site, called “example_site”.
  • Create a folder “/var/www/html/elegant6/protected/messages/en/example_site” and copy/put “custom.php” file there.
  • Now login to several different sites and note that custom translations are only available for “example_site”

If you want to make customizations for the admin interface, you can create the folder “/var/www/html/elegant6/protected/messages/en/administration” and follow the instructions above.

NOTE 3: it is possible to customize translation strings using "custom.php" file only for frontend interface.