/**
* Retrieves information about this object in the specified locale
*
* @param string $locale The locale information to request, or null to use the default locale
* @return ArrayData Mapped list of locale properties
*/
public function LocaleInformation($locale = null)
{
// Check locale
if (empty($locale)) {
$locale = Fluent::default_locale();
}
// Check linking mode
$linkingMode = 'link';
if ($this->owner->hasMethod('canViewInLocale') && !$this->owner->canViewInLocale($locale)) {
$linkingMode = 'invalid';
} elseif ($locale === Fluent::current_locale()) {
$linkingMode = 'current';
}
// Check link
$link = $this->owner->LocaleLink($locale);
// Store basic locale information
$data = array('Locale' => $locale, 'LocaleRFC1766' => i18n::convert_rfc1766($locale), 'Alias' => Fluent::alias($locale), 'Title' => i18n::get_locale_name($locale), 'LanguageNative' => Fluent::locale_native_name($locale), 'Link' => $link, 'AbsoluteLink' => $link ? Director::absoluteURL($link) : null, 'LinkingMode' => $linkingMode);
return new ArrayData($data);
}