mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-23 08:24:10 -05:00
Use the APP_LOCALE variable in place of DEFAULT_LANGUAGE
This commit is contained in:
parent
2d8fc06dae
commit
d9ccb3eaa8
4 changed files with 4 additions and 6 deletions
|
@ -1,5 +1,3 @@
|
||||||
DEFAULT_LANGUAGE=en
|
|
||||||
|
|
||||||
APP_NAME='Hypothetical'
|
APP_NAME='Hypothetical'
|
||||||
APP_ENV=local
|
APP_ENV=local
|
||||||
APP_KEY=
|
APP_KEY=
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Language
|
||||||
*/
|
*/
|
||||||
public static function getSessionLanguage()
|
public static function getSessionLanguage()
|
||||||
{
|
{
|
||||||
return session(self::$language_cookie, env('DEFAULT_LANGUAGE', 'en'));
|
return session(self::$language_cookie, env('APP_LOCALE', 'en'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,7 +43,7 @@ class Language
|
||||||
public static function select($string_array)
|
public static function select($string_array)
|
||||||
{
|
{
|
||||||
$session_language = self::getSessionLanguage();
|
$session_language = self::getSessionLanguage();
|
||||||
$default_language = env('DEFAULT_LANGUAGE');
|
$default_language = env('APP_LOCALE');
|
||||||
$string = '';
|
$string = '';
|
||||||
|
|
||||||
if (array_key_exists($session_language, $string_array)) {
|
if (array_key_exists($session_language, $string_array)) {
|
||||||
|
|
|
@ -121,7 +121,7 @@ Other information about database interaction, routing, controllers, etc can be v
|
||||||
|
|
||||||
### Language
|
### Language
|
||||||
|
|
||||||
The default language is set by the `DEFAULT_LANGUAGE` variable in the `.env` file; this will be the language used until the cookie has been updated.
|
The default language is set by the `APP_LOCALE` variable in the `.env` file; this will be the language used until the cookie has been updated.
|
||||||
|
|
||||||
The language cookie can be updated a number of ways:
|
The language cookie can be updated a number of ways:
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
var env = {
|
var env = {
|
||||||
appName: "{!! env('APP_NAME') !!}",
|
appName: "{!! env('APP_NAME') !!}",
|
||||||
appLang: "{{ Language::getSessionLanguage() }}",
|
appLang: "{{ Language::getSessionLanguage() }}",
|
||||||
appDefaultLang: "{{ env('DEFAULT_LANGUAGE') }}",
|
appDefaultLang: "{{ env('APP_LOCALE') }}",
|
||||||
apiToken: "{{ Auth::check() ? '?api_token=' . Auth::user()->api_token : '' }}",
|
apiToken: "{{ Auth::check() ? '?api_token=' . Auth::user()->api_token : '' }}",
|
||||||
currentUrl: "{{ Request::url() }}",
|
currentUrl: "{{ Request::url() }}",
|
||||||
csrfToken: "{{ csrf_token() }}",
|
csrfToken: "{{ csrf_token() }}",
|
||||||
|
|
Loading…
Reference in a new issue