getPreferredLocale
Learn how to get the preferred locale for the content.
This method provides the preferred locale set for the content.
Signature
This method has the following signature:
public function getPreferredLocale(): ?stringThis method returns the preferred locale, or null to use the application’s default.
Example
Here is a basic example of how to use this method:
<?phpuse Croct\Plug\FetchOptions;
$options = FetchOptions::defaults()->withPreferredLocale('en-us');$preferredLocale = $options->getPreferredLocale();