| 1 | <?php |
||
| 10 | class BrowserNegotiator implements LanguageNegotiator |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * I18n service instance. |
||
| 14 | * |
||
| 15 | * @var I18nService |
||
| 16 | */ |
||
| 17 | protected $i18n; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * BrowserNegotiator constructor. |
||
| 21 | * |
||
| 22 | * @param I18nService $i18n |
||
| 23 | */ |
||
| 24 | public function __construct(I18nService $i18n) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Determine the user preferred locale by reading |
||
| 31 | * the browser languages. |
||
| 32 | * |
||
| 33 | * @param \Illuminate\Http\Request $request |
||
| 34 | * |
||
| 35 | * @throws \RichanFongdasen\I18n\Exceptions\InvalidFallbackLanguageException |
||
| 36 | * |
||
| 37 | * @return \RichanFongdasen\I18n\Locale |
||
| 38 | */ |
||
| 39 | public function preferredLocale(Request $request): Locale |
||
| 51 | } |
||
| 52 |