/** * The few words the storefront's built-in pages need, in each store language. * Section text comes from the store plan; this is only for pages we build ourselves. */ const words = { en: { shop: 'Shop', allProducts: 'All products', viewAll: 'View all', soldOut: 'Sold out', inStock: 'In stock', addToCart: 'Add to cart', cartSoon: 'Buying is not switched on yet.', backToShop: 'Back to shop', noProducts: 'No products yet. Please check back soon.', productCount: (count: number) => count === 1 ? '1 product' : `${count} products`, }, ms: { shop: 'Kedai', allProducts: 'Semua produk', viewAll: 'Lihat semua', soldOut: 'Habis dijual', inStock: 'Ada stok', addToCart: 'Tambah ke troli', cartSoon: 'Pembelian belum dibuka lagi.', backToShop: 'Kembali ke kedai', noProducts: 'Belum ada produk. Sila datang semula nanti.', productCount: (count: number) => `${count} produk`, }, }; export type StorefrontWords = (typeof words)['en']; export function storefrontText(language: string): StorefrontWords { return language === 'ms' ? words.ms : words.en; }