title_label->SetPosition(0, 20); // 顶部中央
title_label->Resize(454, 40); // 全屏宽度
- title_label->SetText("生理周期");
+ if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ {
+ title_label->SetText("生理周期");
+ }
+ else
+ {
+ title_label->SetText("Menstrual Cycle");
+ }
title_label->SetStyle(STYLE_TEXT_FONT, 28);
title_label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
title_label->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
// 格式化日期文本:"9月5日 星期五"
static const char* weekday_str[] = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
+ static const char* weekday_str_en[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
char date_text[50] = {0};
int wd = CalculateWeekday(year, month, day); // 计算星期几
- sprintf(date_text, "%d月%d日 %s", month, day, weekday_str[wd]);
+ if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ {
+ sprintf(date_text, "%d月%d日 %s", month, day, weekday_str[wd]);
+ }
+ else
+ {
+ sprintf(date_text, "%dth of %d Month %s", month, day, weekday_str_en[wd]);
+ }
mon_label->SetText(date_text);
mon_label->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
edit_button->SetPosition(118, 350); // 底部中央
edit_button->Resize(230, 80);
- edit_button->SetText("编辑");
+ if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ {
+ edit_button->SetText("编辑");
+ }
+ else
+ {
+ edit_button->SetText("Edit");
+ }
edit_button->SetStyle(STYLE_TEXT_FONT, 30);
edit_button->SetStyle(STYLE_LINE_HEIGHT, 35);
edit_button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
// 判断当前显示的是否是今天所在月份
if (show_y == today_y && show_m == today_m) {
- edit_button->SetText("编辑");
+ if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ {
+ edit_button->SetText("编辑");
+ }
+ else
+ {
+ edit_button->SetText("Edit");
+ }
} else {
- edit_button->SetText("回今天");
+ if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ {
+ edit_button->SetText("回今天");
+ }
+ else
+ {
+ edit_button->SetText("Back to Today");
+ }
}
}
// 第四步:更新日期标签
static const char* weekday_str[] = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
+ static const char* weekday_str_en[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
char date_text[50] = {0};
int wd = CalculateWeekday(show_y, show_m, show_d);
- sprintf(date_text, "%d月%d日 %s", show_m, show_d, weekday_str[wd]);
+ if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ {
+ sprintf(date_text, "%d月%d日 %s", show_m, show_d, weekday_str[wd]);
+ }
+ else
+ {
+ sprintf(date_text, "%dth of %d Month %s", show_m, show_d, weekday_str_en[wd]);
+ }
mon_label->SetText(date_text);
// 第五步:更新日期显示
// 第六步:更新日期标签("X月X日 星期X"格式)
static const char* weekday_str[] = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
+ static const char* weekday_str_en[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
char date_text[50] = {0};
int wd = CalculateWeekday(show_y, show_m, show_d); // 使用当前保存的日期
- sprintf(date_text, "%d月%d日 %s", show_m, show_d, weekday_str[wd]);
+ if(ConfigModel::GetInstance()->GetLanguage() == 0)
+ {
+ sprintf(date_text, "%d月%d日 %s", show_m, show_d, weekday_str[wd]);
+ }
+ else
+ {
+ sprintf(date_text, "%dth of %d Month %s", show_m, show_d, weekday_str_en[wd]);
+ }
mon_label->SetText(date_text);
// 第七步:调用UpdateDayDisplay更新日期显示