Skip to content

Commit a65ed28

Browse files
committed
add lang files and pass in view
1 parent 19d12c1 commit a65ed28

File tree

6 files changed

+85
-1
lines changed

6 files changed

+85
-1
lines changed

resources/lang/en/days.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
return [
4+
'short' => [
5+
'1' => 'Mon',
6+
'2' => 'Tue',
7+
'3' => 'Wed',
8+
'4' => 'Thu',
9+
'5' => 'Fri',
10+
'6' => 'Sat',
11+
'7' => 'Sun',
12+
],
13+
'long' => [
14+
'1' => 'Monday',
15+
'2' => 'Tuesday',
16+
'3' => 'Wednesday',
17+
'4' => 'Thursday',
18+
'5' => 'Friday',
19+
'6' => 'Saturday',
20+
'7' => 'Sunday',
21+
],
22+
];

resources/lang/en/months.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
return [
4+
'0' => 'Farvardin',
5+
'1' => 'Ordibehesht',
6+
'2' => 'Khordaad',
7+
'3' => 'Tir',
8+
'4' => 'Mordaad',
9+
'5' => 'Shahrivar',
10+
'6' => 'Mehr',
11+
'7' => 'Aabaan',
12+
'8' => 'Aazar',
13+
'9' => 'Dey',
14+
'10' => 'Bahman',
15+
'11' => 'Esfand',
16+
];

resources/lang/fa/days.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
return [
4+
'short' => [
5+
'1' => 'دو',
6+
'2' => 'سه',
7+
'3' => 'چه',
8+
'4' => 'پن',
9+
'5' => 'جم',
10+
'6' => 'شن',
11+
'7' => 'یک',
12+
],
13+
'long' => [
14+
'1' => 'دوشنبه',
15+
'2' => 'سه‌شنبه',
16+
'3' => 'چهارشنبه',
17+
'4' => 'پنج‌شنبه',
18+
'5' => 'جمعه',
19+
'6' => 'شنبه',
20+
'7' => 'یکشنبه',
21+
],
22+
];

resources/lang/fa/months.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
return [
4+
'0' => 'فروردین',
5+
'1' => 'اردیبهشت',
6+
'2' => 'خرداد',
7+
'3' => 'تیر',
8+
'4' => 'امرداد',
9+
'5' => 'شهریور',
10+
'6' => 'مهر',
11+
'7' => 'آبان',
12+
'8' => 'آذر',
13+
'9' => 'دی',
14+
'10' => 'بهمن',
15+
'11' => 'اسفند',
16+
];

resources/views/jalali-date-time-picker.blade.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
$suffixIcon = $getSuffixIcon();
1818
$suffixLabel = $getSuffixLabel();
1919
$statePath = $getStatePath();
20+
$months = trans('filament-jalali::months');
21+
$dayLabels = trans('filament-jalali::days.long');
22+
$dayShortLabels = trans('filament-jalali::days.short');
2023
@endphp
2124

2225
<x-dynamic-component
@@ -54,6 +57,9 @@
5457
locale: @js($getLocale()),
5558
shouldCloseOnDateSelection: @js($shouldCloseOnDateSelection()),
5659
state: $wire.{{ $applyStateBindingModifiers("\$entangle('{$statePath}')") }},
60+
months: @js($months),
61+
dayLabel: @js($dayLabels),
62+
dayShortLabel: @js($dayShortLabels)
5763
})"
5864
x-on:keydown.esc="isOpen() && $event.stopPropagation()"
5965
{{
@@ -104,6 +110,7 @@
104110
placeholder="{{ $getPlaceholder() }}"
105111
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.display-text"
106112
x-model="displayText"
113+
dir="ltr"
107114
@if ($id = $getId()) id="{{ $id }}" @endif
108115
@class([
109116
'fi-fo-date-time-picker-display-text-input w-full border-none bg-transparent px-3 py-1.5 text-base text-gray-950 outline-none transition duration-75 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] dark:text-white dark:placeholder:text-gray-500 dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] sm:text-sm sm:leading-6',

src/FilamentJalaliServiceProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public function configurePackage(Package $package): void
2525
{
2626
$package
2727
->name('filament-jalali')
28-
->hasViews('filament-jalali');
28+
->hasViews('filament-jalali')
29+
->hasTranslations();
2930
}
3031

3132
public function packageBooted(): void

0 commit comments

Comments
 (0)