generated from boboko/starter
212 lines
12 KiB
PHP
212 lines
12 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Modules\Core\Localization\Services\TranslationService;
|
|
use Spatie\TranslationLoader\LanguageLine;
|
|
|
|
/**
|
|
* Default `checkout` translation lines for the cart drawer and the checkout
|
|
* page (see the checkout module under resources/views/checkout).
|
|
*
|
|
* Additive and idempotent: a group/key that already exists is left untouched,
|
|
* so anything edited in the Filament Language Lines UI wins on a re-run. Runs
|
|
* explicitly — `php artisan db:seed --class=CheckoutTranslationsSeeder` — it is
|
|
* not wired into DatabaseSeeder.
|
|
*
|
|
* Greek copy uses the project's informal register (εσύ/σου). When the checkout
|
|
* module moves to boboko-core this becomes the module's own default-strings
|
|
* seeder.
|
|
*/
|
|
class CheckoutTranslationsSeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
$translations = app(TranslationService::class);
|
|
|
|
foreach ($this->lines() as $key => [$en, $el]) {
|
|
$exists = LanguageLine::query()
|
|
->where('group', 'checkout')
|
|
->where('key', $key)
|
|
->exists();
|
|
|
|
if ($exists) {
|
|
$this->command?->warn("checkout.{$key} already exists — skipped");
|
|
|
|
continue;
|
|
}
|
|
|
|
$translations->create('checkout', $key, ['en' => $en, 'el' => $el]);
|
|
$this->command?->info("checkout.{$key} added");
|
|
}
|
|
}
|
|
|
|
/**
|
|
* key => [English, Greek].
|
|
*
|
|
* @return array<string, array{0: string, 1: string}>
|
|
*/
|
|
private function lines(): array
|
|
{
|
|
return [
|
|
// ── Cart drawer + order summary ──────────────────────────────
|
|
'cart.title' => ['Your cart', 'Το καλάθι σου'],
|
|
'cart.close' => ['Close', 'Κλείσιμο'],
|
|
'cart.empty' => ['Your cart is empty', 'Το καλάθι σου είναι άδειο'],
|
|
'cart.quantity' => ['Quantity', 'Ποσότητα'],
|
|
'cart.increase' => ['Increase quantity', 'Αύξηση ποσότητας'],
|
|
'cart.decrease' => ['Decrease quantity', 'Μείωση ποσότητας'],
|
|
'cart.remove' => ['Remove', 'Αφαίρεση'],
|
|
'cart.subtotal' => ['Subtotal', 'Υποσύνολο'],
|
|
'cart.discount' => ['Discount', 'Έκπτωση'],
|
|
'cart.shipping' => ['Shipping', 'Μεταφορικά'],
|
|
'cart.shipping_pending' => ['Not selected yet', 'Δεν έχει επιλεγεί ακόμη'],
|
|
'cart.tax' => ['VAT', 'ΦΠΑ'],
|
|
'cart.total' => ['Total', 'Σύνολο'],
|
|
'cart.checkout' => ['Checkout', 'Ολοκλήρωση παραγγελίας'],
|
|
'cart.coupon_label' => ['Coupon code', 'Κωδικός κουπονιού'],
|
|
'cart.coupon_placeholder' => ['Coupon code', 'Κωδικός κουπονιού'],
|
|
'cart.coupon_apply' => ['Apply', 'Εφαρμογή'],
|
|
'cart.coupon_remove' => ['Remove', 'Αφαίρεση'],
|
|
'cart.coupon_invalid' => ["That coupon code isn't valid", 'Ο κωδικός κουπονιού δεν είναι έγκυρος'],
|
|
|
|
// ── Checkout page ────────────────────────────────────────────
|
|
'page.title' => ['Checkout', 'Ολοκλήρωση παραγγελίας'],
|
|
'page.contact_heading' => ['Contact', 'Στοιχεία επικοινωνίας'],
|
|
'page.guest_tab' => ['Guest', 'Ως επισκέπτης'],
|
|
'page.login_tab' => ['Log in', 'Σύνδεση'],
|
|
'page.email_label' => ['Email', 'Email'],
|
|
'page.recovery_consent' => [
|
|
"Email me a reminder if I don't finish my order",
|
|
'Στείλε μου μια υπενθύμιση αν δεν ολοκληρώσω την παραγγελία μου',
|
|
],
|
|
'page.login_email_label' => ['Email', 'Email'],
|
|
'page.send_code' => ['Send code', 'Αποστολή κωδικού'],
|
|
'page.login_coming_soon' => [
|
|
'Login is coming soon — continue as a guest for now.',
|
|
'Η σύνδεση θα είναι διαθέσιμη σύντομα — προς το παρόν συνέχισε ως επισκέπτης.',
|
|
],
|
|
'page.billing_heading' => ['Billing information', 'Στοιχεία τιμολόγησης'],
|
|
'page.shipping_heading' => ['Shipping information', 'Στοιχεία αποστολής'],
|
|
'page.same_as_billing' => ['Same as billing address', 'Ίδια με τη διεύθυνση τιμολόγησης'],
|
|
'page.first_name' => ['First name', 'Όνομα'],
|
|
'page.last_name' => ['Last name', 'Επώνυμο'],
|
|
'page.company_name' => ['Company name', 'Επωνυμία εταιρείας'],
|
|
'page.tax_identifier' => ['Tax ID', 'ΑΦΜ'],
|
|
'page.address_line_one' => ['Address', 'Διεύθυνση'],
|
|
'page.address_line_two' => ['Address line 2', 'Διεύθυνση (γραμμή 2)'],
|
|
'page.city' => ['City', 'Πόλη'],
|
|
'page.state' => ['Region / Prefecture', 'Νομός / Περιοχή'],
|
|
'page.state_placeholder' => ['Select a region', 'Επίλεξε νομό'],
|
|
'page.postcode' => ['Postcode', 'Ταχυδρομικός κώδικας'],
|
|
'page.country' => ['Country', 'Χώρα'],
|
|
'page.country_placeholder' => ['Select a country', 'Επίλεξε χώρα'],
|
|
'page.phone' => ['Phone', 'Τηλέφωνο'],
|
|
'page.delivery_instructions' => ['Delivery notes', 'Σχόλια για την παράδοση'],
|
|
'page.save_address' => ['Save and continue', 'Αποθήκευση και συνέχεια'],
|
|
'page.saving' => ['Saving…', 'Αποθήκευση…'],
|
|
'page.saved' => ['Saved', 'Αποθηκεύτηκε'],
|
|
'page.save_error' => ["Couldn't save — check your connection", 'Δεν αποθηκεύτηκε — έλεγξε τη σύνδεσή σου'],
|
|
'page.shipping_method_heading' => ['Shipping method', 'Τρόπος αποστολής'],
|
|
'page.shipping_method_empty' => [
|
|
'Add your shipping address to see delivery options.',
|
|
'Συμπλήρωσε τη διεύθυνση αποστολής για να δεις τις διαθέσιμες επιλογές.',
|
|
],
|
|
'page.shipping_method_none' => [
|
|
'No delivery options are available for this address.',
|
|
'Δεν υπάρχουν διαθέσιμες επιλογές αποστολής για αυτή τη διεύθυνση.',
|
|
],
|
|
'page.box_now_locker_label' => [
|
|
'Choose a Box Now locker',
|
|
'Επίλεξε Box Now locker',
|
|
],
|
|
'page.box_now_locker_loading' => [
|
|
'Loading lockers…',
|
|
'Φόρτωση lockers…',
|
|
],
|
|
'page.box_now_locker_required' => [
|
|
'Choose a Box Now locker to continue.',
|
|
'Επίλεξε ένα Box Now locker για να συνεχίσεις.',
|
|
],
|
|
'page.box_now_locker_select' => [
|
|
'Select this locker',
|
|
'Επιλογή αυτού του locker',
|
|
],
|
|
'page.box_now_locker_selected' => [
|
|
'Selected',
|
|
'Επιλέχθηκε',
|
|
],
|
|
'page.box_now_locker_search' => [
|
|
'Search by area or address…',
|
|
'Αναζήτηση με περιοχή ή διεύθυνση…',
|
|
],
|
|
'page.box_now_locker_no_results' => [
|
|
'No lockers match your search.',
|
|
'Δεν βρέθηκαν lockers για αυτή την αναζήτηση.',
|
|
],
|
|
'page.select_shipping_method' => ['Continue', 'Συνέχεια'],
|
|
'page.shipping_option_invalid' => [
|
|
'That shipping option is no longer available.',
|
|
'Αυτός ο τρόπος αποστολής δεν είναι πλέον διαθέσιμος.',
|
|
],
|
|
'page.continue_to_payment' => ['Continue to payment', 'Συνέχεια στην πληρωμή'],
|
|
'page.order_summary_heading' => ['Order summary', 'Σύνοψη παραγγελίας'],
|
|
|
|
// ── Payment step ────────────────────────────────────────────
|
|
'page.payment_heading' => ['Payment', 'Πληρωμή'],
|
|
'page.payment_method_none' => [
|
|
'No payment methods are available right now.',
|
|
'Δεν υπάρχουν διαθέσιμοι τρόποι πληρωμής αυτή τη στιγμή.',
|
|
],
|
|
'page.terms_accept' => [
|
|
"I accept the <a href=':terms' target='_blank'>Terms of Sale</a> and the <a href=':privacy' target='_blank'>Privacy Policy</a>",
|
|
"Αποδέχομαι τους <a href=':terms' target='_blank'>Όρους Πώλησης</a> και την <a href=':privacy' target='_blank'>Πολιτική Απορρήτου</a>",
|
|
],
|
|
'page.terms_required' => [
|
|
'You must accept the terms to place your order.',
|
|
'Πρέπει να αποδεχτείς τους όρους για να ολοκληρώσεις την παραγγελία.',
|
|
],
|
|
'page.withdrawal_notice' => [
|
|
"You have a 14-day right of withdrawal. <a href=':link' target='_blank'>See details</a>.",
|
|
"Έχεις δικαίωμα υπαναχώρησης εντός 14 ημερών. <a href=':link' target='_blank'>Δες λεπτομέρειες</a>.",
|
|
],
|
|
'page.place_order' => ['Place order — payment obligation', 'Παραγγελία με υποχρέωση πληρωμής'],
|
|
'page.choose_payment_method' => ['Choose a payment method.', 'Επίλεξε τρόπο πληρωμής.'],
|
|
'page.shipping_method_required' => [
|
|
'Choose a shipping method below to continue.',
|
|
'Επίλεξε τρόπο αποστολής παρακάτω για να συνεχίσεις.',
|
|
],
|
|
'page.payment_failed' => ['Payment failed. Please try again.', 'Η πληρωμή απέτυχε. Δοκίμασε ξανά.'],
|
|
'page.payment_incomplete_details' => [
|
|
'Complete your billing and shipping details above.',
|
|
'Συμπλήρωσε τα στοιχεία χρέωσης και αποστολής παραπάνω.',
|
|
],
|
|
'page.payment_cart_changed' => [
|
|
'Your cart changed. Refresh the page and place your order again.',
|
|
'Το καλάθι σου άλλαξε. Ανανέωσε τη σελίδα και ολοκλήρωσε ξανά.',
|
|
],
|
|
'page.payment_processing' => ['Confirming your payment…', 'Επιβεβαίωση πληρωμής…'],
|
|
'page.payment_processing_slow' => [
|
|
"Your payment is still processing. You'll get an email once it's confirmed.",
|
|
'Η πληρωμή σου επεξεργάζεται ακόμη. Θα λάβεις email μόλις επιβεβαιωθεί.',
|
|
],
|
|
|
|
// ── Confirmation page ──────────────────────────────────────
|
|
'page.confirmation_title' => ['Your order', 'Η παραγγελία σου'],
|
|
'page.confirmation_heading' => [
|
|
'Thank you! Your order is confirmed.',
|
|
'Ευχαριστούμε! Η παραγγελία σου καταχωρήθηκε.',
|
|
],
|
|
'page.confirmation_order_number' => ['Order number', 'Αριθμός παραγγελίας'],
|
|
'page.confirmation_email_note' => [
|
|
'A confirmation email will follow shortly.',
|
|
'Θα λάβεις email επιβεβαίωσης σύντομα.',
|
|
],
|
|
'page.confirmation_shipping_to' => ['Shipping to', 'Αποστολή σε'],
|
|
'page.confirmation_billing' => ['Billing', 'Χρέωση'],
|
|
'page.confirmation_continue' => ['Continue shopping', 'Συνέχεια αγορών'],
|
|
];
|
|
}
|
|
}
|