Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
9a05f103
Commit
9a05f103
authored
Jun 14, 2016
by
karl
Browse files
Übersetzte Seiten sollten alle Erreichbar und die Sprache wählbar sein
parent
b8169aed
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Kernel.php
View file @
9a05f103
...
...
@@ -50,5 +50,9 @@ class Kernel extends HttpKernel
'can'
=>
\
Illuminate\Foundation\Http\Middleware\Authorize
::
class
,
'guest'
=>
\
App\Http\Middleware\RedirectIfAuthenticated
::
class
,
'throttle'
=>
\
Illuminate\Routing\Middleware\ThrottleRequests
::
class
,
'localize'
=>
\
Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRoutes
::
class
,
'localizationRedirect'
=>
\
Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRedirectFilter
::
class
,
'localeSessionRedirect'
=>
\
Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect
::
class
];
}
app/Http/routes.php
View file @
9a05f103
...
...
@@ -11,15 +11,14 @@
|
*/
Route
::
group
([
'prefix'
=>
LaravelLocalization
::
setLocale
()],
function
()
{
/** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/
/* Route::get('/', function()
Route
::
group
(
[
'prefix'
=>
LaravelLocalization
::
setLocale
(),
'middleware'
=>
[
'localeSessionRedirect'
,
'localizationRedirect'
]
],
function
()
{
return view('index', [
'title' => trans('titles.index'),
'homeIcon']);
}); */
/** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/
Route
::
get
(
'/'
,
'StartpageController@loadStartPage'
);
...
...
config/laravellocalization.php
View file @
9a05f103
...
...
@@ -307,6 +307,6 @@ return [
// IMPORTANT - When hideDefaultLocaleInURL is set to true, the unlocalized root is treated as the applications default locale "app.locale".
// Because of this language negotiation using the Accept-Language header will NEVER occur when hideDefaultLocaleInURL is true.
//
'hideDefaultLocaleInURL'
=>
fals
e
,
'hideDefaultLocaleInURL'
=>
tru
e
,
];
resources/lang/de/staticPages.php
View file @
9a05f103
...
...
@@ -19,7 +19,10 @@ return [
'nav16'
=>
'Fördern'
,
'nav17'
=>
'Einkaufen bei MetaGer-Fördershops'
,
'nav18'
=>
'Kontakt'
,
'nav19'
=>
'Sprache'
,
'navigationToggle'
=>
'Navigation anzeigen'
,
'sumaev.1'
=>
'MetaGer wird entwickelt und betrieben vom '
,
'sumaev.2'
=>
'SUMA-EV - Verein für freien Wissenszugang.'
];
\ No newline at end of file
resources/lang/en/staticPages.php
View file @
9a05f103
...
...
@@ -19,7 +19,10 @@ return [
'nav16'
=>
'Support'
,
'nav17'
=>
'Purchase at MetaGer Supporting Shops'
,
'nav18'
=>
'Contact'
,
'nav19'
=>
'Language'
,
'navigationToggle'
=>
'show navigation'
,
'sumaev.1'
=>
'MetaGer is developed and run by '
,
'sumaev.2'
=>
'SUMA-EV - Association for Free Access to Knowledge.'
];
\ No newline at end of file
resources/views/layouts/staticPages.blade.php
View file @
9a05f103
...
...
@@ -42,7 +42,7 @@
<div
class=
"collapse navbar-collapse"
id=
"navbar-collapse"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<li>
<a
href=
"
/
"
id=
"navigationSuche"
>
{{ trans('staticPages.nav1') }}
<a
href=
"
{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "
/")
}}
"
id=
"navigationSuche"
>
{{ trans('staticPages.nav1') }}
</a>
</li>
<li
class=
"dropdown"
>
...
...
@@ -52,7 +52,7 @@
</a>
<ul
class=
"dropdown-menu"
>
<li>
<a
href=
"/spende/"
>
{{ trans('staticPages.nav2') }}
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(),
"
/
spende
/"
)
}}"
>
{{ trans('staticPages.nav2') }}
</a>
</li>
<li>
...
...
@@ -62,7 +62,7 @@
</ul>
</li>
<li>
<a
href=
"/datenschutz/"
id=
"navigationPrivacy"
>
{{ trans('staticPages.nav3') }}
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(),
"
/
datenschutz
/"
)
}}"
id=
"navigationPrivacy"
>
{{ trans('staticPages.nav3') }}
</a>
</li>
<li
class=
"dropdown"
>
...
...
@@ -76,19 +76,19 @@
</a>
</li>
<li>
<a
href=
"/kontakt/"
>
{{ trans('staticPages.nav5') }}
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(),
"
/
kontakt
/"
)
}}"
>
{{ trans('staticPages.nav5') }}
</a>
</li>
<li>
<a
href=
"/team/"
>
{{ trans('staticPages.nav6') }}
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(),
"
/
team
/"
)
}}"
>
{{ trans('staticPages.nav6') }}
</a>
</li>
<li>
<a
href=
"/about/"
>
{{ trans('staticPages.nav7') }}
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(),
"
/
about
/"
)
}}"
>
{{ trans('staticPages.nav7') }}
</a>
</li>
<li>
<a
href=
"/impressum/"
>
{{ trans('staticPages.nav8') }}
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(),
"
/
impressum
/"
)
}}"
>
{{ trans('staticPages.nav8') }}
</a>
</li>
</ul>
...
...
@@ -100,11 +100,11 @@
</a>
<ul
class=
"dropdown-menu"
>
<li>
<a
href=
"/hilfe/"
>
{{ trans('staticPages.nav9') }}
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(),
"
/
hilfe
/"
)
}}"
>
{{ trans('staticPages.nav9') }}
</a>
</li>
<li>
<a
href=
"/widget/"
>
{{ trans('staticPages.nav10') }}
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(),
"
/
widget
/"
)
}}"
>
{{ trans('staticPages.nav10') }}
</a>
</li>
<li>
...
...
@@ -125,6 +125,16 @@
</li>
</ul>
</li>
<li
class=
"dropdown"
>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
role=
"button"
aria-haspopup=
"true"
aria-expanded=
"false"
id=
"navigationSprache"
>
{{ trans('staticPages.nav19') }}
<span
class=
"caret"
></span>
</a>
<ul
class=
"dropdown-menu"
>
@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)
<li><a
rel=
"alternate"
hreflang=
"{{$localeCode}}"
href=
"{{LaravelLocalization::getLocalizedURL($localeCode) }}"
>
{{{ $properties['native'] }}}
</a></li>
@endforeach
</ul>
</li>
</ul>
</div>
</div>
...
...
resources/views/layouts/subPages.blade.php
View file @
9a05f103
@
extends
(
'layouts.staticPages'
)
@
section
(
'homeIcon'
)
<
a
class
=
"navbar-brand"
href
=
"
/
"
>
<
a
class
=
"navbar-brand"
href
=
"
{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "
/
") }}"
">
<div class="
logo
">
<h1>MetaGer
</h1>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment