Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Customize Localization

Chris Carlevato edited this page Mar 27, 2017 · 1 revision

Address Format

Helios Calendar natively 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

The preferred format setting is configured by editing the language pack config.php file.

'AddressType' => '1',

  • 1 = US/Can/Aus, 0 = Europe

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.

Region Field (US States List)

By default Helios Calendar'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.

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

'AddressRegion'    => '1',
'RegionLabel'      => 'State:',
'RegionTitle'      => 'State',
  • AddressRegion - 1 = use the region input.
  • RegionLabel - Region name including a colon (:) for use in forms.
  • RegionTitle - Region name without punctuation.

The selectRegion.php file can be edited using the following format:

 <option <?php echo ($state=="STORED_TEXT") ? 'selected="selected"' : '';?> value="STORED_TEXT">DISPLAYED_TEXT</option>

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

 <option <?php echo ($state=="AB") ? '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, the value can be any region string and is not limited to US States.

Date Localization

Helios Calendar 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 Helios 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 edit the config.php file:

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

Sample Locale Format Options

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

This list includes only a minimum list of recommended locale options. Additional formats may be required depending on the server type, configuration and desired locale.

Date Formats

Once the proper locales have been configured date formats can be edited within the admin console Preferences.

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

Time Localization

Helios Calendar supports both 12 and 24 hour time formats. Time format can be edited within the admin console Preferences.

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

Mini-Calendar

The Month/Year values of the mini-calendar select list can be localized by editing the language pack locale (see above for details). To localize the abbreviations for weekday names edit the language pack config.php file.

'MiniCalDays' => array(0 => "S", 1 => "M", 2 => "T", 3 => "W", 4 => "T", 5 => "F", 6 => "S"),

These settings will also affect the mini-calendar component when integrated.

Note: Only the letter in quotes should be edited to the localized value, numeric indices should remain unedited.

JavaScript Date Selection Tool

To localize the popup date selection calendar (used to enter dates in event forms) edit the language pack popCal.js file. 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 internal comments for more details.

Embedded Google Maps

To localized the embedded Google Map in Helios change the Google Maps URL setting within the API Settings to use a local Google URL. Examples include:

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

Location Maps & Weather Links

Maps & Weather link services can be customized to use any service that supports URL argument links. More information is available in the Weather & Map Links section of the documentation.

TinyMCE Localization

Download Language Files

Visit TinyMCE.com to download language pack files. Note: Select .js as the download file format.

After downloading the language(s) you wish to add to your TinyMCE editor extract the zip file and upload the language (.js) files directly to your Helios Calendar's TinyMCE directory (/inc/tiny_mce) the zip archive will create the appropriate directory structure when extracted and the files can be uploaded directly.

Configure Your Language Pack

Once the new language files are uploaded you can use them by updating your language pack's config.php file. Edit the TinyMCELang setting to the language you wish to use for TinyMCE with the pack:

'TinyMCELang' => 'en',

This value should match the filename for the language files you wish to use. Ex: 'fr' for French, etc.

Spellchecker Plug-in Options

To edit the language options available in the spellchecker plugin update the TinyMCESpell setting within your language pack config.php file:

'TinyMCESpell' => 'Danish=da,Dutch=nl,+English=en,Finnish=fi,French=fr,German=de,.....',

Note: The option preceded by a + will be the default language selected when the editor is generated. To change the default value delete the + from before “English” and add it to the language option you wish to use as the new default.

Right to Left Display

Right to Left display support can be added to any theme by editing the theme header and CSS files. To complete support for Right to Left display edit the config.php file Direction setting from:

'Direction' => '1',

to

'Direction' => '0',

this will add Right to Left support to Helios' Native CAPTCHA & TinyMCE editor.

Clone this wiki locally