/
localized-routes.php
107 lines (97 loc) · 2.71 KB
/
localized-routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
return [
/**
* The locales you wish to support.
*/
'supported-locales' => [
'en',
'de',
'nl',
'es',
'fr',
'id',
'it',
'lt',
'pl',
'pt_BR',
'uk',
'ru',
'si',
'vi',
'ja',
'zh_CN',
'sw',
'bn',
'fa',
'ar',
],
/**
* Native language name
*/
'locales-name-native' => [
'en' => 'English',
'de' => 'Deutsch',
'nl' => 'Nederlands',
'es' => 'Español',
'fr' => 'Français',
'id' => 'Bahasa Indonesia',
'it' => 'Italiano',
'lt' => 'Lietuvių',
'pl' => 'Polski',
'pt_BR' => 'Português (Brasil)',
'uk' => 'Українська',
'ru' => 'Русский',
'si' => 'සිංහල',
'vi' => 'Tiếng Việt',
'ja' => '日本語',
'zh_CN' => '简体中文',
'sw' => 'Swahili',
'bn' => 'বাংলা',
'fa' => 'فارسی',
'ar' => 'عربي',
],
/**
* If you have a main locale and don't want
* to prefix it in the URL, specify it here.
*
* 'omit_url_prefix_for_locale' => 'en',
*/
// 'omit_url_prefix_for_locale' => 'en',
/**
* So the home page / would be redirected to /en
* if the active locale is en and the /en route exists.
* And /about would redirect to /en/about.
*
* 'redirect_to_localized_urls' => true,
*/
'redirect_to_localized_urls' => true,
/**
* If you want to automatically set the locale
* for localized routes set this to true.
*/
'use_locale_middleware' => true,
/**
* If true, this package will use 'codezero/laravel-localizer'
* to detect and set the preferred supported locale.
*
* For non-localized routes, it will look for a locale in the URL,
* in the session, in a cookie, in the browser or in the app config.
* This can be very useful if you have a generic home page.
*
* If a locale is detected, it will be stored in the session,
* in a cookie and as the app locale.
*
* If you disable this option, only localized routes will have a locale
* and only the app locale will be set (so not in the session or cookie).
*
* You can publish its config file and tweak it for your needs.
* This package will only override its 'supported-locales' option
* with the 'supported-locales' option in this file.
*
* For more info, visit:
* https://github.com/codezero-be/laravel-localizer
*
* This option only has effect if you use the SetLocale middleware.
*/
'use_localizer' => true,
];