33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
import type { Language } from '@/domain/language/entities';
|
|
import { getTranslation, type TranslationBundle } from '@/presentation/i18n/translations';
|
|
import type { CartInquiryCopy } from '@/application/messaging/whatsapp-message-builder';
|
|
|
|
/** WhatsApp inquiries are sent in Swedish or English only — never other UI languages. */
|
|
export type WhatsAppInquiryLanguage = 'sv' | 'en';
|
|
|
|
export function getWhatsAppInquiryLanguage(language: Language): WhatsAppInquiryLanguage {
|
|
return language === 'sv' ? 'sv' : 'en';
|
|
}
|
|
|
|
export function getWhatsAppInquiryTranslation(language: Language): TranslationBundle {
|
|
return getTranslation(getWhatsAppInquiryLanguage(language));
|
|
}
|
|
|
|
export function buildCartInquiryCopy(t: TranslationBundle): CartInquiryCopy {
|
|
return {
|
|
pickupIntro: t.cartDrawer.inquiryPickupIntro,
|
|
deliveryIntro: t.cartDrawer.inquiryDeliveryIntro,
|
|
messageTotal: t.cartDrawer.messageTotal,
|
|
messageName: t.cartDrawer.messageName,
|
|
messageEmail: t.cartDrawer.messageEmail,
|
|
messageBranch: t.cartDrawer.messageBranch,
|
|
branchAskim: t.cartDrawer.branchAskim,
|
|
branchBackaplan: t.cartDrawer.branchBackaplan,
|
|
messageAddress: t.cartDrawer.messageAddress,
|
|
messagePreferredDate: t.cartDrawer.messagePreferredDate,
|
|
messagePreferredTime: t.cartDrawer.messagePreferredTime,
|
|
scheduleDateToday: t.cartDrawer.dateToday,
|
|
scheduleDateTomorrow: t.cartDrawer.dateTomorrow,
|
|
deliverySwishNote: t.cartDrawer.deliverySwishNote,
|
|
};
|
|
} |