Skip to content

Commit 0c4737a

Browse files
author
Roman Kinyakin
committed
Use Google Fonts subsets for localizations
1 parent 159390f commit 0c4737a

File tree

5 files changed

+143
-39
lines changed

5 files changed

+143
-39
lines changed

app/Composers/AppComposer.php

+2
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,7 @@ public function compose(View $view)
5050
} else {
5151
$view->withSiteTitle(Config::get('setting.app_name'));
5252
}
53+
54+
$view->withFontSubset(Config::get('langs.'.Config::get('app.locale').'.subset', 'latin'));
5355
}
5456
}

config/langs.php

+136-34
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,140 @@
1111

1212
return [
1313
// Enabled langs
14-
'af' => 'Afrikaans',
15-
'ar' => 'Arabic',
16-
'ca' => 'Catalan',
17-
'cs' => 'Czech',
18-
'da' => 'Danish',
19-
'de' => 'Deutsch',
20-
'el' => 'Greek',
21-
'en' => 'English',
22-
'en-UD' => 'CrowdIn - InContext Localization',
23-
'es' => 'Español',
24-
'fa' => 'Persian',
25-
'fi' => 'Finnish',
26-
'fr' => 'Français',
27-
'he' => 'Hebrew',
28-
'hu' => 'Hungarian',
29-
'id' => 'Indonesian',
30-
'it' => 'Italiano',
31-
'ja' => 'Japanese',
32-
'ko' => '한글',
33-
'nl' => 'Nederlands',
34-
'no' => 'Norwegian',
35-
'pl' => 'Polski',
36-
'pt-BR' => 'Portuguese',
37-
'pt-PT' => 'Portuguese, Brazilian',
38-
'ro' => 'Romanian',
39-
'ru' => 'Русский',
40-
'sq' => 'Albanian',
41-
'sr' => 'Sebrian (Cyrillic)',
42-
'sv-SE' => 'Swedish',
43-
'tr' => 'Turkish',
44-
'uk' => 'Ukranian',
45-
'vi' => 'Vietnamese',
46-
'zh-CN' => '简体中文',
47-
'zh-TW' => '繁體中文',
14+
'af' => [
15+
'name' => 'Afrikaans',
16+
'subset' => 'latin',
17+
],
18+
'ar' => [
19+
'name' => 'Arabic',
20+
'subset' => 'latin',
21+
],
22+
'ca' => [
23+
'name' => 'Catalan',
24+
'subset' => 'latin',
25+
],
26+
'cs' => [
27+
'name' => 'Czech',
28+
'subset' => 'latin,latin-ext',
29+
],
30+
'da' => [
31+
'name' => 'Danish',
32+
'subset' => 'latin,latin-ext',
33+
],
34+
'de' => [
35+
'name' => 'Deutsch',
36+
'subset' => 'latin,latin-ext',
37+
],
38+
'el' => [
39+
'name' => 'Greek',
40+
'subset' => 'greek,greek-ext',
41+
],
42+
'en' => [
43+
'name' => 'English',
44+
'subset' => 'latin',
45+
],
46+
'en-UD' => [
47+
'name' => 'CrowdIn - InContext Localization',
48+
'subset' => 'latin',
49+
],
50+
'es' => [
51+
'name' => 'Español',
52+
'subset' => 'latin,latin-ext',
53+
],
54+
'fa' => [
55+
'name' => 'Persian',
56+
'subset' => 'latin',
57+
],
58+
'fi' => [
59+
'name' => 'Finnish',
60+
'subset' => 'latin,latin-ext',
61+
],
62+
'fr' => [
63+
'name' => 'Français',
64+
'subset' => 'latin,latin-ext',
65+
],
66+
'he' => [
67+
'name' => 'Hebrew',
68+
'subset' => 'latin',
69+
],
70+
'hu' => [
71+
'name' => 'Hungarian',
72+
'subset' => 'latin,latin-ext',
73+
],
74+
'id' => [
75+
'name' => 'Indonesian',
76+
'subset' => 'latin',
77+
],
78+
'it' => [
79+
'name' => 'Italiano',
80+
'subset' => 'latin,latin-ext',
81+
],
82+
'ja' => [
83+
'name' => 'Japanese',
84+
'subset' => 'latin',
85+
],
86+
'ko' => [
87+
'name' => '한글',
88+
'subset' => 'latin',
89+
],
90+
'nl' => [
91+
'name' => 'Nederlands',
92+
'subset' => 'latin,latin-ext',
93+
],
94+
'no' => [
95+
'name' => 'Norwegian',
96+
'subset' => 'latin,latin-ext',
97+
],
98+
'pl' => [
99+
'name' => 'Polski',
100+
'subset' => 'latin,latin-ext',
101+
],
102+
'pt-BR' => [
103+
'name' => 'Portuguese',
104+
'subset' => 'latin,latin-ext',
105+
],
106+
'pt-PT' => [
107+
'name' => 'Portuguese, Brazilian',
108+
'subset' => 'latin,latin-ext',
109+
],
110+
'ro' => [
111+
'name' => 'Romanian',
112+
'subset' => 'latin,latin-ext',
113+
],
114+
'ru' => [
115+
'name' => 'Русский',
116+
'subset' => 'latin,cyrillic',
117+
],
118+
'sq' => [
119+
'name' => 'Albanian',
120+
'subset' => 'latin,latin-ext',
121+
],
122+
'sr' => [
123+
'name' => 'Sebrian (Cyrillic)',
124+
'subset' => 'latin,cyrillic,cyrillic-ext',
125+
],
126+
'sv-SE' => [
127+
'name' => 'Swedish',
128+
'subset' => 'latin,latin-ext',
129+
],
130+
'tr' => [
131+
'name' => 'Turkish',
132+
'subset' => 'latin,latin-ext',
133+
],
134+
'uk' => [
135+
'name' => 'Ukranian',
136+
'subset' => 'latin,cyrillic-ext',
137+
],
138+
'vi' => [
139+
'name' => 'Vietnamese',
140+
'subset' => 'latin,vietnamese',
141+
],
142+
'zh-CN' => [
143+
'name' => '简体中文',
144+
'subset' => 'latin',
145+
],
146+
'zh-TW' => [
147+
'name' => '繁體中文',
148+
'subset' => 'latin',
149+
],
48150
];

resources/views/dashboard/partials/head.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<title>{{ $page_title or $site_title }}</title>
2222

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

resources/views/layout/master.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
<title>{{ $site_title }}</title>
4848

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

5252
@include('partials.stylesheet')

resources/views/setup.blade.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@
102102
<label>{{ trans('forms.setup.site_locale') }}</label>
103103
<select name="settings[app_locale]" class="form-control" required>
104104
<option value="">Select Language</option>
105-
@foreach($langs as $lang => $name)
106-
<option value="{{ $lang }}" @if(Binput::old('settings.app_locale') == $lang || $user_language == $lang) selected @endif>
107-
{{ $name }}
105+
@foreach($langs as $key => $lang)
106+
<option value="{{ $key }}" @if(Binput::old('settings.app_locale') == $key || $user_language == $key) selected @endif>
107+
{{ $lang['name'] }}
108108
</option>
109109
@endforeach
110110
</select>

0 commit comments

Comments
 (0)