Move lang into en/cachet.php where possible. Lang everything.

This commit is contained in:
James Brooks 2014-12-01 16:37:37 +00:00
parent 84c2bc9b61
commit 70a876744b
9 changed files with 42 additions and 33 deletions

31
app/lang/en/cachet.php Normal file
View File

@ -0,0 +1,31 @@
<?php
return array(
// Components
'component' => array(
'status' => array(
1 => 'Operational',
2 => 'Performance Issues',
3 => 'Partial Outage',
4 => 'Major Outage'
)
),
// Incidents
'incident' => array(
'status' => array(
1 => 'Investigating',
2 => 'Identified',
3 => 'Watching',
4 => 'Fixed'
)
),
// Service Status
'service' => array(
'good' => 'All systems are functional.',
'bad' => 'Some systems are experiencing issues.',
),
// Other
'powered_by' => ':app Status Page is powered by <a href="https://cachethq.github.io">Cachet</a>.',
'logout' => 'Logout',
'dashboard_link' => 'You\'re logged in.',
);

View File

@ -1,10 +0,0 @@
<?php
return array(
'status' => array(
1 => 'Operational',
2 => 'Performance Issues',
3 => 'Partial Outage',
4 => 'Major Outage'
)
);

View File

@ -1,10 +0,0 @@
<?php
return array(
'status' => array(
1 => 'Investigating',
2 => 'Identified',
3 => 'Watching',
4 => 'Fixed'
)
);

View File

@ -1,6 +0,0 @@
<?php
return array(
'good' => 'All systems are functional.',
'bad' => 'Some systems are experiencing issues.',
);

View File

@ -26,7 +26,7 @@ class Component extends Eloquent implements \Dingo\Api\Transformer\Transformable
* @return string
*/
public function getHumanStatusAttribute() {
return Lang::get('component.status.' . $this->status);
return Lang::get('cachet.component.status.' . $this->status);
}
/**

View File

@ -32,7 +32,7 @@ class Incident extends Eloquent implements \Dingo\Api\Transformer\TransformableI
* @return string
*/
public function getHumanStatusAttribute() {
$statuses = Lang::get('incident.status');
$statuses = Lang::get('cachet.incident.status');
return $statuses[$this->status];
}

View File

@ -11,10 +11,10 @@ View::composer('index', function($view) {
if ($incidentCount <= 1 || ($incidentCount > 1 && (int) $incidents->first()->status === 4)) {
$status = 'success';
$message = Lang::get('overview.good');
$message = Lang::get('cachet.service.good');
} else {
$status = 'danger';
$message = Lang::get('overview.bad');
$message = Lang::get('cachet.service.bad');
}
$view->with([

View File

@ -1,6 +1,6 @@
@if(Setting::get('show_support'))
<hr />
<div class='footer'>
<p>{{ Setting::get('app_name') }} Status Page is powered by <a href='https://github.com/jbrooksuk/Cachet' target="_blank">Cachet</a>.</p>
<p>{{ Lang::get('cachet.powered_by', array('app' => Setting::get('app_name'))) }}</p>
</div>
@endif

View File

@ -4,8 +4,12 @@
<div class='alert alert-{{ $systemStatus }}'>{{ $systemMessage }}</div>
@if(Auth::check())
<a class="pull-right" href="/auth/logout">Logout</a>
<p>You're logged in. This will be a link to the Dashboard.</p>
<div class='row'>
<div class='col-md-12'>
<a class="btn btn-primary pull-right" href="/auth/logout">{{ Lang::get('cachet.logout') }}</a>
<p>{{ Lang::get('cachet.dashboard_link') }}</p>
</div>
</div>
@endif
@include('imports.components')