Refresh Software Documentation » Selene Directory 0.9.x » Localization

Click here for the current version of this page.

Contents

Address Format

Selene Directory supports two address formats:

US/CAN/AUS
Address Line 1
Address Line 2
City, Region Postal Code
Country

Europe
Address Line 1
Address Line 2
Postal Code, City
Country

 

This setting is configured by editing your language pack config.php file.

'AddressType'     =>     '1',

Set to:

  • 1 for US/CAN/AUS format.
  • 0 for Europe format.

Note: Region is equivalent to State/Province/etc and Postal Code to Zip Code/Postcode/etc. The terms above are generic for example only. Each available Language Pack is localized appropriately.

Also Note: These address formats can be edited, or additional formats added, by editing the buildAddress() function located on, or near, line 746 in the /directory/includes/code.php file.

Region Field (US States List)

By default Selene Directory's "region" field is labeled as "State" and a select list of US States is used, however, this label and select list can be customize to any value, or hidden, for your Selene install.

This setting is configured by editing your language pack config.php and selectRegion.php files.

'AddressRegion'		=>	'1',
'RegionLabel'		=>	'State:',
'RegionTitle'		=>	'State',

Set your config.php AddressRegion setting to 1 to use the Region input or 0 to hide it. RegionLabel can be changed to your region values name including a semi-colon (:) and RegionTitle changed to just the region value name.

Edit your selectRegion.php file using the following format:

<option <?php if(isset($state) && ($state=="STORED_TEXT")){echo "selected=\"selected\"";}?>
value="STORED_TEXT">DISPLAYED_TEXT</option>

For example: to create a selectRegion.php file for Canada the inputs would match:

<option <?php if(isset($state) && ($state=="AB")){echo "selected=\"selected\"";}?>
value="AB">Alberta</option>

STORED_TEXT & DISPLAYED_TEXT can be the same or (in the case of the default US State list) the stored text can be an abbreviation of the displayed select option.

Note: While the variable $state is used within the PHP code (and this variable cannot be changed), the value of the select list and inputs can be any region and is not limited to US States.

Date Localization

Selene Directory uses the PHP functions setlocale() and strftime for the dynamic localization of dates. For these functions to work the appropriate locales must be installed on the local server and PHP must be configured to access them.

Because locale formats vary from server to server Selene uses an array of locale values to ensure that each language pack is compatible with a variety of server types.

To change the locale settings for your language pack edit the config.php file

'LocaleOptions'     =>     array('en_US', 'English', 'USA', 'United States'),

Locale Format Samples

  • Name of Country = 'United States'
  • Name of Language = 'English'
  • Abbreviation of Country = 'USA'
  • ISO language_COUNTRY Code = 'en_US'

This list includes only the recommended locale minimums (to cover a minimum of server types). Additional formats may be required depending on your server type & configuration and desired locale.

Date Formats

Once the proper locales have been configured you can edit date formats within the admin console Preferences.

For date string variables reference the PHP strftime() manual.

Time Localization

Selene Directory supports both 12 and 24 hour time formats. You can edit time formats within the admin console Preferences.

For time string variables reference the PHP strftime() manual.

JavaScript Date Selection Tool

To localize the popup date selection calendar (used to enter expiration dates in admin listing forms) you will need to edit the popCal.js file within your language pack. This file includes names and abbreviations for months as well as an option to change which day of the week the calendar starts on. Reference the file's comments for more details.

Embedded Google Maps

You can localized the embedded Google Map in Selene by changing the Google Maps URL setting within your API Settings to use your local Google URL. Examples include:

Note: This setting must include the full Google Maps URL as well as a "trailing" slash (see examples above).