CubeCartForums.org Documentation Area

CubeCartForums.org for CubeCart third-party documentation, modifications, skins and services
Permanent Link   Print This Page
Introduction CubeCart v3 CubeCart v4 CubeCart v5 Appendix Search

CubeCart Version 3 Documentation - The Language System

Google Translate:

The Language System

The Concept

One of the big concepts in CubeCart is the ability to have multiple language support throughout the store. This is done by utilising a language directory structure, and language file.

This also makes it easy to edit everything from standard button text to cart titles just through editing one file, on a per language basis.

The file is located here:

/language/LANG_CODE/lang.inc.php

The LANG_CODE is the name of the directory located in the 'language' directory, as the screenshot to the right indicates.

The Language Files

Below is a list of the files that can be found in the language directory.

File Name Description
config.inc.php This stores configuration information relating to that language. It includes the ISO code and the language name. This makes it easy to create new language directories.
flag.gif The flag image associated with the language. This is used with the language drop-down menu changer in the skin.
home.inc.php This contains the homepage title and text for the selected language. In Admin, when the 'Homepage' is edited, the information is stored in this file. The file is usually write protected to start off with preventing the homepage text from being edited in Admin. In order to edit the homepage text in Admin, you'll need to change the permissions on the file, changing it from 0644 to 0777 using your FTP client software. Click here for more information on the associated error.
lang.inc.php The language file. In here, you will find any and all text relating to the core functionality found in CubeCart. It includes text for the front end and Admin areas.

Removing Languages from the List

To remove a language from the language dropdown list, simply delete the specific language code directory (not the actual 'language' directory).

Adding a New Language

It's fairly easy to add a new language to the CubeCart language system. To start with, make a copy of a current language directory which matches your language as close as possible. Rename the new language directory to a two letter abbreviation.

Then just edit 'config.inc.php', and you will see contents similar to the English file shown below:
<?php
$langName = "English";
$charsetIso = "iso-8859-1";
$strftime = "%A %e, %B %Y";
?>
Change the language name as appears in the dropdown list, and if necessary the character code set using the ISO standard code. The '$strftime' entry relates to the format of the time, more information can be gained from the PHP.net website.

Next you will need to translate the contents of the language file itself, 'lang.inc.php'.

Don't forget to alter the flag image, 'flag.gif'.

Then just upload the new directory to the 'language' directory on the server, and the language is active.



Comments, Feedback, Suggestions and Documentation Submissions please post in the Documentation Chat Forum.