THAI: Added v3 support banner from sheet
This commit is contained in:
parent
1ce7b3239c
commit
69360a7519
3 changed files with 360 additions and 280 deletions
|
|
@ -162,6 +162,7 @@
|
|||
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,13 +215,21 @@
|
|||
|
||||
|
||||
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 ตรวจสอบแก้ว
|
||||
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 ပယ်ပါ
|
||||
|
||||
|
||||
|
||||
|
|
@ -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.
|
|
|
@ -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,6 +436,18 @@
|
|||
out_xml( '\t;' + spl[0] + '\r\n')
|
||||
continue
|
||||
|
||||
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]
|
||||
|
||||
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]
|
||||
|
||||
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(',')
|
||||
|
|
|
|||
|
|
@ -496,6 +496,33 @@
|
|||
out_xml('\t\t</EventOnClick>\n')
|
||||
out_xml('\t\t</Menu>\n\n')
|
||||
|
||||
def GenBanner(spl):
|
||||
|
||||
if re.match(r'(\d{4})/(\d{2})/(\d{2})T(\d{2}):(\d{2}):(\d{2})', spl[12].strip()):
|
||||
str_con += f'DateTimeStart="{spl[12].strip()}",'
|
||||
if re.match(r'(\d{4})/(\d{2})/(\d{2})T(\d{2}):(\d{2}):(\d{2})', spl[13].strip()):
|
||||
str_con += f'DateTimeEnd="{spl[13].strip()}",'
|
||||
|
||||
if re.match(r'^\w.*', spl[14].strip()):
|
||||
str_con += f'Var={spl[14].strip()},'
|
||||
|
||||
out_xml('\t\t<Banner>\n')
|
||||
out_xml('\t\t\t<State> Flag( '+ str_con + ') </State>\n')
|
||||
out_xml('\t\t\t<Type> ' + spl[4] + '</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')
|
||||
out_xml('\t\t\t\t\t\tVar return = ' + spl[5] + '\n')
|
||||
out_xml('\t\t\t\t\tElse\n')
|
||||
out_xml('\t\t\t\t\t\tVar return = ' + spl[6] + '\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' + spl[7] + '\n')
|
||||
out_xml('\t\t\t</EventOnClick>\n')
|
||||
out_xml('\t\t</Banner>\n')
|
||||
|
||||
def GenListMenu():
|
||||
for spl in menu_new_list:
|
||||
#product_code = s
|
||||
|
|
@ -506,9 +533,13 @@
|
|||
out_xml( '\t;' + spl[0] + '\r\n')
|
||||
continue
|
||||
|
||||
if spl[0].startswith("BANNER"):
|
||||
GenBanner(spl)
|
||||
else:
|
||||
GenMenuV3(spl)
|
||||
|
||||
out_xml('\t\t; menu_new_list '+ str(len(menu_new_list))+'\n')
|
||||
GenListMenu()
|
||||
|
||||
out_xml('\t</Menus>\n')
|
||||
out_xml('</ScrollableCatalog>\n')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue