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
5 years ago
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first step change language
parent
f24cb7f1
Hide 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
{
return
view
(
'home'
);
}
public
function
changeLocale
(
Request
$request
)
{
$language
=
$request
->
language
??
'en'
;
session
([
'selected_language'
=>
$language
]);
return
redirect
()
->
back
();
}
}
This diff is collapsed.
Click to expand it.
app/Http/Kernel.php
View file @
d56c9620
...
...
@@ -35,6 +35,7 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession
::
class
,
\App\Http\Middleware\VerifyCsrfToken
::
class
,
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
\App\Http\Middleware\Localization
::
class
,
//add your localization middleware here
],
'api'
=>
[
...
...
This diff is collapsed.
Click to expand it.
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
);
}
}
This diff is collapsed.
Click to expand it.
public/backend/img/en.png
0 → 100644
View file @
d56c9620
533 Bytes
This diff is collapsed.
Click to expand it.
public/backend/img/id.png
0 → 100644
View file @
d56c9620
404 Bytes
This diff is collapsed.
Click to expand it.
resources/views/webprofile/backend/layouts/master.blade.php
View file @
d56c9620
...
...
@@ -54,7 +54,6 @@
<!-- PAGE CONTENT -->
<div
class=
"page-content"
>
<!-- START X-NAVIGATION VERTICAL -->
<ul
class=
"x-navigation x-navigation-horizontal x-navigation-panel"
>
<!-- TOGGLE NAVIGATION -->
...
...
@@ -66,6 +65,14 @@
<li
class=
"xn-icon-button pull-right"
>
<a
href=
"#"
class=
"mb-control"
data-box=
"#mb-signout"
><span
class=
"fa fa-sign-out"
></span></a>
</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 -->
</ul>
<!-- END X-NAVIGATION VERTICAL -->
...
...
This diff is collapsed.
Click to expand it.
resources/views/webprofile/backend/pages/index.blade.php
View file @
d56c9620
...
...
@@ -11,7 +11,7 @@
@
section
(
'breadcrumbs'
)
<
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
@section('content')
...
...
@@ -34,7 +34,7 @@
<th width="
5
%
" style="
text
-
align
:
center
;
">@lang('label.number')</th>
<th style="
text
-
align
:
center
;
">@lang('label.title')</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>
</thead>
<tbody></tbody>
...
...
This diff is collapsed.
Click to expand it.
resources/views/webprofile/backend/posts/index.blade.php
View file @
d56c9620
...
...
@@ -31,12 +31,12 @@
<table class="
table
table
-
hover
data
-
table
" width="
100
%
">
<thead>
<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="
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 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>
</thead>
<tbody></tbody>
...
...
This diff is collapsed.
Click to expand it.
routes/web.php
View file @
d56c9620
...
...
@@ -17,4 +17,5 @@ Route::get('/', function () {
Auth
::
routes
();
Route
::
post
(
'/change-language'
,
'HomeController@changeLocale'
)
->
name
(
'language'
);
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
This diff is collapsed.
Click to expand it.
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