From: Dan Brown Date: Sun, 18 Aug 2019 17:51:20 +0000 (+0100) Subject: Merge branch 'unicode' of git://github.com/kostasdizas/BookStack into kostasdizas... X-Git-Tag: v0.27~1^2~15^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/3acea12f1c0013be4f1e3994cae2ea662e43bb4e?hp=-c Merge branch 'unicode' of git://github.com/kostasdizas/BookStack into kostasdizas-unicode --- 3acea12f1c0013be4f1e3994cae2ea662e43bb4e diff --combined app/Http/Middleware/Localization.php index 07852bb00,753fe438e..29a436954 --- a/app/Http/Middleware/Localization.php +++ b/app/Http/Middleware/Localization.php @@@ -31,10 -31,12 +31,10 @@@ class Localizatio 'nl' => 'nl_NL', 'pl' => 'pl_PL', 'pt_BR' => 'pt_BR', - 'pt_BR' => 'pt_BR', 'ru' => 'ru', 'sk' => 'sk_SK', 'sv' => 'sv_SE', 'uk' => 'uk_UA', - 'uk' => 'uk_UA', 'zh_CN' => 'zh_CN', 'zh_TW' => 'zh_TW', ]; @@@ -57,6 -59,8 +57,8 @@@ $locale = setting()->getUser(user(), 'language', $defaultLang); } + config()->set('app.lang', $this->getLocaleIso($locale)); + // Set text direction if (in_array($locale, $this->rtlLocales)) { config()->set('app.rtl', true); @@@ -86,6 -90,16 +88,16 @@@ return $default; } + /** + * Get the ISO version of a BookStack language name + * @param string $locale + * @return string + */ + public function getLocaleIso(string $locale) + { + return $this->localeMap[$locale] ?? $locale; + } + /** * Set the system date locale for localized date formatting. * Will try both the standard locale name and the UTF8 variant. @@@ -93,7 -107,7 +105,7 @@@ */ protected function setSystemDateLocale(string $locale) { - $systemLocale = $this->localeMap[$locale] ?? $locale; + $systemLocale = $this->getLocaleIso($locale); $set = setlocale(LC_TIME, $systemLocale); if ($set === false) { setlocale(LC_TIME, $systemLocale . '.utf8'); diff --combined resources/views/base.blade.php index da0e6eb44,971a90340..456923c4e --- a/resources/views/base.blade.php +++ b/resources/views/base.blade.php @@@ -1,29 -1,26 +1,29 @@@ - + {{ isset($pageTitle) ? $pageTitle . ' | ' : '' }}{{ setting('app-name') }} - + - - - @yield('head') + + @include('partials.custom-styles') @include('partials.custom-head') @stack('head') + + + @stack('translations') + diff --combined resources/views/vendor/notifications/email.blade.php index b8a93643a,8d63fedfd..1b14adb28 --- a/resources/views/vendor/notifications/email.blade.php +++ b/resources/views/vendor/notifications/email.blade.php @@@ -1,5 -1,5 +1,5 @@@ - + @@@ -83,7 -83,7 +83,7 @@@ $style = - + {{ setting('app-name') }} @@@ -186,7 -186,7 +186,7 @@@

© {{ date('Y') }} - {{ setting('app-name') }}. + {{ setting('app-name') }}. {{ trans('common.email_rights') }}