AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. namespace App\Storefront;
  3. /**
  4. * Messages the server shows to shoppers, in the store's language.
  5. * The words drawn by the browser live in resources/js/storefront/text.ts.
  6. */
  7. final class StorefrontText
  8. {
  9. private const array LINES = [
  10. 'en' => [
  11. 'cart_empty' => 'Your cart is empty.',
  12. 'minimum_total' => 'The order total must be at least RM 2.00.',
  13. 'sold_out' => 'This product is sold out.',
  14. 'payment_unavailable' => 'We could not start the payment. Please try again in a moment.',
  15. 'discount_invalid' => 'This code is not valid.',
  16. 'discount_not_started' => 'This code cannot be used yet.',
  17. 'discount_expired' => 'This code has expired.',
  18. 'discount_used_up' => 'This code has been used up.',
  19. 'discount_minimum' => 'Spend at least :amount on products to use this code.',
  20. 'discount_total_too_low' => 'After the discount, the order total must be at least RM 2.00.',
  21. 'discount_changed' => 'Your discount code can no longer be used, so it was removed. Please check your total.',
  22. ],
  23. 'ms' => [
  24. 'cart_empty' => 'Troli anda kosong.',
  25. 'minimum_total' => 'Jumlah pesanan mestilah sekurang-kurangnya RM 2.00.',
  26. 'sold_out' => 'Produk ini telah habis dijual.',
  27. 'payment_unavailable' => 'Kami tidak dapat memulakan pembayaran. Sila cuba sebentar lagi.',
  28. 'discount_invalid' => 'Kod ini tidak sah.',
  29. 'discount_not_started' => 'Kod ini belum boleh digunakan.',
  30. 'discount_expired' => 'Kod ini telah tamat tempoh.',
  31. 'discount_used_up' => 'Kod ini telah habis digunakan.',
  32. 'discount_minimum' => 'Belanja sekurang-kurangnya :amount untuk produk bagi menggunakan kod ini.',
  33. 'discount_total_too_low' => 'Selepas diskaun, jumlah pesanan mestilah sekurang-kurangnya RM 2.00.',
  34. 'discount_changed' => 'Kod diskaun anda tidak lagi boleh digunakan, jadi ia telah dibuang. Sila semak jumlah anda.',
  35. ],
  36. ];
  37. /**
  38. * @param array<string, string> $replace Words to put in, such as [':amount' => 'RM 50.00'].
  39. */
  40. public static function line(string $language, string $key, array $replace = []): string
  41. {
  42. return strtr(self::LINES[$language][$key] ?? self::LINES['en'][$key], $replace);
  43. }
  44. /**
  45. * Messages for the checkout form's checks.
  46. *
  47. * @return array<string, string>
  48. */
  49. public static function checkoutMessages(string $language): array
  50. {
  51. if ($language === 'ms') {
  52. return [
  53. 'required' => ':attribute diperlukan.',
  54. 'string' => ':attribute tidak sah.',
  55. 'email' => ':attribute mestilah alamat e-mel yang sah.',
  56. 'min' => ':attribute mestilah sekurang-kurangnya :min aksara.',
  57. 'max' => ':attribute tidak boleh melebihi :max aksara.',
  58. 'phone.regex' => 'Sila masukkan nombor telefon yang sah.',
  59. 'postcode.regex' => 'Poskod mestilah 5 digit.',
  60. 'state.in' => 'Sila pilih negeri.',
  61. ];
  62. }
  63. return [
  64. 'phone.regex' => 'Please enter a valid phone number.',
  65. 'postcode.regex' => 'The postcode must be 5 digits.',
  66. 'state.in' => 'Please choose a state.',
  67. ];
  68. }
  69. /**
  70. * How the checkout fields are named inside those messages.
  71. *
  72. * @return array<string, string>
  73. */
  74. public static function checkoutFields(string $language): array
  75. {
  76. return $language === 'ms'
  77. ? ['name' => 'Nama penuh', 'email' => 'E-mel', 'phone' => 'Nombor telefon', 'line1' => 'Alamat', 'line2' => 'Alamat baris 2', 'city' => 'Bandar', 'postcode' => 'Poskod', 'state' => 'Negeri']
  78. : ['name' => 'full name', 'email' => 'email', 'phone' => 'phone number', 'line1' => 'address', 'line2' => 'address line 2', 'city' => 'city', 'postcode' => 'postcode', 'state' => 'state'];
  79. }
  80. }