THAI: Added v3 support banner from sheet

This commit is contained in:
Kenta420 2025-04-09 10:39:43 +07:00
parent 1ce7b3239c
commit 69360a7519
3 changed files with 360 additions and 280 deletions

View file

@ -153,15 +153,16 @@
000117 Perfect [(100%)###Font=KanitLight,Size=13] พอดี [(100%)###Font=KanitLight,Size=13] 原味 Perfect အချိုပုံမှန်
000118 Extra [(120%)###Font=KanitLight,Size=13] จึ้ง [(120%)###Font=KanitLight,Size=13] 非常甜 Extra အချိုများ
000119 Sweetest [(140%)###Font=KanitLight,Size=13] สุขิต [(140%)###Font=KanitLight,Size=13] 超级甜 Sweetest အချိုဆုံး
000120 1 Shot 1 ช็อต 单份浓缩
000121 2 Shot [(+15฿)###Font=KanitLight,Size=13] 2 ช็อต [(+15฿)###Font=KanitLight,Size=13] 双份浓缩
000122 3 Shot [(+25฿)###Font=KanitLight,Size=13] 3 ช็อต [(+25฿)###Font=KanitLight,Size=13] 三份浓缩
000123 Cocoa X2 โกโก้ X2 可可 X2
000124 Cocoa X3 โกโก้ X3 可可 X3
000125 Cocoa X10 โกโก้ X10 可可 X10
000120 1 Shot 1 ช็อต 单份浓缩
000121 2 Shot [(+15฿)###Font=KanitLight,Size=13] 2 ช็อต [(+15฿)###Font=KanitLight,Size=13] 双份浓缩
000122 3 Shot [(+25฿)###Font=KanitLight,Size=13] 3 ช็อต [(+25฿)###Font=KanitLight,Size=13] 三份浓缩
000123 Cocoa X2 โกโก้ X2 可可 X2
000124 Cocoa X3 โกโก้ X3 可可 X3
000125 Cocoa X10 โกโก้ X10 可可 X10
000126 Light Milk ไลท์ 低脂牛奶 နို့နည်း
000127 Normal ปกติ 全脂牛奶 ပုံမှန်
000128 Rich ข้นมัน 甜炼乳 နို့ပြည့်
000128 Rich ข้นมัน 甜炼乳 နို့ပြည့်
000129 Ovaltine X2 โอวัลติน X2 阿华田 X2 Ovaltine X2
000130 Ovaltine X3 โอวัลติน X3 阿华田 X3 Ovaltine X3
000131 Ovaltine X10 โอวัลติน X10 阿华田 X10 Ovaltine X10
@ -214,17 +215,25 @@
Font=Montserrat,Type=Bold,Size=64,Color=0x513C2F,Align=Center Font=Kanit,Type=Light,Size=64,Color=0x513C2F,Align=Center Font=Kanit,Type=Medium,Size=64,Color=0x513C2F,Align=Center Font=Montserrat,Type=Bold,Size=64,Color=0x513C2F,Align=Center Font=Montserrat,Type=Bold,Size=64,Color=0x513C2F,Align=Center Font=Montserrat,Type=Bold,Size=64,Color=0x513C2F,Align=Center
001201 blended fruit ผลไม้ปั่น
001201 blended fruit ผลไม้ปั่น blended fruit blended fruit blended fruit
Font=Montserrat,Type=Bold,Size=64,Color=0xFFFFFF,Align=Center Font=Kanit,Type=Light,Size=64,Color=0xFFFFFF,Align=Center Font=Kanit,Type=Medium,Size=64,Color=0x513C2F,Align=Center Font=Montserrat,Type=Bold,Size=64,Color=0x513C2F,Align=Center Font=Montserrat,Type=Bold,Size=64,Color=0x513C2F,Align=Center Font=Montserrat,Type=Bold,Size=64,Color=0x513C2F,Align=Center
001202 Press to open the door กดเพื่อเปิดประตู
001203 Checking Cup ตรวจสอบแก้ว
001202 Press to open the door กดเพื่อเปิดประตู
001203 Checking Cup ตรวจสอบแก้ว
001204 Insert cup ใส่แก้วไว้ที่ฐานแก้ว
001205 Closing the door กำลังปิดประตู
001206 Blend now ดำเนินการปั่นผลไม้
Font=Kanit,Type=Regular,Size=36,Color=0xFFFFFF,Align=Center Font=Kanit,Type=Regular,Size=36,Color=0xFFFFFF,Align=Center Font=Kanit,Type=Regular,Size=36,Color=0x746253,Align=Center Font=Kanit,Type=Regular,Size=36,Color=0x746253,Align=Center Font=Kanit,Type=Regular,Size=36,Color=0x746254,Align=Center
Font=Kanit,Type=Regular,Size=36,Color=0xFFFFFF,Align=Center Font=Kanit,Type=Regular,Size=36,Color=0xFFFFFF,Align=Center Font=Kanit,Type=Regular,Size=36,Color=0xFFFFFF,Align=Center Font=Kanit,Type=Regular,Size=36,Color=0xFFFFFF,Align=Center Font=Kanit,Type=Regular,Size=36,Color=0xFFFFFF,Align=Center
001204 Cancel ยกเลิก 取消 Cancel ပယ်ပါ
001210 Cancel ยกเลิก 取消 Cancel ပယ်ပါ
Font=Roboto,Type=Regular,Size=48,Color=0x513C2F Font=Roboto,Type=Regular,Size=48,Color=0x513C2F Font=Roboto,Type=Regular,Size=48,Color=0x513C2F Font=Roboto,Type=Regular,Size=48,Color=0x513C2F Font=Roboto,Type=Regular,Size=48,Color=0x513C2F
001501 We serve hot drinks in a heat resistant\n2-layer paper cup. We serve cold drinks in\na food grade plastic cup. เต่าบินเสิร์ฟเครื่องดื่มร้อน ด้วยแก้วกระดาษ 2 ชั้น\nกันความร้อน และ เครื่องดื่มเย็นในแก้วพลาสติกมาตรฐาน 我们用耐热双层纸杯装热饮,食品级塑胶杯装冷饮。 We serve hot drinks in a heat resistant\n2-layer paper cup. We serve cold drinks in\na food grade plastic cup. အပူဒဏ်ခံနိုင်သော\n၂လွှာ စက္ကူခွက်ဖြင့် ရေနွေးပူပူများကို ကျွေးပါသည်။ အအေးများကို \na အစားအသောက်တန်း ပလတ်စတစ်ခွက်ဖြင့် ကျွေးပါသည်။
001502 We care about our coffee and only use the\nbest quality Arabica beans เราคัดสรรเมล็ดกาแฟคุณภาพสูงที่สุด และใช้เมล็ดกาแฟอาราบิก้า 100% 我们注重咖啡品质,仅使用顶级阿拉比卡咖啡豆。 We care about our coffee and only use the\nbest quality Arabica beans ကျွန်ုပ်တို့သည် ကျွန်ုပ်တို့၏ကော်ဖီကို ဂရုစိုက်ပြီး အရည်အသွေးအကောင်းဆုံး အာရေဗီကာစေ့များကိုသာ အသုံးပြုပါသည်။
@ -312,6 +321,7 @@
Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18 Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18 Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18 Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18 Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18
Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18 Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18 Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18 Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18 Font=Kanit,Type=Regular,Size=16,Color=0x513C2F,LineHeight=18
002070 Not sweet ไม่หวาน 无糖 Not sweet မချိုဘူး။
002070 Not sweet ไม่หวาน 无糖 Not sweet မချိုဘူး။
002071 Little จุบจิบ 少糖 Little အချိုပေါ့
002072 Less น้อย 微糖 Less အချိုနည်း
002073 Perfect พอดี 原味 Perfect အချိုပုံမှန်

Can't render this file because it has a wrong number of fields in line 156.

View file

@ -310,6 +310,33 @@
out_xml('\t\t</EventOnClick>\n')
out_xml('\t\t</Menu>\n\n')
def GenBanner(type, thai_media, eng_media, event_on_click_script, start_date_time, end_date_time, state_var):
str_con = []
if re.match(r'(\d{4})/(\d{2})/(\d{2})T(\d{2}):(\d{2}):(\d{2})', start_date_time.strip()):
str_con.append(f'DateTimeStart="{start_date_time.strip()}"')
if re.match(r'(\d{4})/(\d{2})/(\d{2})T(\d{2}):(\d{2}):(\d{2})', end_date_time.strip()):
str_con.append(f'DateTimeEnd="{end_date_time.strip()}"')
if re.match(r'^\w.*', state_var.strip()):
str_con.append(f'Var={state_var.strip()},')
out_xml('\t\t<Banner>\n')
out_xml('\t\t\t<State> Flag( '+ ",".join(str_con) + ' ) </State>\n')
out_xml('\t\t\t<Type> ' + type + ' </Type>\n')
out_xml('\t\t\t<Media>\n')
out_xml('\t\t\t\teval(\n')
out_xml('\t\t\t\t\tIf show_eng = "true" Then\n')
out_xml('\t\t\t\t\t\tVar return = ' + eng_media + '\n')
out_xml('\t\t\t\t\tElse\n')
out_xml('\t\t\t\t\t\tVar return = ' + thai_media + '\n')
out_xml('\t\t\t\t\tEndIf\n')
out_xml('\t\t\t\t)\n')
out_xml('\t\t\t</Media>\n')
out_xml('\t\t\t<EventOnClick>\n')
out_xml('\t\t\t\t' + event_on_click_script.replace('\\n', '\n').replace('\\t', '\t') + '\n')
out_xml('\t\t\t</EventOnClick>\n')
out_xml('\t\t</Banner>\n')
idx_lang_myanmar = 6
idx_lang_malay = 5
idx_lang_japan = 4
@ -409,26 +436,38 @@
out_xml( '\t;' + spl[0] + '\r\n')
continue
[hot_pd_v1, hot_pd_v2] = spl[ idx_name][ idx_hot_product_code].split(',')
[cold_pd_v1, cold_pd_v2] = spl[ idx_name][ idx_cold_product_code].split(',')
[blend_pd_v1, blend_pd_v2] = spl[ idx_name][ idx_blend_product_code].split(',')
if spl[idx_desc][idx_lang_eng].startswith("BANNER"):
date_time_start = spl[idx_name][idx_date_time_start]
date_time_end = spl[idx_name][idx_date_time_end]
state_var = spl[idx_name][idx_product_var]
date_time_start = spl[idx_name][idx_date_time_start]
date_time_end = spl[idx_name][idx_date_time_end]
product_var = spl[idx_name][idx_product_var]
try:
default_topping = spl[idx_name][idx_of_default_toppimg]
except:
default_topping = "0"
print(f"spl[{idx_name}] =", spl[idx_name])
print(f"Expected indices: date_time_start:{date_time_start}, date_time_end:{date_time_end}, product_var:{product_var} , default_topping={default_topping}")
type = spl[idx_desc][idx_lang_thai]
eng_media = spl[idx_img][idx_lang_eng]
thai_media = spl[idx_img][idx_lang_thai]
on_click_script = spl[idx_name][idx_lang_thai]
for [hot_pd, cold_pd, blend_pd] in [[hot_pd_v1, cold_pd_v1, blend_pd_v1], [hot_pd_v2, cold_pd_v2, blend_pd_v2]]:
if hot_pd == '-' and cold_pd == '-' and blend_pd == '-':
continue
else:
print(f"Gen ==> hot={hot_pd}, cold={cold_pd}, blend={blend_pd}")
GenMenuV3(hot_pd, cold_pd, blend_pd, date_time_start, date_time_end, product_var, default_topping)
GenBanner(type, thai_media, eng_media, on_click_script, date_time_start, date_time_end, state_var)
else:
[hot_pd_v1, hot_pd_v2] = spl[ idx_name][ idx_hot_product_code].split(',')
[cold_pd_v1, cold_pd_v2] = spl[ idx_name][ idx_cold_product_code].split(',')
[blend_pd_v1, blend_pd_v2] = spl[ idx_name][ idx_blend_product_code].split(',')
date_time_start = spl[idx_name][idx_date_time_start]
date_time_end = spl[idx_name][idx_date_time_end]
product_var = spl[idx_name][idx_product_var]
try:
default_topping = spl[idx_name][idx_of_default_toppimg]
except:
default_topping = "0"
print(f"spl[{idx_name}] =", spl[idx_name])
print(f"Expected indices: date_time_start:{date_time_start}, date_time_end:{date_time_end}, product_var:{product_var} , default_topping={default_topping}")
for [hot_pd, cold_pd, blend_pd] in [[hot_pd_v1, cold_pd_v1, blend_pd_v1], [hot_pd_v2, cold_pd_v2, blend_pd_v2]]:
if hot_pd == '-' and cold_pd == '-' and blend_pd == '-':
continue
else:
print(f"Gen ==> hot={hot_pd}, cold={cold_pd}, blend={blend_pd}")
GenMenuV3(hot_pd, cold_pd, blend_pd, date_time_start, date_time_end, product_var, default_topping)
out_xml('\t\t</Menus>\n\n')
out_xml('</ScrollableCatalog>\n')