StoreCore uses the HTTP Accept-Language header to determine which content language is preferred by visitors, customers, users, and client applications. The current language can be found by supplying an array of supported languages to the Language::negotiate() method.


Class Synopsis:

Language {
    public string negotiate ( array $supported [, string $default = 'en-GB'] )
}


The $supported parameter must be an associative array of ISO language codes that evaluate to true. For example, if an application supports both English and French, the supported languages may be defined as:

$supported = array(
    'en-GB' => true,
    'fr-FR' => true,
);


This data structure allows you to temporarily disable a supported language, without fully dropping it:

$supported = array(
    'en-GB' => true,
    'fr-FR' => false,
);