calendar languages

This commit is contained in:
Benjamin Takats
2022-12-18 22:36:52 +01:00
parent 01718fe2e5
commit cc627bfc7b
4 changed files with 21 additions and 10 deletions

View File

@@ -43,9 +43,9 @@ class LanguageController extends Controller
return $language;
})
->toArray();
foreach ($array as &$item) {
//$item['translated'] = __($item['name']);
$item['description'] = $item['language'] === 'en'
foreach ($array as $key => $item) {
$array[$key]['name'] = empty($item['name']) ? $item['language'] : $item['name'];
$array[$key]['description'] = $item['language'] === 'en'
? '100% translated'
: round($item['translatedCount'] / $item['toTranslate'] * 100).'% translated';
}

View File

@@ -7,10 +7,14 @@
<div class="flex items-start">
<div class="w-full sm:w-1/2">
@php
$locale = \Illuminate\Support\Facades\Cookie::get('lang', 'de');
@endphp
<link rel="stylesheet" type="text/css"
href="https://unpkg.com/js-year-calendar@latest/dist/js-year-calendar.min.css"/>
<script src="https://unpkg.com/js-year-calendar@latest/dist/js-year-calendar.min.js"></script>
<script src="https://unpkg.com/js-year-calendar@latest/locales/js-year-calendar.de.js"></script>
<script src="https://unpkg.com/js-year-calendar@latest/locales/js-year-calendar.{{ $locale }}.js"></script>
<style>
.calendar .calendar-header {
@@ -48,7 +52,7 @@
new Calendar(this.$refs.calendar, {
style: 'background',
language: 'de',
language: '{{ $locale }}',
startYear: {{ $year }},
dataSource: events,
yearChanged: function(e) {

View File

@@ -7,10 +7,14 @@
<div class="flex items-start">
<div class="w-full sm:w-1/2">
@php
$locale = \Illuminate\Support\Facades\Cookie::get('lang', 'de');
@endphp
<link rel="stylesheet" type="text/css"
href="https://unpkg.com/js-year-calendar@latest/dist/js-year-calendar.min.css"/>
<script src="https://unpkg.com/js-year-calendar@latest/dist/js-year-calendar.min.js"></script>
<script src="https://unpkg.com/js-year-calendar@latest/locales/js-year-calendar.de.js"></script>
<script src="https://unpkg.com/js-year-calendar@latest/locales/js-year-calendar.{{ $locale }}.js"></script>
<style>
.calendar .calendar-header {
@@ -35,7 +39,6 @@
background: #222;
}
</style>
<div
wire:ignore
x-data="{
@@ -48,7 +51,7 @@
new Calendar(this.$refs.calendar, {
style: 'background',
language: 'de',
language: '{{ $locale }}',
startYear: {{ $year }},
dataSource: events,
yearChanged: function(e) {

View File

@@ -7,10 +7,14 @@
<div class="flex items-start">
<div class="w-full sm:w-1/2">
@php
$locale = \Illuminate\Support\Facades\Cookie::get('lang', 'de');
@endphp
<link rel="stylesheet" type="text/css"
href="https://unpkg.com/js-year-calendar@latest/dist/js-year-calendar.min.css"/>
<script src="https://unpkg.com/js-year-calendar@latest/dist/js-year-calendar.min.js"></script>
<script src="https://unpkg.com/js-year-calendar@latest/locales/js-year-calendar.de.js"></script>
<script src="https://unpkg.com/js-year-calendar@latest/locales/js-year-calendar.{{ $locale }}.js"></script>
<style>
.calendar .calendar-header {
@@ -48,7 +52,7 @@
new Calendar(this.$refs.calendar, {
style: 'background',
language: 'de',
language: '{{ $locale }}',
startYear: {{ $year }},
dataSource: events,
yearChanged: function(e) {