Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
d56c9620
Commit
d56c9620
authored
Dec 12, 2019
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first step change language
parent
f24cb7f1
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
6 deletions
+45
-6
app/Http/Controllers/HomeController.php
+8
-0
app/Http/Kernel.php
+1
-0
app/Http/Middleware/Localization.php
+22
-0
public/backend/img/en.png
+0
-0
public/backend/img/id.png
+0
-0
resources/views/webprofile/backend/layouts/master.blade.php
+8
-1
resources/views/webprofile/backend/pages/index.blade.php
+2
-2
resources/views/webprofile/backend/posts/index.blade.php
+3
-3
routes/web.php
+1
-0
No files found.
app/Http/Controllers/HomeController.php
View file @
d56c9620
...
@@ -25,4 +25,12 @@ class HomeController extends Controller
...
@@ -25,4 +25,12 @@ class HomeController extends Controller
{
{
return
view
(
'home'
);
return
view
(
'home'
);
}
}
public
function
changeLocale
(
Request
$request
)
{
$language
=
$request
->
language
??
'en'
;
session
([
'selected_language'
=>
$language
]);
return
redirect
()
->
back
();
}
}
}
app/Http/Kernel.php
View file @
d56c9620
...
@@ -35,6 +35,7 @@ class Kernel extends HttpKernel
...
@@ -35,6 +35,7 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession
::
class
,
\Illuminate\View\Middleware\ShareErrorsFromSession
::
class
,
\App\Http\Middleware\VerifyCsrfToken
::
class
,
\App\Http\Middleware\VerifyCsrfToken
::
class
,
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
\App\Http\Middleware\Localization
::
class
,
//add your localization middleware here
],
],
'api'
=>
[
'api'
=>
[
...
...
app/Http/Middleware/Localization.php
0 → 100644
View file @
d56c9620
<?php
namespace
App\Http\Middleware
;
use
Closure
;
use
Illuminate\Support\Facades\App
;
class
Localization
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
{
App
::
setLocale
(
session
()
->
get
(
'selected_language'
)
??
'en'
);
return
$next
(
$request
);
}
}
public/backend/img/en.png
0 → 100644
View file @
d56c9620
533 Bytes
public/backend/img/id.png
0 → 100644
View file @
d56c9620
404 Bytes
resources/views/webprofile/backend/layouts/master.blade.php
View file @
d56c9620
...
@@ -54,7 +54,6 @@
...
@@ -54,7 +54,6 @@
<!-- PAGE CONTENT -->
<!-- PAGE CONTENT -->
<div
class=
"page-content"
>
<div
class=
"page-content"
>
<!-- START X-NAVIGATION VERTICAL -->
<!-- START X-NAVIGATION VERTICAL -->
<ul
class=
"x-navigation x-navigation-horizontal x-navigation-panel"
>
<ul
class=
"x-navigation x-navigation-horizontal x-navigation-panel"
>
<!-- TOGGLE NAVIGATION -->
<!-- TOGGLE NAVIGATION -->
...
@@ -66,6 +65,14 @@
...
@@ -66,6 +65,14 @@
<li
class=
"xn-icon-button pull-right"
>
<li
class=
"xn-icon-button pull-right"
>
<a
href=
"#"
class=
"mb-control"
data-box=
"#mb-signout"
><span
class=
"fa fa-sign-out"
></span></a>
<a
href=
"#"
class=
"mb-control"
data-box=
"#mb-signout"
><span
class=
"fa fa-sign-out"
></span></a>
</li>
</li>
<li
class=
"pull-right"
>
<div
style =
"padding-top: 15px;"
>
{!! Form::open(array('url' => route('language'), 'method' => 'POST', 'id' => 'pages', 'files' => true)) !!}
{!! Form::select('language', ['id'=>'Indonesia', 'en'=>'English'], Session::get('selected_language'), ['onChange'=>'this.form.submit();']) !!}
<button
type=
"submit"
style=
"display: none;"
>
simpan
</button>
{!! Form::close() !!}
</div>
</li>
<!-- END SIGN OUT -->
<!-- END SIGN OUT -->
</ul>
</ul>
<!-- END X-NAVIGATION VERTICAL -->
<!-- END X-NAVIGATION VERTICAL -->
...
...
resources/views/webprofile/backend/pages/index.blade.php
View file @
d56c9620
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
@
section
(
'breadcrumbs'
)
@
section
(
'breadcrumbs'
)
<
li
><
a
href
=
"
{
{URL::to('dashboard')}
}
"
>@
lang
(
'label.dashboard'
)
</
a
></
li
>
<
li
><
a
href
=
"
{
{URL::to('dashboard')}
}
"
>@
lang
(
'label.dashboard'
)
</
a
></
li
>
<
li
class
="
active
">@lang('feature.p
ost
')</li>
<
li
class
="
active
">@lang('feature.p
age
')</li>
@stop
@stop
@section('content')
@section('content')
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<th width="
5
%
" style="
text
-
align
:
center
;
">@lang('label.number')</th>
<th width="
5
%
" style="
text
-
align
:
center
;
">@lang('label.number')</th>
<th style="
text
-
align
:
center
;
">@lang('label.title')</th>
<th style="
text
-
align
:
center
;
">@lang('label.title')</th>
<th width="
20
%
" style="
text
-
align
:
center
;
">@lang('label.sum')</th>
<th width="
20
%
" style="
text
-
align
:
center
;
">@lang('label.sum')</th>
<th align="
center
" width="
1
0
%
" style="
text
-
align
:
center
;
">@lang('label.action')</th>
<th align="
center
" width="
1
5
%
" style="
text
-
align
:
center
;
">@lang('label.action')</th>
</tr>
</tr>
</thead>
</thead>
<tbody></tbody>
<tbody></tbody>
...
...
resources/views/webprofile/backend/posts/index.blade.php
View file @
d56c9620
...
@@ -31,12 +31,12 @@
...
@@ -31,12 +31,12 @@
<table class="
table
table
-
hover
data
-
table
" width="
100
%
">
<table class="
table
table
-
hover
data
-
table
" width="
100
%
">
<thead>
<thead>
<tr>
<tr>
<th width="
7
%
" style="
text
-
align
:
center
;
">@lang('label.number')</th>
<th width="
5
%
" style="
text
-
align
:
center
;
">@lang('label.number')</th>
<th width="
38
%
" style="
text
-
align
:
center
;
">@lang('label.title')</th>
<th width="
38
%
" style="
text
-
align
:
center
;
">@lang('label.title')</th>
<th width="
15
%
" style="
text
-
align
:
center
;
">@lang('label.category')</th>
<th width="
15
%
" style="
text
-
align
:
center
;
">@lang('label.category')</th>
<th width="
1
5
%
" style="
text
-
align
:
center
;
">@lang('label.date')</th>
<th width="
1
0
%
" style="
text
-
align
:
center
;
">@lang('label.date')</th>
<th width="
15
%
" style="
text
-
align
:
center
;
">@lang('label.sum')</th>
<th width="
15
%
" style="
text
-
align
:
center
;
">@lang('label.sum')</th>
<th align="
center
" width="
1
0
%
" style="
text
-
align
:
center
;
">@lang('label.action')</th>
<th align="
center
" width="
1
5
%
" style="
text
-
align
:
center
;
">@lang('label.action')</th>
</tr>
</tr>
</thead>
</thead>
<tbody></tbody>
<tbody></tbody>
...
...
routes/web.php
View file @
d56c9620
...
@@ -17,4 +17,5 @@ Route::get('/', function () {
...
@@ -17,4 +17,5 @@ Route::get('/', function () {
Auth
::
routes
();
Auth
::
routes
();
Route
::
post
(
'/change-language'
,
'HomeController@changeLocale'
)
->
name
(
'language'
);
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
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