From 0c4737aca189492d175464f7ae3e4c2c64dbc389 Mon Sep 17 00:00:00 2001 From: Roman Kinyakin <1@grep.su> Date: Tue, 19 Apr 2016 11:21:55 +0700 Subject: [PATCH] Use Google Fonts subsets for localizations --- app/Composers/AppComposer.php | 2 + config/langs.php | 170 ++++++++++++++---- .../views/dashboard/partials/head.blade.php | 2 +- resources/views/layout/master.blade.php | 2 +- resources/views/setup.blade.php | 6 +- 5 files changed, 143 insertions(+), 39 deletions(-) diff --git a/app/Composers/AppComposer.php b/app/Composers/AppComposer.php index f3794480..9ea5bbda 100644 --- a/app/Composers/AppComposer.php +++ b/app/Composers/AppComposer.php @@ -50,5 +50,7 @@ class AppComposer } else { $view->withSiteTitle(Config::get('setting.app_name')); } + + $view->withFontSubset(Config::get('langs.'.Config::get('app.locale').'.subset', 'latin')); } } diff --git a/config/langs.php b/config/langs.php index cd0241fc..f9960758 100755 --- a/config/langs.php +++ b/config/langs.php @@ -11,38 +11,140 @@ return [ // Enabled langs - 'af' => 'Afrikaans', - 'ar' => 'Arabic', - 'ca' => 'Catalan', - 'cs' => 'Czech', - 'da' => 'Danish', - 'de' => 'Deutsch', - 'el' => 'Greek', - 'en' => 'English', - 'en-UD' => 'CrowdIn - InContext Localization', - 'es' => 'Español', - 'fa' => 'Persian', - 'fi' => 'Finnish', - 'fr' => 'Français', - 'he' => 'Hebrew', - 'hu' => 'Hungarian', - 'id' => 'Indonesian', - 'it' => 'Italiano', - 'ja' => 'Japanese', - 'ko' => '한글', - 'nl' => 'Nederlands', - 'no' => 'Norwegian', - 'pl' => 'Polski', - 'pt-BR' => 'Portuguese', - 'pt-PT' => 'Portuguese, Brazilian', - 'ro' => 'Romanian', - 'ru' => 'Русский', - 'sq' => 'Albanian', - 'sr' => 'Sebrian (Cyrillic)', - 'sv-SE' => 'Swedish', - 'tr' => 'Turkish', - 'uk' => 'Ukranian', - 'vi' => 'Vietnamese', - 'zh-CN' => '简体中文', - 'zh-TW' => '繁體中文', + 'af' => [ + 'name' => 'Afrikaans', + 'subset' => 'latin', + ], + 'ar' => [ + 'name' => 'Arabic', + 'subset' => 'latin', + ], + 'ca' => [ + 'name' => 'Catalan', + 'subset' => 'latin', + ], + 'cs' => [ + 'name' => 'Czech', + 'subset' => 'latin,latin-ext', + ], + 'da' => [ + 'name' => 'Danish', + 'subset' => 'latin,latin-ext', + ], + 'de' => [ + 'name' => 'Deutsch', + 'subset' => 'latin,latin-ext', + ], + 'el' => [ + 'name' => 'Greek', + 'subset' => 'greek,greek-ext', + ], + 'en' => [ + 'name' => 'English', + 'subset' => 'latin', + ], + 'en-UD' => [ + 'name' => 'CrowdIn - InContext Localization', + 'subset' => 'latin', + ], + 'es' => [ + 'name' => 'Español', + 'subset' => 'latin,latin-ext', + ], + 'fa' => [ + 'name' => 'Persian', + 'subset' => 'latin', + ], + 'fi' => [ + 'name' => 'Finnish', + 'subset' => 'latin,latin-ext', + ], + 'fr' => [ + 'name' => 'Français', + 'subset' => 'latin,latin-ext', + ], + 'he' => [ + 'name' => 'Hebrew', + 'subset' => 'latin', + ], + 'hu' => [ + 'name' => 'Hungarian', + 'subset' => 'latin,latin-ext', + ], + 'id' => [ + 'name' => 'Indonesian', + 'subset' => 'latin', + ], + 'it' => [ + 'name' => 'Italiano', + 'subset' => 'latin,latin-ext', + ], + 'ja' => [ + 'name' => 'Japanese', + 'subset' => 'latin', + ], + 'ko' => [ + 'name' => '한글', + 'subset' => 'latin', + ], + 'nl' => [ + 'name' => 'Nederlands', + 'subset' => 'latin,latin-ext', + ], + 'no' => [ + 'name' => 'Norwegian', + 'subset' => 'latin,latin-ext', + ], + 'pl' => [ + 'name' => 'Polski', + 'subset' => 'latin,latin-ext', + ], + 'pt-BR' => [ + 'name' => 'Portuguese', + 'subset' => 'latin,latin-ext', + ], + 'pt-PT' => [ + 'name' => 'Portuguese, Brazilian', + 'subset' => 'latin,latin-ext', + ], + 'ro' => [ + 'name' => 'Romanian', + 'subset' => 'latin,latin-ext', + ], + 'ru' => [ + 'name' => 'Русский', + 'subset' => 'latin,cyrillic', + ], + 'sq' => [ + 'name' => 'Albanian', + 'subset' => 'latin,latin-ext', + ], + 'sr' => [ + 'name' => 'Sebrian (Cyrillic)', + 'subset' => 'latin,cyrillic,cyrillic-ext', + ], + 'sv-SE' => [ + 'name' => 'Swedish', + 'subset' => 'latin,latin-ext', + ], + 'tr' => [ + 'name' => 'Turkish', + 'subset' => 'latin,latin-ext', + ], + 'uk' => [ + 'name' => 'Ukranian', + 'subset' => 'latin,cyrillic-ext', + ], + 'vi' => [ + 'name' => 'Vietnamese', + 'subset' => 'latin,vietnamese', + ], + 'zh-CN' => [ + 'name' => '简体中文', + 'subset' => 'latin', + ], + 'zh-TW' => [ + 'name' => '繁體中文', + 'subset' => 'latin', + ], ]; diff --git a/resources/views/dashboard/partials/head.blade.php b/resources/views/dashboard/partials/head.blade.php index f33c7e52..87474024 100644 --- a/resources/views/dashboard/partials/head.blade.php +++ b/resources/views/dashboard/partials/head.blade.php @@ -20,7 +20,7 @@ {{ $page_title or $site_title }} - + @yield('css') diff --git a/resources/views/layout/master.blade.php b/resources/views/layout/master.blade.php index 22485d9f..1f9d055d 100644 --- a/resources/views/layout/master.blade.php +++ b/resources/views/layout/master.blade.php @@ -46,7 +46,7 @@ {{ $site_title }} - + @include('partials.stylesheet') diff --git a/resources/views/setup.blade.php b/resources/views/setup.blade.php index f31585e1..37fe7e21 100644 --- a/resources/views/setup.blade.php +++ b/resources/views/setup.blade.php @@ -102,9 +102,9 @@