class LanguageDetector

Language detector is used to determine the current and universal languages for this system. It uses LocaleDetector to get the universal code, i.e 'en', 'es', and then fetches the DvsLanguage from the database

Methods

__construct(LocaleDetector $LocaleDetector, DvsLanguage $Language, $Config = null)

Create a new Language Detector

Language
current()

Get the current language for the locale this will probably use the cookie as default

Language
universal()

Get the universal language that we fallback to.

void
update(Language $language)

Update the current language for this browser

integer
primaryLanguageId()

Returns the primary language id for this system

Details

at line 25
__construct(LocaleDetector $LocaleDetector, DvsLanguage $Language, $Config = null)

Create a new Language Detector

Parameters

LocaleDetector $LocaleDetector
DvsLanguage $Language
$Config

at line 38
Language current()

Get the current language for the locale this will probably use the cookie as default

Return Value

Language

at line 63
Language universal()

Get the universal language that we fallback to.

.. which is likely english because that is the default in laravel's Config::get(app.locale)

Return Value

Language

at line 77
void update(Language $language)

Update the current language for this browser

Parameters

Language $language

Return Value

void

at line 87
integer primaryLanguageId()

Returns the primary language id for this system

Return Value

integer