translations added

This commit is contained in:
Benjamin Takats
2022-12-17 20:28:14 +01:00
parent dfaf83199a
commit 1d7927607f
612 changed files with 539 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
<div class="search">
<input type="text" class="search-input" placeholder="{{ __('translation::translation.search') }}" name="{{ $name }}" value="{{ $value }}">
</div>

View File

@@ -0,0 +1,18 @@
<div class="select-group">
<select name="{{ $name }}" @if(isset($submit) && $submit) v-on:change="submit" @endif>
@if(isset($optional) && $optional)<option value> ----- </option>@endif
@foreach($items as $key => $value)
@if(is_numeric($key))
<option value="{{ $value }}" @if(isset($selected) && $selected === $value) selected="selected" @endif>{{ $value }}</option>
@else
<option value="{{ $key }}" @if(isset($selected) && $selected === $key) selected="selected" @endif>{{ $value }}</option>
@endif
@endforeach
</select>
<div class="caret">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/></svg>
</div>
</div>

View File

@@ -0,0 +1,18 @@
<div class="input-group">
<label for="{{ $field }}">
{{ $label }}
</label>
<input
class="@if($errors->has($field)) error @endif"
name="{{ $field }}"
id="{{ $field }}"
type="text"
placeholder="{{ isset($placeholder) ? $placeholder : '' }}"
value="{{ old($field) }}"
{{ isset($required) ? 'required' : '' }}>
@if($errors->has($field))
@foreach($errors->get($field) as $error)
<p class="error-text">{!! $error !!}</p>
@endforeach
@endif
</div>

View File

@@ -0,0 +1 @@
<svg class="{{ isset($class) ? $class : 'fill-current w-4 h-4 mr-2' }}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 20a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm2-2.25a8 8 0 0 0 4-2.46V9a2 2 0 0 1-2-2V3.07a7.95 7.95 0 0 0-3-1V3a2 2 0 0 1-2 2v1a2 2 0 0 1-2 2v2h3a2 2 0 0 1 2 2v5.75zm-4 0V15a2 2 0 0 1-2-2v-1h-.5A1.5 1.5 0 0 1 4 10.5V8H2.25A8.01 8.01 0 0 0 8 17.75z"/></svg>

After

Width:  |  Height:  |  Size: 389 B

View File

@@ -0,0 +1 @@
<svg class="{{ isset($class) ? $class : 'fill-current w-4 h-4 mr-2' }}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M7.41 9l2.24 2.24-.83 2L6 10.4l-3.3 3.3-1.4-1.42L4.58 9l-.88-.88c-.53-.53-1-1.3-1.3-2.12h2.2c.15.28.33.53.51.7l.89.9.88-.88C7.48 6.1 8 4.84 8 4H0V2h5V0h2v2h5v2h-2c0 1.37-.74 3.15-1.7 4.12L7.4 9zm3.84 8L10 20H8l5-12h2l5 12h-2l-1.25-3h-5.5zm.83-2h3.84L14 10.4 12.08 15z"/></svg>

After

Width:  |  Height:  |  Size: 412 B

View File

@@ -0,0 +1,41 @@
@extends('translation::layout')
@section('body')
<div class="panel w-1/2">
<div class="panel-header">
{{ __('translation::translation.add_language') }}
</div>
<form action="{{ route('languages.store') }}" method="POST">
<fieldset>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="panel-body p-4">
@include('translation::forms.text', ['field' => 'name', 'label' => __('translation::translation.language_name'), ])
@include('translation::forms.text', ['field' => 'locale', 'label' => __('translation::translation.locale'), ])
</div>
</fieldset>
<div class="panel-footer flex flex-row-reverse">
<button class="button button-blue">
{{ __('translation::translation.save') }}
</button>
</div>
</form>
</div>
@endsection

View File

@@ -0,0 +1,56 @@
@extends('translation::layout')
@section('body')
@if(count($languages))
<div class="panel w-1/2">
<div class="panel-header">
{{ __('translation::translation.languages') }}
<div class="flex flex-grow justify-end items-center">
<a href="{{ route('languages.create') }}" class="button">
{{ __('translation::translation.add') }}
</a>
</div>
</div>
<div class="panel-body">
<table>
<thead>
<tr>
<th>{{ __('translation::translation.language_name') }}</th>
<th>{{ __('translation::translation.locale') }}</th>
</tr>
</thead>
<tbody>
@foreach($languages as $language => $name)
<tr>
<td>
{{ $name }}
</td>
<td>
<a href="{{ route('languages.translations.index', $language) }}">
{{ $language }}
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
@endsection

View File

