Commit 8236a17b authored by ZZH's avatar ZZH

fix hardware alarm set support mult lang 2024-06-04

parent 9109ff15
......@@ -92,7 +92,7 @@ async def post_point_alarm_setting(req, body: PointAlarmSettingRequest) \
if lang != "zh_CN":
etype_name = load_e_type_name(res.get("etype"), lang)
if item != "default":
item_lang = PHASE_LINE_LANG.get(item, "")
item_lang = PHASE_LINE_LANG.get(item, {}).get(lang, "")
etype_name = f"{item_lang}{etype_name}"
else:
etype_name = f"{item}{name}" if item != "default" else name
......
......@@ -259,7 +259,7 @@ async def load_aiao_max(user_id, cid, s_dts, e_dts, filed):
value_max = round(datas["value_max"], 2)
item_name = "漏电流" if datas['item'] == 'default' else datas['item']
if lang != "zh_CN":
item_name = PHASE_LINE_LANG.get(datas["item"], "")
item_name = PHASE_LINE_LANG.get(datas["item"], {}).get(lang, "")
location_name = f"{mtr_name}_{item_name}"
occur_time = datas.get("value_max_time")
occur_time = str(occur_time) if occur_time else None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment