@hszrdm/create-commerce 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-commerce.mjs +9 -2
- package/package.json +1 -1
- package/src/cli.mjs +2 -2
- package/templates/backend/.env.example +66 -7
- package/templates/backend/medusa-config.ts +17 -1
- package/templates/backend/package.json +2 -1
- package/templates/backend/src/scripts/core-init.ts +13 -1
- package/templates/storefront/next-env.d.ts +4 -1
- package/templates/storefront/src/app/[countryCode]/categories/[handle]/page.tsx +9 -3
- package/templates/storefront/src/app/[countryCode]/products/[handle]/page.tsx +9 -5
- package/templates/storefront/src/app/[countryCode]/products/page.tsx +17 -10
- package/templates/storefront/src/app/checkout/page.tsx +12 -3
- package/templates/storefront/src/app/checkout/success/page.tsx +58 -18
- package/templates/storefront/src/app/layout.tsx +10 -3
- package/templates/storefront/src/app/legal/page.tsx +11 -5
- package/templates/storefront/src/app/page.tsx +18 -12
- package/templates/storefront/src/app/reset-password/page.tsx +8 -2
- package/templates/storefront/src/components/account-dashboard.tsx +197 -76
- package/templates/storefront/src/components/add-to-cart.tsx +24 -10
- package/templates/storefront/src/components/cart-provider.tsx +29 -12
- package/templates/storefront/src/components/cart-view.tsx +28 -20
- package/templates/storefront/src/components/checkout-analytics.tsx +23 -0
- package/templates/storefront/src/components/checkout-flow.tsx +354 -102
- package/templates/storefront/src/components/order-detail.tsx +84 -45
- package/templates/storefront/src/components/product-card.tsx +16 -8
- package/templates/storefront/src/components/reset-password-form.tsx +19 -13
- package/templates/storefront/src/components/storefront-header.tsx +25 -11
- package/templates/storefront/src/components/stripe-payment.tsx +20 -4
- package/templates/storefront/src/lib/core/catalog.ts +37 -5
- package/templates/storefront/src/lib/core/client.ts +5 -0
- package/templates/storefront/src/lib/core/cms.ts +112 -0
- package/templates/storefront/src/lib/core/commerce.ts +14 -4
- package/templates/storefront/src/lib/core/leads.ts +50 -0
- package/templates/storefront/src/lib/core/pricing.ts +68 -0
- package/templates/storefront/src/lib/core/quotes.ts +43 -0
- package/templates/storefront/src/lib/core/seo.ts +44 -6
- package/templates/storefront/src/lib/storefront-copy.ts +435 -0
- package/templates/storefront/src/lib/storefront-locale-server.ts +11 -0
- package/templates/storefront/src/lib/storefront-routes.ts +91 -0
- package/templates/storefront/src/proxy.ts +142 -0
- package/templates/storefront/tsconfig.json +23 -5
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import type { StorefrontLocale } from "./storefront-routes"
|
|
2
|
+
|
|
3
|
+
const hu = {
|
|
4
|
+
products: "Termékek",
|
|
5
|
+
legalDocuments: "Jogi dokumentumok",
|
|
6
|
+
account: "Fiókom",
|
|
7
|
+
cart: "Kosár",
|
|
8
|
+
close: "Bezárás",
|
|
9
|
+
productCountSuffix: "termék",
|
|
10
|
+
homeHeroTitle: "Gyors, biztonságos vásárlás Medusa Core alapon.",
|
|
11
|
+
homeHeroText: "A termékek, árak, kedvezmények, szállítás, fizetés és jogi szabályok közvetlenül a backend aktuális konfigurációjából érkeznek.",
|
|
12
|
+
homeCoreTitle: "Egy starter, több webshop.",
|
|
13
|
+
homeCoreText: "Az ügyfél-specifikus design cserélhető, a checkout/account/legal/SEO/analytics integrációs réteg újrahasznosítható.",
|
|
14
|
+
categories: "Kategóriák",
|
|
15
|
+
discoverOffer: "Fedezd fel a kínálatot",
|
|
16
|
+
allProducts: "Összes termék →",
|
|
17
|
+
newProducts: "Újdonságok",
|
|
18
|
+
latestProducts: "Legfrissebb termékek",
|
|
19
|
+
fullCatalog: "Teljes kínálat →",
|
|
20
|
+
noPublishedProducts: "Még nincs publikált termék.",
|
|
21
|
+
catalog: "Katalógus",
|
|
22
|
+
productsTitle: "Termékek",
|
|
23
|
+
catalogDescription: "Keresés, kategória és rendezés közvetlenül a Medusa Store API alapján.",
|
|
24
|
+
search: "Keresés",
|
|
25
|
+
searchPlaceholder: "Terméknév, leírás…",
|
|
26
|
+
category: "Kategória",
|
|
27
|
+
allCategories: "Összes kategória",
|
|
28
|
+
sort: "Rendezés",
|
|
29
|
+
newest: "Legújabb",
|
|
30
|
+
oldest: "Legrégebbi",
|
|
31
|
+
nameAZ: "Név A–Z",
|
|
32
|
+
filter: "Szűrés",
|
|
33
|
+
noResults: "Nincs találat.",
|
|
34
|
+
modifySearch: "Módosítsd a keresést vagy a kategóriaszűrőt.",
|
|
35
|
+
previous: "← Előző",
|
|
36
|
+
next: "Következő →",
|
|
37
|
+
product: "Termék",
|
|
38
|
+
noImage: "Nincs kép",
|
|
39
|
+
priceOnProductPage: "Ár a termékoldalon",
|
|
40
|
+
material: "Anyag",
|
|
41
|
+
origin: "Származás",
|
|
42
|
+
emptyCategory: "Ebben a kategóriában még nincs publikált termék.",
|
|
43
|
+
cartLoading: "Kosár betöltése…",
|
|
44
|
+
emptyCart: "A kosarad még üres.",
|
|
45
|
+
chooseProduct: "Válassz terméket a kínálatból.",
|
|
46
|
+
viewProducts: "Termékek megtekintése",
|
|
47
|
+
decreaseQuantity: "Mennyiség csökkentése",
|
|
48
|
+
increaseQuantity: "Mennyiség növelése",
|
|
49
|
+
remove: "Törlés",
|
|
50
|
+
couponCode: "Kuponkód",
|
|
51
|
+
redeem: "Beváltás",
|
|
52
|
+
discount: "Kedvezmény",
|
|
53
|
+
subtotal: "Részösszeg",
|
|
54
|
+
shipping: "Szállítás",
|
|
55
|
+
tax: "Adó",
|
|
56
|
+
total: "Összesen",
|
|
57
|
+
checkoutContinue: "Tovább a pénztárhoz",
|
|
58
|
+
checkoutEyebrow: "Checkout",
|
|
59
|
+
checkoutTitle: "Pénztár",
|
|
60
|
+
checkoutDescription: "A szállítás, fizetés, végösszeg és jogi követelmények a Core/Medusa aktuális állapotából jönnek.",
|
|
61
|
+
checkoutLoading: "Pénztár betöltése…",
|
|
62
|
+
contactAndAddress: "Kapcsolat és szállítási cím",
|
|
63
|
+
email: "E-mail",
|
|
64
|
+
phone: "Telefon",
|
|
65
|
+
firstName: "Keresztnév",
|
|
66
|
+
lastName: "Vezetéknév",
|
|
67
|
+
companyOptional: "Cég (opcionális)",
|
|
68
|
+
country: "Ország",
|
|
69
|
+
postalCode: "Irányítószám",
|
|
70
|
+
city: "Város",
|
|
71
|
+
address1: "Utca, házszám",
|
|
72
|
+
address2: "Cím kiegészítés",
|
|
73
|
+
saveAddressAndLoadShipping: "Adatok mentése és szállítás betöltése",
|
|
74
|
+
saving: "Mentés…",
|
|
75
|
+
saveAddressSuccess: "Kapcsolati és szállítási adatok mentve.",
|
|
76
|
+
chooseShippingFirst: "Mentsd el a címet az elérhető szállítási módok betöltéséhez.",
|
|
77
|
+
pickupSearch: "Csomagpont keresése",
|
|
78
|
+
pickupPoint: "Átvételi pont",
|
|
79
|
+
choosePickupPoint: "Válassz átvételi pontot",
|
|
80
|
+
filterPickupHint: "Írj be várost vagy címet a lista szűkítéséhez.",
|
|
81
|
+
packetaPoint: "Packeta pont",
|
|
82
|
+
packetaHint: "A Core nem tesz ki titkos Packeta credentialt a böngészőbe. Add meg az official Packeta widgetből kapott pont azonosítóját; ügyfél-designnál a widget ugyanebbe a mezőbe köthető.",
|
|
83
|
+
pointName: "Pont neve",
|
|
84
|
+
selectShipping: "Szállítás kiválasztása",
|
|
85
|
+
payment: "Fizetés",
|
|
86
|
+
chooseShippingForPayments: "Válassz és ments szállítási módot a fizetési lehetőségek betöltéséhez.",
|
|
87
|
+
paymentPrepared: "Fizetési mód előkészítve.",
|
|
88
|
+
stripeMissingSecret: "A Stripe session még nem adott használható client secretet. Próbáld újra a fizetési mód kiválasztását.",
|
|
89
|
+
simplepayContinue: "Tovább az OTP SimplePayhez",
|
|
90
|
+
orderSubmit: "Megrendelés leadása",
|
|
91
|
+
orderSubmitCod: "Megrendelés utánvéttel",
|
|
92
|
+
orderSubmitting: "Rendelés leadása…",
|
|
93
|
+
legalStatements: "Jogi nyilatkozatok",
|
|
94
|
+
accept: "Elfogadom",
|
|
95
|
+
openDocument: "Dokumentum megnyitása",
|
|
96
|
+
noRequiredLegal: "Nincs kötelező checkout dokumentum.",
|
|
97
|
+
recheckPayment: "Fizetés állapotának újraellenőrzése",
|
|
98
|
+
orderSummary: "Rendelés összesítő",
|
|
99
|
+
checkoutNeedsCart: "A pénztárhoz előbb tegyél terméket a kosárba.",
|
|
100
|
+
legalEyebrow: "Jogi dokumentumok",
|
|
101
|
+
legalTitle: "Aktuális szabályzatok",
|
|
102
|
+
legalDescription: "Mindig a backendben verziózott, aktuális dokumentumok jelennek meg.",
|
|
103
|
+
requiredAtCheckout: "Checkoutnál elfogadás szükséges.",
|
|
104
|
+
infoDocument: "Tájékoztató dokumentum.",
|
|
105
|
+
openPdf: "PDF megnyitása",
|
|
106
|
+
noLegalDocuments: "Nincs publikált jogi dokumentum.",
|
|
107
|
+
accountLoading: "Fiók betöltése…",
|
|
108
|
+
customerAccount: "Ügyfélfiók",
|
|
109
|
+
register: "Regisztráció",
|
|
110
|
+
forgotPassword: "Elfelejtett jelszó",
|
|
111
|
+
login: "Belépés",
|
|
112
|
+
password: "Jelszó",
|
|
113
|
+
processing: "Feldolgozás…",
|
|
114
|
+
createAccount: "Fiók létrehozása",
|
|
115
|
+
requestResetEmail: "Visszaállító e-mail kérése",
|
|
116
|
+
accountBenefits: "Fiók előnyei",
|
|
117
|
+
ordersInOnePlace: "Rendeléseid egy helyen",
|
|
118
|
+
accountBenefitsText: "Mentett címek, rendelési előzmények, jelszó- és e-mail-kezelés, valamint visszaküldés, csere és reklamáció a Core-on keresztül.",
|
|
119
|
+
signedIn: "Bejelentkezve",
|
|
120
|
+
profile: "Profil",
|
|
121
|
+
addresses: "Címek",
|
|
122
|
+
orders: "Rendelések",
|
|
123
|
+
security: "Biztonság",
|
|
124
|
+
logout: "Kijelentkezés",
|
|
125
|
+
personalData: "Személyes adatok",
|
|
126
|
+
saveProfile: "Profil mentése",
|
|
127
|
+
emailVerified: "Megerősítve",
|
|
128
|
+
verificationNeeded: "Megerősítés szükséges",
|
|
129
|
+
verified: "Ellenőrizve",
|
|
130
|
+
pending: "Függőben",
|
|
131
|
+
resendCode: "Kód újraküldése",
|
|
132
|
+
verificationCode: "Megerősítő kód",
|
|
133
|
+
verify: "Megerősítés",
|
|
134
|
+
addressBook: "Címjegyzék",
|
|
135
|
+
savedAddresses: "Mentett címek",
|
|
136
|
+
noSavedAddress: "Még nincs mentett címed.",
|
|
137
|
+
edit: "Szerkesztés",
|
|
138
|
+
newAddress: "Új cím",
|
|
139
|
+
editAddress: "Cím szerkesztése",
|
|
140
|
+
addressName: "Cím neve",
|
|
141
|
+
province: "Megye / régió",
|
|
142
|
+
addAddress: "Cím hozzáadása",
|
|
143
|
+
updateAddress: "Cím frissítése",
|
|
144
|
+
cancel: "Mégse",
|
|
145
|
+
history: "Előzmények",
|
|
146
|
+
myOrders: "Rendeléseim",
|
|
147
|
+
noOrders: "Még nincs rendelésed.",
|
|
148
|
+
changePassword: "Jelszó módosítása",
|
|
149
|
+
currentPassword: "Jelenlegi jelszó",
|
|
150
|
+
newPassword: "Új jelszó",
|
|
151
|
+
changeEmail: "E-mail cím módosítása",
|
|
152
|
+
newEmail: "Új e-mail",
|
|
153
|
+
requestEmailChange: "E-mail módosítás kérése",
|
|
154
|
+
danger: "Veszélyes művelet",
|
|
155
|
+
deleteAccount: "Fiók törlése",
|
|
156
|
+
deleteAccountText: "A törléshez add meg a jelenlegi jelszavad. A rendelési bizonylatok és jogszabály szerint megőrzendő adatok kezelése a backend szabályai szerint történik.",
|
|
157
|
+
deleteAccountConfirm: "Biztosan törlöd a fiókodat?",
|
|
158
|
+
deleteAccountFinal: "Fiók végleges törlése",
|
|
159
|
+
resetSecurity: "Fiók biztonság",
|
|
160
|
+
resetTitle: "Új jelszó beállítása",
|
|
161
|
+
repeatPassword: "Új jelszó újra",
|
|
162
|
+
savePassword: "Jelszó mentése",
|
|
163
|
+
backToLogin: "Vissza a belépéshez",
|
|
164
|
+
loading: "Betöltés…",
|
|
165
|
+
order: "Rendelés",
|
|
166
|
+
backToAccount: "Vissza a fiókhoz",
|
|
167
|
+
orderData: "Rendelési adatok",
|
|
168
|
+
status: "Státusz",
|
|
169
|
+
fulfillment: "Teljesítés",
|
|
170
|
+
shippingAddress: "Szállítási cím",
|
|
171
|
+
tracking: "Csomagkövetés",
|
|
172
|
+
afterSales: "Visszaküldés, csere vagy reklamáció",
|
|
173
|
+
return: "Visszaküldés",
|
|
174
|
+
exchange: "Csere",
|
|
175
|
+
claim: "Reklamáció",
|
|
176
|
+
orderItem: "Rendelési tétel",
|
|
177
|
+
quantity: "Mennyiség",
|
|
178
|
+
reason: "Ok",
|
|
179
|
+
noReason: "Nincs megadva",
|
|
180
|
+
claimType: "Reklamáció típusa",
|
|
181
|
+
refund: "Visszatérítés",
|
|
182
|
+
replacement: "Cserepótlás",
|
|
183
|
+
issueReason: "Hiba oka",
|
|
184
|
+
productionFailure: "Gyártási hiba",
|
|
185
|
+
wrongItem: "Rossz termék",
|
|
186
|
+
missingItem: "Hiányzó termék",
|
|
187
|
+
other: "Egyéb",
|
|
188
|
+
exchangeProduct: "Cseretermék",
|
|
189
|
+
chooseVariant: "Válassz variánst",
|
|
190
|
+
description: "Leírás",
|
|
191
|
+
requestDescriptionPlaceholder: "Írd le röviden a kérést vagy problémát.",
|
|
192
|
+
sendRequest: "Kérelem elküldése",
|
|
193
|
+
sending: "Küldés…",
|
|
194
|
+
previousRequests: "Korábbi kérelmek",
|
|
195
|
+
withdraw: "Visszavonás",
|
|
196
|
+
orderRecorded: "Rendelés rögzítve",
|
|
197
|
+
thankYou: "Köszönjük a rendelésed!",
|
|
198
|
+
orderNumber: "Rendelésszám",
|
|
199
|
+
continueShopping: "Tovább vásárolok",
|
|
200
|
+
orderDetails: "Rendelés részletei",
|
|
201
|
+
summary: "Összesítés",
|
|
202
|
+
codOrder: "Utánvétes rendelés.",
|
|
203
|
+
codText: "A fizetés a kiválasztott szállítási mód szabályai szerint történik átvételkor.",
|
|
204
|
+
bankTransfer: "Banki átutalás",
|
|
205
|
+
transferDetails: "Átutalási adatok",
|
|
206
|
+
bank: "Bank",
|
|
207
|
+
beneficiary: "Kedvezményezett",
|
|
208
|
+
bankAccount: "Bankszámlaszám",
|
|
209
|
+
reference: "Közlemény / hivatkozás",
|
|
210
|
+
paymentDeadline: "Fizetési határidő",
|
|
211
|
+
days: "nap",
|
|
212
|
+
referenceHint: "A közleményt pontosan a fenti formában add meg. A rendelési e-mail ugyanezeket az adatokat tartalmazza.",
|
|
213
|
+
selected: "Kiválasztva",
|
|
214
|
+
} as const
|
|
215
|
+
|
|
216
|
+
type CopyKey = keyof typeof hu
|
|
217
|
+
|
|
218
|
+
const en: Record<CopyKey, string> = {
|
|
219
|
+
products: "Products",
|
|
220
|
+
legalDocuments: "Legal documents",
|
|
221
|
+
account: "My account",
|
|
222
|
+
cart: "Cart",
|
|
223
|
+
close: "Close",
|
|
224
|
+
productCountSuffix: "items",
|
|
225
|
+
homeHeroTitle: "Fast, secure shopping powered by Medusa Core.",
|
|
226
|
+
homeHeroText: "Products, prices, discounts, shipping, payments, and legal rules come directly from the backend's current configuration.",
|
|
227
|
+
homeCoreTitle: "One starter, multiple stores.",
|
|
228
|
+
homeCoreText: "The customer-specific design can change while the checkout, account, legal, SEO, and analytics integration layer remains reusable.",
|
|
229
|
+
categories: "Categories",
|
|
230
|
+
discoverOffer: "Explore the catalog",
|
|
231
|
+
allProducts: "All products →",
|
|
232
|
+
newProducts: "New arrivals",
|
|
233
|
+
latestProducts: "Latest products",
|
|
234
|
+
fullCatalog: "Full catalog →",
|
|
235
|
+
noPublishedProducts: "There are no published products yet.",
|
|
236
|
+
catalog: "Catalog",
|
|
237
|
+
productsTitle: "Products",
|
|
238
|
+
catalogDescription: "Search, categories, and sorting are powered directly by the Medusa Store API.",
|
|
239
|
+
search: "Search",
|
|
240
|
+
searchPlaceholder: "Product name, description…",
|
|
241
|
+
category: "Category",
|
|
242
|
+
allCategories: "All categories",
|
|
243
|
+
sort: "Sort",
|
|
244
|
+
newest: "Newest",
|
|
245
|
+
oldest: "Oldest",
|
|
246
|
+
nameAZ: "Name A–Z",
|
|
247
|
+
filter: "Filter",
|
|
248
|
+
noResults: "No results.",
|
|
249
|
+
modifySearch: "Change the search term or category filter.",
|
|
250
|
+
previous: "← Previous",
|
|
251
|
+
next: "Next →",
|
|
252
|
+
product: "Product",
|
|
253
|
+
noImage: "No image",
|
|
254
|
+
priceOnProductPage: "Price on product page",
|
|
255
|
+
material: "Material",
|
|
256
|
+
origin: "Origin",
|
|
257
|
+
emptyCategory: "There are no published products in this category yet.",
|
|
258
|
+
cartLoading: "Loading cart…",
|
|
259
|
+
emptyCart: "Your cart is empty.",
|
|
260
|
+
chooseProduct: "Choose a product from the catalog.",
|
|
261
|
+
viewProducts: "View products",
|
|
262
|
+
decreaseQuantity: "Decrease quantity",
|
|
263
|
+
increaseQuantity: "Increase quantity",
|
|
264
|
+
remove: "Remove",
|
|
265
|
+
couponCode: "Coupon code",
|
|
266
|
+
redeem: "Apply",
|
|
267
|
+
discount: "Discount",
|
|
268
|
+
subtotal: "Subtotal",
|
|
269
|
+
shipping: "Shipping",
|
|
270
|
+
tax: "Tax",
|
|
271
|
+
total: "Total",
|
|
272
|
+
checkoutContinue: "Continue to checkout",
|
|
273
|
+
checkoutEyebrow: "Checkout",
|
|
274
|
+
checkoutTitle: "Checkout",
|
|
275
|
+
checkoutDescription: "Shipping, payment, totals, and legal requirements are based on the current Core/Medusa state.",
|
|
276
|
+
checkoutLoading: "Loading checkout…",
|
|
277
|
+
contactAndAddress: "Contact and shipping address",
|
|
278
|
+
email: "Email",
|
|
279
|
+
phone: "Phone",
|
|
280
|
+
firstName: "First name",
|
|
281
|
+
lastName: "Last name",
|
|
282
|
+
companyOptional: "Company (optional)",
|
|
283
|
+
country: "Country",
|
|
284
|
+
postalCode: "Postal code",
|
|
285
|
+
city: "City",
|
|
286
|
+
address1: "Street and number",
|
|
287
|
+
address2: "Address line 2",
|
|
288
|
+
saveAddressAndLoadShipping: "Save details and load shipping",
|
|
289
|
+
saving: "Saving…",
|
|
290
|
+
saveAddressSuccess: "Contact and shipping details saved.",
|
|
291
|
+
chooseShippingFirst: "Save your address to load available shipping methods.",
|
|
292
|
+
pickupSearch: "Search pickup points",
|
|
293
|
+
pickupPoint: "Pickup point",
|
|
294
|
+
choosePickupPoint: "Choose a pickup point",
|
|
295
|
+
filterPickupHint: "Enter a city or address to narrow the list.",
|
|
296
|
+
packetaPoint: "Packeta point",
|
|
297
|
+
packetaHint: "Core never exposes secret Packeta credentials in the browser. Provide the point ID returned by the official Packeta widget; a customer-specific design can connect that widget to the same field.",
|
|
298
|
+
pointName: "Point name",
|
|
299
|
+
selectShipping: "Select shipping",
|
|
300
|
+
payment: "Payment",
|
|
301
|
+
chooseShippingForPayments: "Select and save a shipping method to load payment options.",
|
|
302
|
+
paymentPrepared: "Payment method prepared.",
|
|
303
|
+
stripeMissingSecret: "The Stripe session has not returned a usable client secret yet. Select the payment method again.",
|
|
304
|
+
simplepayContinue: "Continue to OTP SimplePay",
|
|
305
|
+
orderSubmit: "Place order",
|
|
306
|
+
orderSubmitCod: "Place cash-on-delivery order",
|
|
307
|
+
orderSubmitting: "Placing order…",
|
|
308
|
+
legalStatements: "Legal agreements",
|
|
309
|
+
accept: "I accept",
|
|
310
|
+
openDocument: "Open document",
|
|
311
|
+
noRequiredLegal: "There are no required checkout documents.",
|
|
312
|
+
recheckPayment: "Check payment status again",
|
|
313
|
+
orderSummary: "Order summary",
|
|
314
|
+
checkoutNeedsCart: "Add a product to your cart before proceeding to checkout.",
|
|
315
|
+
legalEyebrow: "Legal documents",
|
|
316
|
+
legalTitle: "Current policies",
|
|
317
|
+
legalDescription: "The current, versioned documents from the backend are always shown here.",
|
|
318
|
+
requiredAtCheckout: "Acceptance is required at checkout.",
|
|
319
|
+
infoDocument: "Information document.",
|
|
320
|
+
openPdf: "Open PDF",
|
|
321
|
+
noLegalDocuments: "There are no published legal documents.",
|
|
322
|
+
accountLoading: "Loading account…",
|
|
323
|
+
customerAccount: "Customer account",
|
|
324
|
+
register: "Register",
|
|
325
|
+
forgotPassword: "Forgot password",
|
|
326
|
+
login: "Sign in",
|
|
327
|
+
password: "Password",
|
|
328
|
+
processing: "Processing…",
|
|
329
|
+
createAccount: "Create account",
|
|
330
|
+
requestResetEmail: "Request reset email",
|
|
331
|
+
accountBenefits: "Account benefits",
|
|
332
|
+
ordersInOnePlace: "Your orders in one place",
|
|
333
|
+
accountBenefitsText: "Saved addresses, order history, password and email management, returns, exchanges, and claims through Core.",
|
|
334
|
+
signedIn: "Signed in",
|
|
335
|
+
profile: "Profile",
|
|
336
|
+
addresses: "Addresses",
|
|
337
|
+
orders: "Orders",
|
|
338
|
+
security: "Security",
|
|
339
|
+
logout: "Sign out",
|
|
340
|
+
personalData: "Personal details",
|
|
341
|
+
saveProfile: "Save profile",
|
|
342
|
+
emailVerified: "Verified",
|
|
343
|
+
verificationNeeded: "Verification required",
|
|
344
|
+
verified: "Verified",
|
|
345
|
+
pending: "Pending",
|
|
346
|
+
resendCode: "Resend code",
|
|
347
|
+
verificationCode: "Verification code",
|
|
348
|
+
verify: "Verify",
|
|
349
|
+
addressBook: "Address book",
|
|
350
|
+
savedAddresses: "Saved addresses",
|
|
351
|
+
noSavedAddress: "You have no saved addresses yet.",
|
|
352
|
+
edit: "Edit",
|
|
353
|
+
newAddress: "New address",
|
|
354
|
+
editAddress: "Edit address",
|
|
355
|
+
addressName: "Address name",
|
|
356
|
+
province: "State / region",
|
|
357
|
+
addAddress: "Add address",
|
|
358
|
+
updateAddress: "Update address",
|
|
359
|
+
cancel: "Cancel",
|
|
360
|
+
history: "History",
|
|
361
|
+
myOrders: "My orders",
|
|
362
|
+
noOrders: "You have no orders yet.",
|
|
363
|
+
changePassword: "Change password",
|
|
364
|
+
currentPassword: "Current password",
|
|
365
|
+
newPassword: "New password",
|
|
366
|
+
changeEmail: "Change email address",
|
|
367
|
+
newEmail: "New email",
|
|
368
|
+
requestEmailChange: "Request email change",
|
|
369
|
+
danger: "Danger zone",
|
|
370
|
+
deleteAccount: "Delete account",
|
|
371
|
+
deleteAccountText: "Enter your current password to delete the account. Invoices and data that must be retained by law are handled according to backend policies.",
|
|
372
|
+
deleteAccountConfirm: "Are you sure you want to delete your account?",
|
|
373
|
+
deleteAccountFinal: "Delete account permanently",
|
|
374
|
+
resetSecurity: "Account security",
|
|
375
|
+
resetTitle: "Set a new password",
|
|
376
|
+
repeatPassword: "Repeat new password",
|
|
377
|
+
savePassword: "Save password",
|
|
378
|
+
backToLogin: "Back to sign in",
|
|
379
|
+
loading: "Loading…",
|
|
380
|
+
order: "Order",
|
|
381
|
+
backToAccount: "Back to account",
|
|
382
|
+
orderData: "Order details",
|
|
383
|
+
status: "Status",
|
|
384
|
+
fulfillment: "Fulfillment",
|
|
385
|
+
shippingAddress: "Shipping address",
|
|
386
|
+
tracking: "Track shipment",
|
|
387
|
+
afterSales: "Return, exchange, or claim",
|
|
388
|
+
return: "Return",
|
|
389
|
+
exchange: "Exchange",
|
|
390
|
+
claim: "Claim",
|
|
391
|
+
orderItem: "Order item",
|
|
392
|
+
quantity: "Quantity",
|
|
393
|
+
reason: "Reason",
|
|
394
|
+
noReason: "Not specified",
|
|
395
|
+
claimType: "Claim type",
|
|
396
|
+
refund: "Refund",
|
|
397
|
+
replacement: "Replacement",
|
|
398
|
+
issueReason: "Issue reason",
|
|
399
|
+
productionFailure: "Manufacturing defect",
|
|
400
|
+
wrongItem: "Wrong item",
|
|
401
|
+
missingItem: "Missing item",
|
|
402
|
+
other: "Other",
|
|
403
|
+
exchangeProduct: "Replacement product",
|
|
404
|
+
chooseVariant: "Choose a variant",
|
|
405
|
+
description: "Description",
|
|
406
|
+
requestDescriptionPlaceholder: "Briefly describe your request or issue.",
|
|
407
|
+
sendRequest: "Send request",
|
|
408
|
+
sending: "Sending…",
|
|
409
|
+
previousRequests: "Previous requests",
|
|
410
|
+
withdraw: "Withdraw",
|
|
411
|
+
orderRecorded: "Order received",
|
|
412
|
+
thankYou: "Thank you for your order!",
|
|
413
|
+
orderNumber: "Order number",
|
|
414
|
+
continueShopping: "Continue shopping",
|
|
415
|
+
orderDetails: "Order details",
|
|
416
|
+
summary: "Summary",
|
|
417
|
+
codOrder: "Cash-on-delivery order.",
|
|
418
|
+
codText: "Payment is made on delivery according to the selected shipping method's rules.",
|
|
419
|
+
bankTransfer: "Bank transfer",
|
|
420
|
+
transferDetails: "Transfer details",
|
|
421
|
+
bank: "Bank",
|
|
422
|
+
beneficiary: "Beneficiary",
|
|
423
|
+
bankAccount: "Bank account",
|
|
424
|
+
reference: "Reference",
|
|
425
|
+
paymentDeadline: "Payment deadline",
|
|
426
|
+
days: "days",
|
|
427
|
+
referenceHint: "Use the reference exactly as shown above. The order email contains the same payment details.",
|
|
428
|
+
selected: "Selected",
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export type StorefrontCopy = typeof hu
|
|
432
|
+
|
|
433
|
+
export function storefrontCopy(locale: StorefrontLocale): StorefrontCopy {
|
|
434
|
+
return (locale === "en" ? en : hu) as StorefrontCopy
|
|
435
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { headers } from "next/headers"
|
|
2
|
+
import { storefrontLocale, type StorefrontLocale } from "./storefront-routes"
|
|
3
|
+
|
|
4
|
+
const LOCALE_HEADER = "x-hszrdm-storefront-locale"
|
|
5
|
+
|
|
6
|
+
export async function requestStorefrontLocale(
|
|
7
|
+
fallback: StorefrontLocale = "hu",
|
|
8
|
+
): Promise<StorefrontLocale> {
|
|
9
|
+
const requestHeaders = await headers()
|
|
10
|
+
return storefrontLocale(requestHeaders.get(LOCALE_HEADER), fallback)
|
|
11
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export const STOREFRONT_ROUTES = {
|
|
2
|
+
hu: {
|
|
3
|
+
medusaLocale: "hu-HU",
|
|
4
|
+
home: "/hu",
|
|
5
|
+
products: "/hu/termekek",
|
|
6
|
+
categories: "/hu/kategoriak",
|
|
7
|
+
cart: "/hu/kosar",
|
|
8
|
+
checkout: "/hu/penztar",
|
|
9
|
+
checkoutSuccess: "/hu/penztar/sikeres-rendeles",
|
|
10
|
+
account: "/hu/fiokom",
|
|
11
|
+
orders: "/hu/fiokom/rendelesek",
|
|
12
|
+
resetPassword: "/hu/jelszo-visszaallitas",
|
|
13
|
+
legal: "/hu/jogi",
|
|
14
|
+
},
|
|
15
|
+
en: {
|
|
16
|
+
medusaLocale: "en-US",
|
|
17
|
+
home: "/en",
|
|
18
|
+
products: "/en/products",
|
|
19
|
+
categories: "/en/categories",
|
|
20
|
+
cart: "/en/cart",
|
|
21
|
+
checkout: "/en/checkout",
|
|
22
|
+
checkoutSuccess: "/en/checkout/success",
|
|
23
|
+
account: "/en/account",
|
|
24
|
+
orders: "/en/account/orders",
|
|
25
|
+
resetPassword: "/en/reset-password",
|
|
26
|
+
legal: "/en/legal",
|
|
27
|
+
},
|
|
28
|
+
} as const
|
|
29
|
+
|
|
30
|
+
export type StorefrontLocale = keyof typeof STOREFRONT_ROUTES
|
|
31
|
+
|
|
32
|
+
export function storefrontLocale(value: unknown, fallback: StorefrontLocale = "hu"): StorefrontLocale {
|
|
33
|
+
const normalized = String(value || "").trim().toLowerCase()
|
|
34
|
+
if (normalized === "en" || normalized.startsWith("en-")) return "en"
|
|
35
|
+
if (normalized === "hu" || normalized.startsWith("hu-")) return "hu"
|
|
36
|
+
return fallback
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function localeFromPathname(pathname: string, fallback: StorefrontLocale = "hu") {
|
|
40
|
+
const first = pathname.split("/").filter(Boolean)[0]
|
|
41
|
+
return storefrontLocale(first, fallback)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function medusaLocale(locale: StorefrontLocale) {
|
|
45
|
+
return STOREFRONT_ROUTES[locale].medusaLocale
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function productPath(locale: StorefrontLocale, handle: string) {
|
|
49
|
+
return `${STOREFRONT_ROUTES[locale].products}/${encodeURIComponent(handle)}`
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function categoryPath(locale: StorefrontLocale, handle: string) {
|
|
53
|
+
return `${STOREFRONT_ROUTES[locale].categories}/${encodeURIComponent(handle)}`
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function orderPath(locale: StorefrontLocale, orderId: string) {
|
|
57
|
+
return `${STOREFRONT_ROUTES[locale].orders}/${encodeURIComponent(orderId)}`
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function equivalentLocalePath(
|
|
61
|
+
pathname: string,
|
|
62
|
+
targetLocale: StorefrontLocale,
|
|
63
|
+
) {
|
|
64
|
+
const sourceLocale = localeFromPathname(pathname)
|
|
65
|
+
if (sourceLocale === targetLocale) return pathname
|
|
66
|
+
|
|
67
|
+
const source = STOREFRONT_ROUTES[sourceLocale]
|
|
68
|
+
const target = STOREFRONT_ROUTES[targetLocale]
|
|
69
|
+
|
|
70
|
+
if (pathname === source.home) return target.home
|
|
71
|
+
if (pathname === source.products) return target.products
|
|
72
|
+
if (pathname.startsWith(`${source.products}/`)) {
|
|
73
|
+
return `${target.products}/${pathname.slice(source.products.length + 1)}`
|
|
74
|
+
}
|
|
75
|
+
if (pathname === source.categories) return target.categories
|
|
76
|
+
if (pathname.startsWith(`${source.categories}/`)) {
|
|
77
|
+
return `${target.categories}/${pathname.slice(source.categories.length + 1)}`
|
|
78
|
+
}
|
|
79
|
+
if (pathname === source.cart) return target.cart
|
|
80
|
+
if (pathname === source.checkout) return target.checkout
|
|
81
|
+
if (pathname === source.checkoutSuccess) return target.checkoutSuccess
|
|
82
|
+
if (pathname === source.account) return target.account
|
|
83
|
+
if (pathname === source.orders) return target.orders
|
|
84
|
+
if (pathname.startsWith(`${source.orders}/`)) {
|
|
85
|
+
return `${target.orders}/${pathname.slice(source.orders.length + 1)}`
|
|
86
|
+
}
|
|
87
|
+
if (pathname === source.resetPassword) return target.resetPassword
|
|
88
|
+
if (pathname === source.legal) return target.legal
|
|
89
|
+
|
|
90
|
+
return target.home
|
|
91
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from "next/server"
|
|
2
|
+
import {
|
|
3
|
+
STOREFRONT_ROUTES,
|
|
4
|
+
localeFromPathname,
|
|
5
|
+
type StorefrontLocale,
|
|
6
|
+
} from "./lib/storefront-routes"
|
|
7
|
+
|
|
8
|
+
const LOCALE_COOKIE = "hszrdm_storefront_locale"
|
|
9
|
+
const LOCALE_HEADER = "x-hszrdm-storefront-locale"
|
|
10
|
+
|
|
11
|
+
export function proxy(request: NextRequest) {
|
|
12
|
+
const pathname = request.nextUrl.pathname
|
|
13
|
+
|
|
14
|
+
if (isInfrastructurePath(pathname)) {
|
|
15
|
+
return NextResponse.next()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const cookieLocale = normalizeCookieLocale(request.cookies.get(LOCALE_COOKIE)?.value)
|
|
19
|
+
const pathLocale = /^\/(hu|en)(?:\/|$)/.test(pathname)
|
|
20
|
+
? localeFromPathname(pathname)
|
|
21
|
+
: null
|
|
22
|
+
const locale = pathLocale || cookieLocale || "hu"
|
|
23
|
+
|
|
24
|
+
const redirectPath = legacyRedirect(pathname, locale)
|
|
25
|
+
if (redirectPath) {
|
|
26
|
+
const target = request.nextUrl.clone()
|
|
27
|
+
target.pathname = redirectPath
|
|
28
|
+
const response = NextResponse.redirect(target, 308)
|
|
29
|
+
response.cookies.set(LOCALE_COOKIE, locale, cookieOptions())
|
|
30
|
+
return response
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const internalPath = internalRewrite(pathname, locale)
|
|
34
|
+
const requestHeaders = new Headers(request.headers)
|
|
35
|
+
requestHeaders.set(LOCALE_HEADER, locale)
|
|
36
|
+
|
|
37
|
+
const response = internalPath
|
|
38
|
+
? NextResponse.rewrite(withPath(request, internalPath), {
|
|
39
|
+
request: { headers: requestHeaders },
|
|
40
|
+
})
|
|
41
|
+
: NextResponse.next({ request: { headers: requestHeaders } })
|
|
42
|
+
|
|
43
|
+
response.cookies.set(LOCALE_COOKIE, locale, cookieOptions())
|
|
44
|
+
return response
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const config = {
|
|
48
|
+
matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function legacyRedirect(pathname: string, locale: StorefrontLocale) {
|
|
52
|
+
if (pathname === "/") return STOREFRONT_ROUTES[locale].home
|
|
53
|
+
|
|
54
|
+
if (pathname === "/cart") return STOREFRONT_ROUTES[locale].cart
|
|
55
|
+
if (pathname === "/checkout") return STOREFRONT_ROUTES[locale].checkout
|
|
56
|
+
if (pathname === "/checkout/success") return STOREFRONT_ROUTES[locale].checkoutSuccess
|
|
57
|
+
if (pathname === "/account") return STOREFRONT_ROUTES[locale].account
|
|
58
|
+
if (pathname.startsWith("/account/orders/")) {
|
|
59
|
+
return `${STOREFRONT_ROUTES[locale].orders}/${pathname.slice("/account/orders/".length)}`
|
|
60
|
+
}
|
|
61
|
+
if (pathname === "/reset-password") return STOREFRONT_ROUTES[locale].resetPassword
|
|
62
|
+
if (pathname === "/legal") return STOREFRONT_ROUTES[locale].legal
|
|
63
|
+
|
|
64
|
+
if (pathname === "/hu/products") return STOREFRONT_ROUTES.hu.products
|
|
65
|
+
if (pathname.startsWith("/hu/products/")) {
|
|
66
|
+
return `${STOREFRONT_ROUTES.hu.products}/${pathname.slice("/hu/products/".length)}`
|
|
67
|
+
}
|
|
68
|
+
if (pathname === "/hu/categories") return STOREFRONT_ROUTES.hu.categories
|
|
69
|
+
if (pathname.startsWith("/hu/categories/")) {
|
|
70
|
+
return `${STOREFRONT_ROUTES.hu.categories}/${pathname.slice("/hu/categories/".length)}`
|
|
71
|
+
}
|
|
72
|
+
if (pathname === "/hu/cart") return STOREFRONT_ROUTES.hu.cart
|
|
73
|
+
if (pathname === "/hu/checkout") return STOREFRONT_ROUTES.hu.checkout
|
|
74
|
+
if (pathname === "/hu/checkout/success") return STOREFRONT_ROUTES.hu.checkoutSuccess
|
|
75
|
+
if (pathname === "/hu/account") return STOREFRONT_ROUTES.hu.account
|
|
76
|
+
if (pathname.startsWith("/hu/account/orders/")) {
|
|
77
|
+
return `${STOREFRONT_ROUTES.hu.orders}/${pathname.slice("/hu/account/orders/".length)}`
|
|
78
|
+
}
|
|
79
|
+
if (pathname === "/hu/reset-password") return STOREFRONT_ROUTES.hu.resetPassword
|
|
80
|
+
if (pathname === "/hu/legal") return STOREFRONT_ROUTES.hu.legal
|
|
81
|
+
|
|
82
|
+
return null
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function internalRewrite(pathname: string, locale: StorefrontLocale) {
|
|
86
|
+
const routes = STOREFRONT_ROUTES[locale]
|
|
87
|
+
|
|
88
|
+
if (pathname === routes.home) return "/"
|
|
89
|
+
|
|
90
|
+
if (locale === "hu") {
|
|
91
|
+
if (pathname === routes.products) return "/hu/products"
|
|
92
|
+
if (pathname.startsWith(`${routes.products}/`)) {
|
|
93
|
+
return `/hu/products/${pathname.slice(routes.products.length + 1)}`
|
|
94
|
+
}
|
|
95
|
+
if (pathname === routes.categories) return "/hu/categories"
|
|
96
|
+
if (pathname.startsWith(`${routes.categories}/`)) {
|
|
97
|
+
return `/hu/categories/${pathname.slice(routes.categories.length + 1)}`
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (pathname === routes.cart) return "/cart"
|
|
102
|
+
if (pathname === routes.checkout) return "/checkout"
|
|
103
|
+
if (pathname === routes.checkoutSuccess) return "/checkout/success"
|
|
104
|
+
if (pathname === routes.account) return "/account"
|
|
105
|
+
if (pathname.startsWith(`${routes.orders}/`)) {
|
|
106
|
+
return `/account/orders/${pathname.slice(routes.orders.length + 1)}`
|
|
107
|
+
}
|
|
108
|
+
if (pathname === routes.resetPassword) return "/reset-password"
|
|
109
|
+
if (pathname === routes.legal) return "/legal"
|
|
110
|
+
|
|
111
|
+
return null
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function withPath(request: NextRequest, pathname: string) {
|
|
115
|
+
const target = request.nextUrl.clone()
|
|
116
|
+
target.pathname = pathname
|
|
117
|
+
return target
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function normalizeCookieLocale(value: string | undefined): StorefrontLocale | null {
|
|
121
|
+
return value === "hu" || value === "en" ? value : null
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function cookieOptions() {
|
|
125
|
+
return {
|
|
126
|
+
path: "/",
|
|
127
|
+
sameSite: "lax" as const,
|
|
128
|
+
httpOnly: false,
|
|
129
|
+
secure: process.env.NODE_ENV === "production",
|
|
130
|
+
maxAge: 60 * 60 * 24 * 365,
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function isInfrastructurePath(pathname: string) {
|
|
135
|
+
return (
|
|
136
|
+
pathname === "/robots.txt" ||
|
|
137
|
+
pathname === "/sitemap.xml" ||
|
|
138
|
+
pathname.startsWith("/sitemap.xml/") ||
|
|
139
|
+
pathname.startsWith("/api/") ||
|
|
140
|
+
pathname.startsWith("/static/")
|
|
141
|
+
)
|
|
142
|
+
}
|