Use Google Fonts subsets for localizations

This commit is contained in:
Roman Kinyakin 2016-04-19 11:21:55 +07:00
parent 159390f989
commit 0c4737aca1
5 changed files with 143 additions and 39 deletions

View File

@ -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'));
}
}

View File

@ -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',
],
];

View File

@ -20,7 +20,7 @@
<title>{{ $page_title or $site_title }}</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="{{ elixir('dist/css/all.css') }}">
@yield('css')

View File

@ -46,7 +46,7 @@
<title>{{ $site_title }}</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="{{ elixir('dist/css/all.css') }}">
@include('partials.stylesheet')

View File

@ -102,9 +102,9 @@
<label>{{ trans('forms.setup.site_locale') }}</label>
<select name="settings[app_locale]" class="form-control" required>
<option value="">Select Language</option>
@foreach($langs as $lang => $name)
<option value="{{ $lang }}" @if(Binput::old('settings.app_locale') == $lang || $user_language == $lang) selected @endif>
{{ $name }}
@foreach($langs as $key => $lang)
<option value="{{ $key }}" @if(Binput::old('settings.app_locale') == $key || $user_language == $key) selected @endif>
{{ $lang['name'] }}
</option>
@endforeach
</select>