System\Classes\SiteManager\HasPreferredLanguage

Overview

HasPreferredLanguage implements browser detection logic


Public Methods

public getSiteForLocale()

public getSiteForLocale($locale): void

public getSiteFromBrowser()

public getSiteFromBrowser($acceptLanguage): void

getSiteFromBrowser locates the site based on the browser locale, e.g. HTTP_ACCEPT_LANGUAGE

Protected Methods

protected findAcceptedLocales()

protected findAcceptedLocales($acceptedStr): array 

findAcceptedLocales based on an accepted string, e.g. en-GB,en-US;q=0.9,en;q=0.8 Returns a sorted array in format of [(string) locale => (float) priority]