Support Center: Development Manual


Language Files

  • Multiple Languages
  • Language Files Structure
  • Unique Language ID
  • Default Language File
  • Translation Rules
  • Language File Date Format
  • Email Templates

Language Files

This manual includes some of the most important notes on the language files system we use.

1. Our system can have multiple language files to easily switch between interface languages.

2. All the language files are stored in the /languages folder and consist of two parts:

english.lng.php – for all the text labels found in the system

english.emails.php – for all the email templates

these two files must use UTF-8 codepage, this is important and can not be changed!

3. If you translate the script to your language use these english files as the default template.

Please note that each language file you use must have different ID included

<?php

// Language Code, different for each language, numeral, required

$lng[‘sys’][‘Code’] = ‘1’;

?>

We have 1 as the default ID for the English version, so increment this for your new language file please.

4. If you have several language files included into the system you can set the default one in the administrator panel configuration page.

5. All the text labels in the language file are stored as one global array $lng.

The structure is the following:


<?php

$lng[‘listing’][‘AddListing’] = ‘Add Listing’;

?>

Where $lng[‘listing’][‘AddListing’] is the variable name and ‘Add Listing’ is the label to use or translate, do not edit the variable name, only the label please, this is important.

6. You can set different date format for your language file, this is controlled via this code:


<?php

$lng[‘sys’][‘Date’] = ‘MM/DD/YYYY’;

// MM – month number (1 – 12)

// DD – day of month number (1 -31)

// YYYY – year

?>

you can set this to show day first or leave it as is to show month then date and year.

7. Email templates stored in the /languages/english.emails.php have Subject and Body parts described with some general variables included to insert data generated by the script right into the email template when we send it to the client.


<?php

// New account verification success subject

$lng[’email’][‘account’][‘verificationSuccessSubject’] = ‘Thank you, your new account on 
{website} is verified and active now.’
;

?>

Here is a subject of the new account verification success email. We use {website} variable available here to show the website name set in the Administrator Configuration Panel.


<?php

// New account verification success message

$lng[’email’][‘account’][‘verificationSuccessBody’] = ‘Hello {name},<br /><br />

Thank you, your account on {website} is verified and active now, you can login and add

listings right now using this link:<br /><br />

<br /><br />

{link}

<br /><br />

{messageFooter}<br />

?>

As you can see in the above message body we have {name} that holds the account owner name, {website} similar to the subject that stores the system website name, {link} used to print the system generated http link for the user to login to the account panel. We also have {messageFooter} here – a global footer set in Administrator Configuration Panel that will appear in most of the messages.