@@ -0,0 +1,56 @@
@extends('translation::layout')
@section('body')
<div class="panel w-1/2">
<div class="panel-header">
{{ __('translation::translation.add_translation') }}
</div>
<form action="{{ route('languages.translations.store', $language) }}" method="POST">
<fieldset>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="panel-body p-4">
@include('translation::forms.text', ['field' => 'group', 'label' => __('translation::translation.group_label'), 'placeholder' => __('translation::translation.group_placeholder')])
@include('translation::forms.text', ['field' => 'key', 'label' => __('translation::translation.key_label'), 'placeholder' => __('translation::translation.key_placeholder')])
@include('translation::forms.text', ['field' => 'value', 'label' => __('translation::translation.value_label'), 'placeholder' => __('translation::translation.value_placeholder')])
<div class="input-group">
<button v-on:click="toggleAdvancedOptions" class="text-blue">{{ __('translation::translation.advanced_options') }}</button>
</div>
<div v-show="showAdvancedOptions">
@include('translation::forms.text', ['field' => 'namespace', 'label' => __('translation::translation.namespace_label'), 'placeholder' => __('translation::translation.namespace_placeholder')])
</div>
</div>
</fieldset>
<div class="panel-footer flex flex-row-reverse">
<button class="button button-blue">
{{ __('translation::translation.save') }}
</button>
</div>
</form>
</div>
@endsection

View File

@@ -0,0 +1,89 @@
@extends('translation::layout')
@section('body')
<form action="{{ route('languages.translations.index', ['language' => $language]) }}" method="get">
<div class="panel">
<div class="panel-header">
{{ __('translation::translation.translations') }}
<div class="flex flex-grow justify-end items-center">
@include('translation::forms.search', ['name' => 'filter', 'value' => Request::get('filter')])
@include('translation::forms.select', ['name' => 'language', 'items' => $languages, 'submit' => true, 'selected' => $language])
<div class="sm:hidden lg:flex items-center">
@include('translation::forms.select', ['name' => 'group', 'items' => $groups, 'submit' => true, 'selected' => Request::get('group'), 'optional' => true])
<a href="{{ route('languages.translations.create', $language) }}" class="button">
{{ __('translation::translation.add') }}
</a>
</div>
</div>
</div>
<div class="panel-body">
@if(count($translations))
<table>
<thead>
<tr>
<th class="w-1/5 uppercase font-thin">{{ __('translation::translation.group_single') }}</th>
<th class="w-1/5 uppercase font-thin">{{ __('translation::translation.key') }}</th>
<th class="uppercase font-thin">{{ config('app.locale') }}</th>
<th class="uppercase font-thin">{{ $language }}</th>
</tr>
</thead>
<tbody>
@foreach($translations as $type => $items)
@foreach($items as $group => $translations)
@foreach($translations as $key => $value)
@if(!is_array($value[config('app.locale')]))
<tr>
<td>{{ $group }}</td>
<td>{{ $key }}</td>
<td>{{ $value[config('app.locale')] }}</td>
<td>
<translation-input
initial-translation="{{ $value[$language] }}"
language="{{ $language }}"
group="{{ $group }}"
translation-key="{{ $key }}"
route="{{ config('translation.ui_url') }}">
</translation-input>
</td>
</tr>
@endif
@endforeach
@endforeach
@endforeach
</tbody>
</table>
@endif
</div>
</div>
</form>
@endsection

View File

@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name') }}</title>
<link rel="stylesheet" href="{{ asset('/vendor/translation/css/main.css') }}">
</head>
<body>
<div id="app">
@include('translation::nav')
@include('translation::notifications')
@yield('body')
</div>
<script src="{{ asset('/vendor/translation/js/app.js') }}"></script>
</body>
</html>

View File

@@ -0,0 +1,20 @@
<nav class="header">
<h1 class="text-lg px-6">{{ config('app.name') }}</h1>
<ul class="flex-grow justify-end pr-2">
<li>
<a href="{{ route('languages.index') }}" class="{{ set_active('') }}{{ set_active('/create') }}">
@include('translation::icons.globe')
{{ __('translation::translation.languages') }}
</a>
</li>
<li>
<a href="{{ route('languages.translations.index', config('app.locale')) }}" class="{{ set_active('*/translations') }}">
@include('translation::icons.translate')
{{ __('translation::translation.translations') }}
</a>
</li>
</ul>
</nav>

View File

@@ -0,0 +1,15 @@
@if(Session::has('success'))
<div class="bg-green-lightest text-green-darker p-6 shadow-md" role="alert">
<div class="flex justify-center">
<p>{{ Session::get('success') }}</p>
</div>
</div>
@endif
@if(Session::has('error'))
<div class="bg-red-lightest text-red-darker p-6 shadow-md" role="alert">
<div class="flex justify-center">
<p>{!! Session::get('error') !!}</p>
</div>
</div>
@endif