Add localizations in Customers list view

This commit is contained in:
Antoine Le Gonidec 2024-07-12 12:31:57 +02:00
parent 6f0cc59162
commit 30552e58a5
Signed by: vv221
GPG key ID: 636B78F91CEB80D8
4 changed files with 21 additions and 3 deletions

View file

@ -24,7 +24,7 @@ class MMFRestrictedCustomersServiceProvider extends ServiceProvider {
public function boot() { public function boot() {
$this->registerConfig(); $this->registerConfig();
$this->registerViews(); $this->registerViews();
$this->registerFactories(); $this->registerTranslations();
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
$this->commands([ $this->commands([
FetchEmails::class, FetchEmails::class,
@ -116,7 +116,7 @@ class MMFRestrictedCustomersServiceProvider extends ServiceProvider {
* @return void * @return void
*/ */
public function registerTranslations() { public function registerTranslations() {
$this->loadJsonTranslationsFrom(__DIR__ .'/../Resources/lang'); $this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'mmfrestrictedcustomers');
} }
/** /**

View file

@ -0,0 +1,9 @@
<?php
/*
SPDX-License-Identifier: AGPL-3.0-only
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
*/
return [
'no-mailbox' => 'Warning: no mailbox.',
];

View file

@ -0,0 +1,9 @@
<?php
/*
SPDX-License-Identifier: AGPL-3.0-only
SPDX-FileCopyrightText: © 2024 Millions Missing FRANCE <info@millionsmissing.fr>
*/
return [
'no-mailbox' => 'Attention: pas de boîte mail liée.',
];

View file

@ -6,7 +6,7 @@
<a href="{{ Eventy::filter('customer.card.url', route('customers.update', ['id' => $customer->id]), $customer) }}" class="card hover-shade" @action('customer.card.link', $customer) > <a href="{{ Eventy::filter('customer.card.url', route('customers.update', ['id' => $customer->id]), $customer) }}" class="card hover-shade" @action('customer.card.link', $customer) >
<img src="{{ $customer->getPhotoUrl() }}" /> <img src="{{ $customer->getPhotoUrl() }}" />
@if ($customer->mailbox_id == null) @if ($customer->mailbox_id == null)
<p style="font-size:12px; color: red;">{{ __('Warning: no mailbox') }}</p> <p style="font-size:12px; color: red;">{{ __('mmfrestrictedcustomers::customers.no-mailbox') }}</p>
@endif @endif
<h4 title="{{ $customer->first_name }} {{ $customer->last_name }}">{{ $customer->first_name }} {{ $customer->last_name }}</h4> <h4 title="{{ $customer->first_name }} {{ $customer->last_name }}">{{ $customer->first_name }} {{ $customer->last_name }}</h4>
<p class="text-truncate"><small>{{ $customer->getEmailOrPhone() }}</small></p> <p class="text-truncate"><small>{{ $customer->getEmailOrPhone() }}</small></p>