Locale
Extends Object. Represents regional information such as country, language, currency and time settings. The locale system is applicable to websites with international settings.
Properties |
---|
country
String
The two character ISO code for the country e.g. GB. |
countryName
String
The name of the country. |
currency
String
The three character ISO code of the currency for the locale e.g. GBP. |
id
String
The locale code is a lowercase string comprising of the language and country codes (e.g. |
isActive
Boolean
True if the locale is current. |
language
String
The two character ISO code for the language e.g. en. |
languageName
String
The name of the language. |
timezone
String
The timezone string for the current locale e.g. Europe/London. |
Methods |
---|
branch()
Branch
This method returns the closest applicable branch for the locale and is for use on international websites using locales or geotargeting. Evance allows you to set a branch against a locale if you wish contact details to differ from your main legal entity set in "My Business". This methods implements the following fallback rules:
This is useful, for example, if you wish to display a different phone number on a US locale to your default GB locale.
Note this is an alternative to |
href([Mixed:url])
Url
This method returns a locale safe Url that switches the user to a new preferred locale and redirects the user back to the Url supplied, or the current page if not supplied. This is an important method for switching between languages or locales on multi-regional websites that have strict geo-targeting enabled. In the example below we want to cycle through all of the available locales for a multi-regional website and then link to the homepage of each region:
The resulting Urls in the
Note this is the only locale safe method of switching between locales on multi-regional websites with strict geo-targeting. A cookie will be set to save the user's preferred locale on repeat visits to the website. |
manager()
Contact
This method returns the closest applicable manager Contact for the locale. Evance allows you to set a manager against a locale if you wish contact information to differ from the Account Owner. This methods implements the following fallback rules:
This is useful, for example, if you wish to display contact information should visitors wish to get in contact with the relevant manager for the locale.
Note please exercise caution when displaying manager information on your public website. |