Add homepage localization options

This commit is contained in:
Miguel Nogueira 2020-09-01 00:29:58 +01:00
parent 1e78a8e6d9
commit f871e14307
6 changed files with 102 additions and 69 deletions

25
resources/js/app.js vendored
View File

@ -43,28 +43,3 @@ $("#comment").keyup(function(){
$("#submitComment").on('click', function(){
$("#newComment").submit();
});
window.Vue = require('vue');
/**
* The following block of code may be used to automatically register your
* Vue components. It will recursively scan this directory for the Vue
* components and automatically register them with their "basename".
*
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
*/
// const files = require.context('./', true, /\.vue$/i)
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
const app = new Vue({
el: '#app',
});

View File

@ -0,0 +1,64 @@
<?php
/*
* -- Information for translators | READ BEFORE TRANSLATING ANYTHING ---
* In this file, only translate messages to the right, in this fashion:
* 'something' => 'translate-me'
* Also, don't translate, change, or move placeholders (:this-is-a-placeholder) starting with a colon.
* Try to keep the message as close to the original in meaning as possible. These simple rules also apply to other files you're translating, such as:
* auth.php, pagination.php, passwords.php, and validation.php.
* It is VERY important that you "escape" single quotes with a backslash if they're present in your language, like this: I\'m an escaped quote
*
* Additionally, don't change anything in square or curly brackets, and don't remove pipe (|) characters.
* If you see two messages separated by pipe, then usually the left side is singular and the right side is plural, so translate accordingly.
*
* Thank you for translating!
*/
return [
// ============== HOMEPAGE MESSAGES ======================
'home' => 'Home',
'homepagetxt' => 'Homepage',
'login' => 'Sign in',
'logout' => 'Sign out',
'register' => 'Sign up',
'dashboard' => 'Dashboard',
'homepage_welcome' => 'Welcome to our team management center!',
'homepage_explainer_line1' => 'Here, you can apply for open staff member positions, view your application status, and manage your profile.',
'homepage_explainer_line2' => 'Sign up with Email to continue.',
'footer_copy' => 'All rights reserved',
'global_error' => 'An error occurred',
'global_success' => 'Success!',
'txt_learn_more' => 'Learn more',
'opening_nodetails' => 'There don\'t seem to be any details',
'opening_nodetails_exp' => 'This opening does not have any details yet.',
'details_m_title' => 'Opening details',
'open_positions' => 'Open Positions',
'last_updated' => 'Last updated',
'open_position_count' => '{1} There is :count open position!|[2,*] There are :count open positions!',
'ineligible_days_remaining' => 'Ineligible (:days) day(s) remaining',
'txt_apply' => 'Apply', // Context: Apply as in applying for a "job", e.g. registering for a job
'application_closed' => 'Applications Closed',
'application_closed_intro' => 'Hello there!',
'application_closed_intro_line2' => <<<EOT
We are currently not hiring any new staff members at the moment. If you'd like to apply, check out our Discord's
announcement channel for news when a new position opens.
Our application cycle usually lasts two weeks, so if you're seeing this, it's because it finished, and new one will begin soon.
EOT,
'where_work' => 'Where you\'ll work',
'join_team' => 'Join The Team',
'join_team_cta' => 'Join the team today and help out network grow and prosper!',
'contact_cta' => 'Any questions? Leave a message!',
'contact_disclaimer' => '*This is not an application form. Any applications sent here will be ignored.',
'contactlabel_name' => 'Name',
'contactlabel_email' => 'E-mail',
'contactlabel_subject' => 'Subject (ex. Site Suggestion)',
'contactlabel_send' => 'Send',
// ======================== AUTHENTICATION MESSAGES ===========================
];

View File

@ -5,13 +5,13 @@
@if (session()->has('error'))
<script>
toastr.error('{{session()->get('error')}}', 'An error ocurred')
toastr.error('{{session()->get('error')}}', '{{__('messages.global_error')}}')
</script>
@elseif (session()->has('success'))
<script>
toastr.success('{{session()->get('success')}}', 'Success!')
toastr.success('{{session()->get('success')}}', '{{__('messages.global_success')}}')
</script>
@endif

View File

@ -1,9 +1,9 @@
<!-- Footer -->
<footer class="page-footer font-small footer-grad">
<!-- Copyright -->
<!-- Copyright - DO NOT REMOVE WITHOUT PERMISSION -->
<div class="footer-copyright text-center py-3">
<a href="https://spacejewel-hosting.com/"> Spacejewel Hosting &copy; 2019-2020 - All rights reserved</a>
<a href="https://spacejewel-hosting.com/"> Spacejewel Hosting &copy; 2019-2020 - {{__('messages.footer_copy')}}</a>
</div>
<!-- Copyright -->
<!-- Built by Miguel Nogueira -->

View File

@ -10,7 +10,7 @@
<meta name="tags" content="minecraft, minecraft server staff, minecraft staff, minecraft servers">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{config('app.name')}} | Home</title>
<title>{{config('app.name')}} | {{__('messages.home')}}</title>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
<!-- Google Fonts -->
@ -52,7 +52,7 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link " href="{{config('app.sitehomepage')}}">Homepage</a>
<a class="nav-link " href="{{config('app.sitehomepage')}}">{{__('messages.homepagetxt')}}</a>
</li>
</ul>
</div>
@ -60,23 +60,23 @@
<ul class="navbar-nav ml-auto float-right">
@guest
<li class="nav-item">
<button class="btn btn-info" type="button" onclick="window.location.href='{{route('login')}}'"><i class="fas fa-sign-in-alt"></i> Sign-in</button>
<button class="btn btn-info" type="button" onclick="window.location.href='{{route('login')}}'"><i class="fas fa-sign-in-alt"></i> {{__('messages.login')}}</button>
</li>
<li class="nav-item">
<button class="btn btn-info" type="button" onclick="window.location.href='{{route('register')}}'"><i class="fas fa-plus"></i> Sign-up</button>
<button class="btn btn-info" type="button" onclick="window.location.href='{{route('register')}}'"><i class="fas fa-plus"></i> {{__('messages.register')}}</button>
</li>
@endguest
@auth
<li class="nav-item">
<button type="button" class="btn btn-info" onclick="window.location.href='{{route('dashboard')}}'">Dashboard</button>
<button type="button" class="btn btn-info" onclick="window.location.href='{{route('dashboard')}}'">{{__('messages.dashboard')}}</button>
</li>
<li class="nav-item">
<form method="POST" action="{{route('logout')}}">
@csrf
<button type="submit" class="btn btn-danger"><i class="fa fa-power-off"></i> Sign-out</button>
<button type="submit" class="btn btn-danger"><i class="fa fa-power-off"></i>{{__('messages.logout')}}</button>
</form>
</li>
@endauth
@ -91,10 +91,10 @@
<div class="container text-center white-text">
<div class="white-text text-center wow fadeInUp">
<h2>{{config('app.name')}}</h2>
<h5>Welcome to our team management center!</h5>
<h5> {{__('messages.homepage_welcome')}}</h5>
<br>
<p>Here, you can apply for open staff member positions, view your application status, and manage your profile. </p>
<p>Sign up with Email to continue.</p>
<p>{{__('messages.homepage_explainer_line1')}}</p>
<p>{{__('messages.homepage_explainer_line2')}}</p>
</div>
</div>
</div>

View File

@ -7,15 +7,15 @@
<!-- todo: details component -->
@foreach($positions as $position)
<x-modal id="{{ $position->vacancySlug . '-details' }}" modal-label="{{ $position->vacancySlug . '-details-label' }}" modal-title="Opening details" include-close-button="true">
<x-modal id="{{ $position->vacancySlug . '-details' }}" modal-label="{{ $position->vacancySlug . '-details-label' }}" modal-title="{{__('messages.details_m_title')}}" include-close-button="true">
@if (is_null($position->vacancyFullDescription))
<div class="alert alert-warning">
<h3><i class="fas fa-question-circle"></i> There don't seem to be any details</h3>
<h3><i class="fas fa-question-circle"></i> {{__('messages.opening_nodetails')}}</h3>
<p>
This opening does not have any details yet.
{{__('messages.opening_nodetails_exp')}}
</p>
</div>
@ -23,7 +23,7 @@
{!! $position->vacancyFullDescription !!}
<p class="text-sm text-muted">
Last updated @ {{ $position->updated_at }}
{{__('messages.last_updated')}} @ {{ $position->updated_at }}
</p>
@endif
@ -45,7 +45,7 @@
<div class="col text-center">
<h3>Open Positions</h3>
<h3>{{__('messages.open_positions')}}</h3>
</div>
@ -64,11 +64,7 @@
<div class="card-header text-center">
<h4 class="card-title">{{$position->vacancyName}}</h4>
@if ($position->vacancyCount == 1)
<p class="card-subtitle">There is <span class="badge badge-success">{{$position->vacancyCount}}</span> open position!</p>
@else
<p class="card-subtitle">There are <span class="badge badge-success">{{$position->vacancyCount}}</span> open positions!</p>
@endif
<p class="card-subtitle">{{trans_choice('messages.open_position_count', $position->vacancyCount)}}</p>
</div>
@ -83,16 +79,16 @@
<div class="card-footer text-center">
@auth
<button {{($isEligibleForApplication) ? '' : 'disabled'}} type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">Apply</button>
<button {{($isEligibleForApplication) ? '' : 'disabled'}} type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">{{__('messages.txt_apply')}}</button>
@if(!$isEligibleForApplication)
<span class="badge-warning badge"><i class="fa fa-info"></i> Ineligible ({{$eligibilityDaysRemaining}} days remaining)</span>
<span class="badge-warning badge"><i class="fa fa-info"></i> {{__('messages.ineligible_days_remaining', ['days' => $elegibilityDaysRemaining])}}</span>
@endif
@endauth
@guest
<button type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">Apply</button>
<button type="button" class="btn btn-info" onclick="$('#{{ $position->vacancySlug }}-details').modal('show')">Learn more</button>
@endguest
<button type="button" class="btn btn-success" onclick="window.location.href='{{route('renderApplicationForm', ['vacancySlug' => $position->vacancySlug])}}'">{{__('messages.txt_apply')}}</button>
<button type="button" class="btn btn-info" onclick="$('#{{ $position->vacancySlug }}-details').modal('show')">{{__('messages.txt_learn_more')}}</button>
@endguest
</div>
@ -110,7 +106,7 @@
<div class="card-header">
<div class="card-title"><h4>Applications Closed</h4></div>
<div class="card-title"><h4>{{__('messages.application_closed')}}</h4></div>
</div>
@ -118,11 +114,9 @@
<div class="alert alert-info">
<p><b>Hello there!</b></p>
<p><b>{{__('messages.application_closed_intro')}}</b></p>
<p>
We are currently not hiring any new staff members at the moment. If you'd like to apply, check out our Discord's
announcement channel for news when a new position opens.
Our application cycle usually lasts two weeks, so if you're seeing this, it's because it finished, and new one will begin soon.
{{__('messages.application_closed_intro_line2')}}
</p>
</div>
@ -141,7 +135,7 @@
<div class="col text-center">
<h3>Where you'll work</h3>
<h3>{{__('messages.where_work')}}</h3>
</div>
@ -174,11 +168,11 @@
</div>
<a class="carousel-control-prev" href="#carouselControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
<span class="sr-only">{{__('pagination.previous')}}</span>
</a>
<a class="carousel-control-next" href="#carouselControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
<span class="sr-only">{{__('pagination.next')}}</span>
</a>
</div>
@ -189,7 +183,7 @@
<div class="col text-center">
<h3>Join The Team</h3>
<h3>{{__('messages.join_team')}}</h3>
</div>
@ -199,7 +193,7 @@
<div class="col text-center">
<p>
Join the team today and help out network grow and prosper!
{{__('messages.join_team_cta')}}
</p>
</div>
@ -210,8 +204,8 @@
<div class="col">
<h3>Any questions? Leave a message!</h3>
<p class="text-muted">*This is not an application form. Any applications sent here will be ignored.</p>
<h3>{{__('messages.contact_cta')}}</h3>
<p class="text-muted">{{__('messages.contact_disclaimer')}}</p>
</div>
@ -236,7 +230,7 @@
<div class="md-form">
<input type="text" name="name" class="form-control" id="firstName">
<label for="firstName">Name</label>
<label for="firstName">{{__('messages.contactlabel_name')}}</label>
</div>
</div>
@ -246,7 +240,7 @@
<div class="md-form">
<input type="email" name="email" class="form-control" id="email">
<label for="email">E-mail</label>
<label for="email">{{__('messages.contactlabel_email')}}</label>
</div>
@ -260,7 +254,7 @@
<div class="md-form">
<input type="text" name="subject" id="subject" class="form-control">
<label for="subject">Subject (ex. Suggestion)</label>
<label for="subject">{{__('messages.contactlabel_subject')}}</label>
</div>
@ -296,7 +290,7 @@
<!-- align: deprecated cheap hack, but quick -->
<div align="center" class="g-recaptcha pb-3" data-callback="gcallback" data-sitekey="{{config('recaptcha.keys.sitekey')}}"></div>
<button type="button" class="btn btn-info" onclick="document.getElementById('contactForm').submit()">Send</button>
<button type="button" class="btn btn-info" onclick="document.getElementById('contactForm').submit()">{{__('messages.contactlabel_send')}}</button>
</div>