Replace entire repo content with code from /root/shahikitchen-google/
This commit is contained in:
@@ -70,7 +70,25 @@ const LOCALIZED: Partial<Record<Language, Record<string, string>>> = {
|
||||
}
|
||||
};
|
||||
|
||||
const INCLUSION_CATEGORIES = new Set(['meat', 'chicken', 'vegetarian']);
|
||||
|
||||
const DISH_INCLUSION_NOTE_EN = '1x Naan or Rice included';
|
||||
|
||||
const DISH_INCLUSION_NOTE_LOCALIZED: Partial<Record<Language, string>> = {
|
||||
sv: '1x Naan eller ris ingår',
|
||||
ar: '1x نان أو أرز مشمول',
|
||||
tr: '1x Naan veya pilav dahil',
|
||||
hi: '1x नान या चावल शामिल',
|
||||
ur: '1x نان یا چاول شامل',
|
||||
};
|
||||
|
||||
export function getCategoryName(lang: Language, categoryId: string, fallback: string): string {
|
||||
if (lang === 'en') return EN[categoryId] ?? fallback;
|
||||
return LOCALIZED[lang]?.[categoryId] ?? EN[categoryId] ?? fallback;
|
||||
}
|
||||
|
||||
export function getMenuItemInclusionNote(lang: Language, categoryId: string): string | undefined {
|
||||
if (!INCLUSION_CATEGORIES.has(categoryId)) return undefined;
|
||||
if (lang === 'en') return DISH_INCLUSION_NOTE_EN;
|
||||
return DISH_INCLUSION_NOTE_LOCALIZED[lang] ?? DISH_INCLUSION_NOTE_EN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user