diff options
author | jack <jack@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-05-12 12:32:30 +0800 |
---|---|---|
committer | jack <jack@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-05-12 12:32:30 +0800 |
commit | 3535d2d6ca3468683b29f6477aae8b91759affe3 (patch) | |
tree | 7adc66ebab6e850ce58840d1a89d21c208346967 | |
parent | e7e72e99df864c3738bc7ce8349ea35ccdd6397f (diff) | |
download | pttbbs-3535d2d6ca3468683b29f6477aae8b91759affe3.tar pttbbs-3535d2d6ca3468683b29f6477aae8b91759affe3.tar.gz pttbbs-3535d2d6ca3468683b29f6477aae8b91759affe3.tar.bz2 pttbbs-3535d2d6ca3468683b29f6477aae8b91759affe3.tar.lz pttbbs-3535d2d6ca3468683b29f6477aae8b91759affe3.tar.xz pttbbs-3535d2d6ca3468683b29f6477aae8b91759affe3.tar.zst pttbbs-3535d2d6ca3468683b29f6477aae8b91759affe3.zip |
Replaced var.c to i18n version, also slightly modified user.c cal.c menu.c mbbsd.c admin.c talk.c
git-svn-id: http://opensvn.csie.org/pttbbs/branches/Jaky.i18n@1950 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/Makefile | 2 | ||||
-rw-r--r-- | mbbsd/admin.c | 6 | ||||
-rw-r--r-- | mbbsd/cal.c | 6 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 2 | ||||
-rw-r--r-- | mbbsd/menu.c | 286 | ||||
-rw-r--r-- | mbbsd/talk.c | 8 | ||||
-rw-r--r-- | mbbsd/user.c | 4 | ||||
-rw-r--r-- | mbbsd/var.c | 444 |
8 files changed, 376 insertions, 382 deletions
diff --git a/mbbsd/Makefile b/mbbsd/Makefile index 777dfdbe..d9f79a4d 100644 --- a/mbbsd/Makefile +++ b/mbbsd/Makefile @@ -32,7 +32,7 @@ test: $(PROG) killall -9 testmbbsd || true cp mbbsd testmbbsd ./testmbbsd 9000 - rm -f testmbbsd +# rm -f testmbbsd install: $(PROG) install -d $(BBSHOME)/bin/ diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 3f3b1904..d7a562fe 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -212,7 +212,7 @@ bperm_msg(boardheader_t * board) } unsigned int -setperms(unsigned int pbits, char *pstring[]) +setperms(unsigned int pbits, int *pstring) { register int i; char choice[4]; @@ -220,10 +220,10 @@ setperms(unsigned int pbits, char *pstring[]) move(4, 0); for (i = 0; i < NUMPERMS / 2; i++) { prints("%c. %-20s %-15s %c. %-20s %s\n", - 'A' + i, pstring[i], + 'A' + i, SHM->i18nstr[cuser.language][pstring[i]], ((pbits >> i) & 1 ? SHM->i18nstr[cuser.language][23] : SHM->i18nstr[cuser.language][24]), i < 10 ? 'Q' + i : '0' + i - 10, - pstring[i + 16], + SHM->i18nstr[cuser.language][pstring[i + 16]], ((pbits >> (i + 16)) & 1 ? SHM->i18nstr[cuser.language][25] : SHM->i18nstr[cuser.language][26])); } clrtobot(); diff --git a/mbbsd/cal.c b/mbbsd/cal.c index efaf30da..69aa4f24 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -32,11 +32,11 @@ lockutmpmode(int unmode, int state) move(10, 20); if (errorno == 1) prints(SHM->i18nstr[cuser.language][532], - ModeTypeTable[currutmp->lockmode], - ModeTypeTable[unmode]); + SHM->i18nstr[cuser.language][ModeTypeTable[currutmp->lockmode]], + SHM->i18nstr[cuser.language][ModeTypeTable[unmode]]); else prints(SHM->i18nstr[cuser.language][533], - ModeTypeTable[unmode]); + SHM->i18nstr[cuser.language][ModeTypeTable[unmode]]); pressanykey(); return errorno; } diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index de9a4643..1cb7942f 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -961,7 +961,7 @@ user_login() for (i = 0; i < NUMVIEWFILE; i++) if ((cuser.loginview >> i) & 1) - more(loginview_file[(int)i][0], YEA); + more(loginview_file[(int)i].path, YEA); } static void diff --git a/mbbsd/menu.c b/mbbsd/menu.c index 3c4dcbae..0317a340 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -11,7 +11,7 @@ extern char board_hidden_status; void showtitle(char *title, char *mid) { - char buf[40], numreg[50]; + char buf[40], buf1[40], numreg[50]; #ifndef DEBUG int nreg; #endif @@ -31,12 +31,13 @@ showtitle(char *title, char *mid) } #else else if (currutmp->mailalert) { - mid = "\033[41;5m 郵差來按鈴囉 " TITLE_COLOR; + snprintf(buf1, sizeof(buf1), "%s"TITLE_COLOR, SHM->i18nstr[cuser.language][1380]); + mid = buf1; spc = 22; } else if (HAS_PERM(PERM_SYSOP) && (nreg = dashs(fn_register) / 163) > 10) { snprintf(numreg, sizeof(numreg), - "\033[41;5m 有%03d/%03d未審核 " TITLE_COLOR, - nreg, (int)dashs("register.new.tmp") / 163); + SHM->i18nstr[cuser.language][1381], + nreg, (int)dashs("register.new.tmp") / 163, TITLE_COLOR); mid = numreg; spc = 22; } @@ -49,10 +50,10 @@ showtitle(char *title, char *mid) buf[spc] = '\0'; clear(); - prints(TITLE_COLOR "【%s】%s\033[33m%s%s%s\033[3%s《", + prints(SHM->i18nstr[cuser.language][1382], TITLE_COLOR, title, buf, mid, buf, " " + pad, - currmode & MODE_SELECT ? "6m系列" : currmode & MODE_ETC ? "5m其他" : - currmode & MODE_DIGEST ? "2m文摘" : "7m看板"); + currmode & MODE_SELECT ? SHM->i18nstr[cuser.language][1383] : currmode & MODE_ETC ? SHM->i18nstr[cuser.language][1384] : + currmode & MODE_DIGEST ? SHM->i18nstr[cuser.language][1385] : SHM->i18nstr[cuser.language][1386]); if (strcmp(currboard, lastboard)) { /* change board */ if (currboard[0] != 0 && @@ -67,7 +68,7 @@ showtitle(char *title, char *mid) prints("\033[32m%s", currboard); else prints("%s", currboard); - prints("\033[3%dm》\033[0m\n", currmode & MODE_SELECT ? 6 : + prints(SHM->i18nstr[cuser.language][1387], currmode & MODE_SELECT ? 6 : currmode & MODE_ETC ? 5 : currmode & MODE_DIGEST ? 2 : 7); } @@ -82,17 +83,15 @@ show_status(void) int i; struct tm *ptime = localtime(&now); char mystatus[160]; - char *myweek = "天一二三四五六"; - const char *msgs[] = {"關閉", "打開", "拔掉", "防水", "好友"}; + char *myweek = SHM->i18nstr[cuser.language][1388]; + const char *msgs[] = {SHM->i18nstr[cuser.language][1389], SHM->i18nstr[cuser.language][1390], SHM->i18nstr[cuser.language][1391], SHM->i18nstr[cuser.language][1392], SHM->i18nstr[cuser.language][1393]}; i = ptime->tm_wday << 1; snprintf(mystatus, sizeof(mystatus), - "\033[34;46m[%d/%d 星期%c%c %d:%02d]\033[1;33;45m%-14s" - "\033[30;47m 目前坊裡有\033[31m%d\033[30m人, 我是\033[31m%-12s" - "\033[30m[扣機]\033[31m%s\033[0m", + SHM->i18nstr[cuser.language][1394], ptime->tm_mon + 1, ptime->tm_mday, myweek[i], myweek[i + 1], ptime->tm_hour, ptime->tm_min, currutmp->birth ? - "生日要請客唷" : SHM->today_is, + SHM->i18nstr[cuser.language][1395] : SHM->today_is, SHM->UTMPnumber, cuser.userid, msgs[currutmp->pager]); outmsg(mystatus); } @@ -149,15 +148,15 @@ show_menu(commands_t * p) { register int n = 0; register char *s; - const char *state[4] = {"用功\型", "安逸型", "自定型", "SHUTUP"}; char buf[80]; movie(currstat); move(menu_row, 0); - while ((s = p[n].desc)) { + while (p[n].desc > 0 && p[n].desc < MAX_STRING) { if (HAS_PERM(p[n].level)) { - snprintf(buf, sizeof(buf), s + 2, state[cuser.proverb % 4]); + s = SHM->i18nstr[cuser.language][p[n].desc]; + snprintf(buf, sizeof(buf), s + 2, SHM->i18nstr[cuser.language][1396 + cuser.proverb % 4]); prints("%*s (\033[1;36m%c\033[0m)%s\n", menu_column, "", s[1], buf); } @@ -262,15 +261,15 @@ domenu(int cmdmode, char *cmdtitle, int cmd, commands_t cmdtable[]) refscreen = YEA; if (err != -1) - cmd = cmdtable[lastcmdptr].desc[0]; + cmd = SHM->i18nstr[cuser.language][cmdtable[lastcmdptr].desc][0]; else - cmd = cmdtable[lastcmdptr].desc[1]; - cmd0[cmdmode] = cmdtable[lastcmdptr].desc[0]; + cmd = SHM->i18nstr[cuser.language][cmdtable[lastcmdptr].desc][1]; + cmd0[cmdmode] = SHM->i18nstr[cuser.language][cmdtable[lastcmdptr].desc][0]; } if (cmd >= 'a' && cmd <= 'z') cmd &= ~0x20; while (++i <= total) - if (cmdtable[i].desc[1] == cmd) + if (SHM->i18nstr[cuser.language][cmdtable[i].desc][1] == cmd) break; } @@ -300,51 +299,51 @@ domenu(int cmdmode, char *cmdtitle, int cmd, commands_t cmdtable[]) /* administrator's maintain menu */ static commands_t adminlist[] = { - {m_user, PERM_ACCOUNTS, "UUser 使用者資料"}, - {search_user_bypwd, PERM_SYSOP, "SSearch User 特殊搜尋使用者"}, - {search_user_bybakpwd,PERM_SYSOP, "OOld User data 查閱\備份使用者資料"}, - {m_board, PERM_SYSOP, "BBoard 設定看板"}, - {m_register, PERM_SYSOP, "RRegister 審核註冊表單"}, - {cat_register, PERM_SYSOP, "CCatregister 無法審核時用的"}, - {x_file, PERM_SYSOP|PERM_VIEWSYSOP, "XXfile 編輯系統檔案"}, - {give_money, PERM_SYSOP|PERM_VIEWSYSOP, "GGivemoney 紅包雞"}, - {m_loginmsg, PERM_SYSOP, "MMessage Login 進站水球"}, + {m_user, PERM_ACCOUNTS, 1399}, + {search_user_bypwd, PERM_SYSOP, 1400}, + {search_user_bybakpwd,PERM_SYSOP, 1401}, + {m_board, PERM_SYSOP, 1402}, + {m_register, PERM_SYSOP, 1403}, + {cat_register, PERM_SYSOP, 1404}, + {x_file, PERM_SYSOP|PERM_VIEWSYSOP, 1405}, + {give_money, PERM_SYSOP|PERM_VIEWSYSOP, 1406}, + {m_loginmsg, PERM_SYSOP, 1407}, #ifdef HAVE_MAILCLEAN - {m_mclean, PERM_SYSOP, "MMail Clean 清理使用者個人信箱"}, + {m_mclean, PERM_SYSOP, 1408}, #endif #ifdef HAVE_REPORT - {m_trace, PERM_SYSOP, "TTrace 設定是否記錄除錯資訊"}, + {m_trace, PERM_SYSOP, 1409}, #endif - {NULL, 0, NULL} + {NULL, 0, -1} }; /* mail menu */ static commands_t maillist[] = { - {m_new, PERM_READMAIL, "RNew 閱\讀新進郵件"}, - {m_read, PERM_READMAIL, "RRead 多功\能讀信選單"}, - {m_send, PERM_BASIC, "RSend 站內寄信"}, - {x_love, PERM_LOGINOK, "PPaper \033[1;32m情書產生器\033[m "}, - {mail_list, PERM_BASIC, "RMail List 群組寄信"}, - {setforward, PERM_LOGINOK,"FForward \033[32m設定信箱自動轉寄\033[m"}, - {m_sysop, 0, "YYes, sir! 諂媚站長"}, - {m_internet, PERM_INTERNET, "RInternet 寄信到 Internet"}, - {mail_mbox, PERM_INTERNET, "RZip UserHome 把所有私人資料打包回去"}, - {built_mail_index, PERM_LOGINOK, "SSavemail 重建信箱索引"}, - {mail_all, PERM_SYSOP, "RAll 寄信給所有使用者"}, - {NULL, 0, NULL} + {m_new, PERM_READMAIL, 1410}, + {m_read, PERM_READMAIL, 1411}, + {m_send, PERM_BASIC, 1412}, + {x_love, PERM_LOGINOK, 1413}, + {mail_list, PERM_BASIC, 1414}, + {setforward, PERM_LOGINOK,1415}, + {m_sysop, 0, 1416}, + {m_internet, PERM_INTERNET, 1417}, + {mail_mbox, PERM_INTERNET, 1418}, + {built_mail_index, PERM_LOGINOK, 1419}, + {mail_all, PERM_SYSOP, 1420}, + {NULL, 0, -1} }; /* Talk menu */ static commands_t talklist[] = { - {t_users, 0, "UUsers 完全聊天手冊"}, - {t_pager, PERM_BASIC, "PPager 切換呼叫器"}, - {t_idle, 0, "IIdle 發呆"}, - {t_query, 0, "QQuery 查詢網友"}, - {t_qchicken, 0, "WWatch Pet 查詢寵物"}, - {t_talk, PERM_PAGE, "TTalk 找人聊聊"}, - {t_chat, PERM_CHAT, "CChat 找家茶坊喫茶去"}, - {t_display, 0, "DDisplay 顯示上幾次熱訊"}, - {NULL, 0, NULL} + {t_users, 0, 1421}, + {t_pager, PERM_BASIC, 1422}, + {t_idle, 0, 1423}, + {t_query, 0, 1424}, + {t_qchicken, 0, 1425}, + {t_talk, PERM_PAGE, 1426}, + {t_chat, PERM_CHAT, 1427}, + {t_display, 0, 1428}, + {NULL, 0, -1} }; /* name menu */ @@ -359,93 +358,92 @@ static int t_special() { } static commands_t namelist[] = { - {t_override, PERM_LOGINOK,"OOverRide 好友名單"}, - {t_reject, PERM_LOGINOK, "BBlack 壞人名單"}, - {t_aloha,PERM_LOGINOK, "AALOHA 上站通知名單"}, + {t_override, PERM_LOGINOK,1429}, + {t_reject, PERM_LOGINOK, 1430}, + {t_aloha,PERM_LOGINOK, 1431}, #ifdef POSTNOTIFY - {t_post,PERM_LOGINOK, "NNewPost 新文章通知名單"}, + {t_post,PERM_LOGINOK, 1432}, #endif - {t_special,PERM_LOGINOK, "SSpecial 其他特別名單"}, - {NULL, 0, NULL} + {t_special,PERM_LOGINOK, 1433}, + {NULL, 0, -1} }; /* User menu */ static commands_t userlist[] = { - {u_info, PERM_LOGINOK, "IInfo 設定個人資料與密碼"}, - {calendar, PERM_LOGINOK, "CCalendar 個人行事曆"}, - {u_editcalendar, PERM_LOGINOK, "EEditCalendar 編輯個人行事曆"}, - {u_loginview, PERM_LOGINOK, "LLogin View 選擇進站畫面"}, - {u_ansi, 0, "AANSI 切換 ANSI \033[36m彩\033[35m色\033[37m/" - "\033[30;47m黑\033[1;37m白\033[m模示"}, - {u_movie, 0, "MMovie 切換動畫模示"}, + {u_info, PERM_LOGINOK, 1434}, + {calendar, PERM_LOGINOK, 1435}, + {u_editcalendar, PERM_LOGINOK, 1436}, + {u_loginview, PERM_LOGINOK, 1437}, + {u_ansi, 0, 1438}, + {u_movie, 0, 1439}, #ifdef HAVE_SUICIDE - {u_kill, PERM_BASIC, "IKill 自殺!!"}, + {u_kill, PERM_BASIC, 1440}, #endif - {u_editplan, PERM_LOGINOK, "QQueryEdit 編輯名片檔"}, - {u_editsig, PERM_LOGINOK, "SSignature 編輯簽名檔"}, + {u_editplan, PERM_LOGINOK, 1441}, + {u_editsig, PERM_LOGINOK, 1442}, #if HAVE_FREECLOAK - {u_cloak, PERM_LOGINOK, "CCloak 隱身術"}, + {u_cloak, PERM_LOGINOK, 1443}, #else - {u_cloak, PERM_CLOAK, "CCloak 隱身術"}, + {u_cloak, PERM_CLOAK, 1444}, #endif - {u_register, PERM_BASIC, "RRegister 填寫《註冊申請單》"}, - {u_list, PERM_SYSOP, "UUsers 列出註冊名單"}, - {NULL, 0, NULL} + {u_register, PERM_BASIC, 1445}, + {u_list, PERM_SYSOP, 1446}, + {NULL, 0, -1} }; /* XYZ tool menu */ static commands_t xyzlist[] = { #ifdef HAVE_LICENSE - {x_gpl, 0, "LLicense GNU 使用執照"}, + {x_gpl, 0, 1447}, #endif #ifdef HAVE_INFO - {x_program, 0, "PProgram 本程式之版本與版權宣告"}, + {x_program, 0, 1448}, #endif - {x_boardman,0, "MMan Boards 《看板精華區排行榜》"}, -// {x_boards,0, "HHot Boards 《看板人氣排行榜》"}, - {x_history, 0, "HHistory 《我們的成長》"}, - {x_note, 0, "NNote 《酸甜苦辣流言板》"}, - {x_login,0, "SSystem 《系統重要公告》"}, - {x_week, 0, "WWeek 《本週五十大熱門話題》"}, - {x_issue, 0, "IIssue 《今日十大熱門話題》"}, - {x_today, 0, "TToday 《今日上線人次統計》"}, - {x_yesterday, 0, "YYesterday 《昨日上線人次統計》"}, - {x_user100 ,0, "UUsers 《使用者百大排行榜》"}, - {x_birth, 0, "BBirthday 《今日壽星大觀》"}, - {p_sysinfo, 0, "XXinfo 《查看系統資訊》"}, - {NULL, 0, NULL} + {x_boardman,0, 1449}, +// {x_boards,0, 1450}, + {x_history, 0, 1451}, + {x_note, 0, 1452}, + {x_login,0, 1453}, + {x_week, 0, 1454}, + {x_issue, 0, 1455}, + {x_today, 0, 1456}, + {x_yesterday, 0, 1457}, + {x_user100 ,0, 1458}, + {x_birth, 0, 1459}, + {p_sysinfo, 0, 1460}, + {NULL, 0, -1} }; /* Ptt money menu */ static commands_t moneylist[] = { - {p_give, 0, "00Give 給其他人錢"}, - {save_violatelaw, 0,"11ViolateLaw 繳罰單"}, + {p_give, 0, 1461}, + {save_violatelaw, 0,1462}, #if !HAVE_FREECLOAK - {p_cloak, 0, "22Cloak 切換 隱身/現身 $19 /次"}, + {p_cloak, 0, 1463}, #endif - {p_from, 0, "33From 暫時修改故鄉 $49 /次"}, - {ordersong,0, "44OSong 歐桑動態點歌機 $200 /次"}, - {p_exmail, 0, "55Exmail 購買信箱 $1000/封"}, - {NULL, 0, NULL} + {p_from, 0, 1464}, + {ordersong,0, 1465}, + {p_exmail, 0, 1466}, + {NULL, 0, -1} }; static int p_money() { - domenu(PSALE, "Ptt量販店", '0', moneylist); + domenu(PSALE, SHM->i18nstr[cuser.language][1467], '0', moneylist); return 0; }; #if 0 static commands_t jceelist[] = { - {x_90,PERM_LOGINOK, "0090 JCEE 【90學年度大學聯招查榜系統】"}, - {x_89,PERM_LOGINOK, "1189 JCEE 【89學年度大學聯招查榜系統】"}, - {x_88,PERM_LOGINOK, "2288 JCEE 【88學年度大學聯招查榜系統】"}, - {x_87,PERM_LOGINOK, "3387 JCEE 【87學年度大學聯招查榜系統】"}, - {x_86,PERM_LOGINOK, "4486 JCEE 【86學年度大學聯招查榜系統】"}, - {NULL, 0, NULL} + {x_90,PERM_LOGINOK, 1468}, + {x_89,PERM_LOGINOK, 1469}, + {x_88,PERM_LOGINOK, 1470}, + {x_87,PERM_LOGINOK, 1471}, + {x_86,PERM_LOGINOK, 1472}, + {NULL, 0, -1} }; static int m_jcee() { - domenu(JCEE, "Ptt查榜系統", '0', jceelist); + domenu(JCEE, SHM->i18nstr[cuser.language][1473], '0', jceelist); return 0; } #endif @@ -458,32 +456,31 @@ static int chessroom(); static commands_t playlist[] = { #if 0 #if HAVE_JCEE - {m_jcee, PERM_LOGINOK, "JJCEE 【 大學聯考查榜系統 】"}, + {m_jcee, PERM_LOGINOK, 1474}, #endif #endif - {note, PERM_LOGINOK, "NNote 【 刻刻流言板 】"}, - {x_weather,0 , "WWeather 【 氣象預報 】"}, + {note, PERM_LOGINOK, 1475}, + {x_weather,0 , 1476}, /* XXX 壞掉了 */ /* {x_stock,0 , "SStock 【 股市行情 】"},*/ - {forsearch,PERM_LOGINOK, "SSearchEngine【\033[1;35m Ptt搜尋器 \033[m】"}, - {topsong,PERM_LOGINOK, "TTop Songs 【\033[1;32m歐桑點歌排行榜\033[m】"}, - {p_money,PERM_LOGINOK, "PPay 【\033[1;31m Ptt量販店 \033[m】"}, - {chicken_main,PERM_LOGINOK, "CChicken " - "【\033[1;34m Ptt養雞場 \033[m】"}, - {playground,PERM_LOGINOK, "AAmusement 【\033[1;33m Ptt遊樂場 \033[m】"}, - {chessroom, PERM_LOGINOK, "BChineseChess 【\033[1;34m Ptt棋院\033[m】"}, - {NULL, 0, NULL} + {forsearch,PERM_LOGINOK, 1477}, + {topsong,PERM_LOGINOK, 1478}, + {p_money,PERM_LOGINOK, 1479}, + {chicken_main,PERM_LOGINOK, 1480}, + {playground,PERM_LOGINOK, 1481}, + {chessroom, PERM_LOGINOK, 1482}, + {NULL, 0, -1} }; static commands_t chesslist[] = { - {chc_main, PERM_LOGINOK, "1ChessFight 【\033[1;33m 邀 局 \033[m】"}, - {chc_personal, PERM_LOGINOK, "2SelfPlay 【\033[1;34m 打 譜 \033[m】"}, - {chc_watch, PERM_LOGINOK, "3ChessWatch 【\033[1;35m 觀 棋 \033[m】"}, - {NULL, 0, NULL} + {chc_main, PERM_LOGINOK, 1483}, + {chc_personal, PERM_LOGINOK, 1484}, + {chc_watch, PERM_LOGINOK, 1485}, + {NULL, 0, -1} }; static int chessroom() { - domenu(CHC, "Ptt棋院", '1', chesslist); + domenu(CHC, SHM->i18nstr[cuser.language][1486], '1', chesslist); return 0; } @@ -492,34 +489,31 @@ static commands_t plist[] = { /* {p_ticket_main, PERM_LOGINOK,"00Pre 【 總統機 】"}, {alive, PERM_LOGINOK, "00Alive 【 訂票雞 】"}, */ - {ticket_main, PERM_LOGINOK, "11Gamble 【 Ptt賭場 】"}, - {guess_main, PERM_LOGINOK, "22Guess number【 猜數字 】"}, - {othello_main, PERM_LOGINOK, "33Othello 【 黑白棋 】"}, -// {dice_main, PERM_LOGINOK, "44Dice 【 玩骰子 】"}, - {vice_main, PERM_LOGINOK, "44Vice 【 發票對獎 】"}, - {g_card_jack, PERM_LOGINOK, "55Jack 【 黑傑克 】"}, - {g_ten_helf, PERM_LOGINOK, "66Tenhalf 【 十點半 】"}, - {card_99, PERM_LOGINOK, "77Nine 【 九十九 】"}, - {NULL, 0, NULL} + {ticket_main, PERM_LOGINOK, 1487}, + {guess_main, PERM_LOGINOK, 1488}, + {othello_main, PERM_LOGINOK, 1489}, +// {dice_main, PERM_LOGINOK, 1490}, + {vice_main, PERM_LOGINOK, 1491}, + {g_card_jack, PERM_LOGINOK, 1492}, + {g_ten_helf, PERM_LOGINOK, 1493}, + {card_99, PERM_LOGINOK, 1494}, + {NULL, 0, -1} }; static int playground() { - domenu(AMUSE, "Ptt遊樂場",'1',plist); + domenu(AMUSE, SHM->i18nstr[cuser.language][1495],'1',plist); return 0; } static commands_t slist[] = { - {x_dict,0, "11Dictionary " - "【\033[1;33m 趣味大字典 \033[m】"}, - {x_mrtmap, 0, "22MRTmap " - "【\033[1;34m 捷運地圖 \033[m】"}, - {main_railway, PERM_LOGINOK, "33Railway " - "【\033[1;32m 火車表查詢 \033[m】"}, - {NULL, 0, NULL} + {x_dict,0, 1496}, + {x_mrtmap, 0, 1497}, + {main_railway, PERM_LOGINOK, 1498}, + {NULL, 0, -1} }; static int forsearch() { - domenu(SREG, "Ptt搜尋器", '1', slist); + domenu(SREG, SHM->i18nstr[cuser.language][1499], '1', slist); return 0; } @@ -527,43 +521,43 @@ static int forsearch() { int admin() { - domenu(ADMIN, "系統維護", 'X', adminlist); + domenu(ADMIN, SHM->i18nstr[cuser.language][1500], 'X', adminlist); return 0; } int Mail() { - domenu(MAIL, "電子郵件", 'R', maillist); + domenu(MAIL, SHM->i18nstr[cuser.language][1501], 'R', maillist); return 0; } int Talk() { - domenu(TMENU, "聊天說話", 'U', talklist); + domenu(TMENU, SHM->i18nstr[cuser.language][1502], 'U', talklist); return 0; } int User() { - domenu(UMENU, "個人設定", 'A', userlist); + domenu(UMENU, SHM->i18nstr[cuser.language][1503], 'A', userlist); return 0; } int Xyz() { - domenu(XMENU, "工具程式", 'M', xyzlist); + domenu(XMENU, SHM->i18nstr[cuser.language][1504], 'M', xyzlist); return 0; } int Play_Play() { - domenu(PMENU, "網路遊樂場", 'A', playlist); + domenu(PMENU, SHM->i18nstr[cuser.language][1505], 'A', playlist); return 0; } int Name_Menu() { - domenu(NMENU, "白色恐怖", 'O', namelist); + domenu(NMENU, SHM->i18nstr[cuser.language][1506], 'O', namelist); return 0; } diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 8c0c2ec3..f8bd81f1 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -86,9 +86,9 @@ modestring(userinfo_t * uentp, int simple) /* for debugging */ if (mode >= MAX_MODES) { syslog(LOG_WARNING, "what!? mode = %d", mode); - word = ModeTypeTable[mode % MAX_MODES]; + word = SHM->i18nstr[cuser.language][ModeTypeTable[mode % MAX_MODES]]; } else - word = ModeTypeTable[mode]; + word = SHM->i18nstr[cuser.language][ModeTypeTable[mode]]; fri_stat = friend_stat(currutmp, uentp); if (!(HAS_PERM(PERM_SYSOP) || HAS_PERM(PERM_SEECLOAK)) && ((uentp->invisible || (fri_stat & HRM)) && @@ -96,8 +96,8 @@ modestring(userinfo_t * uentp, int simple) return notonline; else if (mode == EDITING) { snprintf(modestr, sizeof(modestr), "E:%s", - ModeTypeTable[uentp->destuid < EDITING ? uentp->destuid : - EDITING]); + SHM->i18nstr[cuser.language][ModeTypeTable[uentp->destuid < EDITING ? uentp->destuid : + EDITING]]); word = modestr; } else if (!mode && *uentp->chatid == 1) { if (!simple) diff --git a/mbbsd/user.c b/mbbsd/user.c index f08a2264..577da96f 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -28,7 +28,9 @@ u_loginview() move(4, 0); for (i = 0; i < NUMVIEWFILE; i++) prints(" %c. %-20s %-15s \n", 'A' + i, - loginview_file[i][1], ((pbits >> i) & 1 ? SHM->i18nstr[cuser.language][2079] : SHM->i18nstr[cuser.language][2080])); + SHM->i18nstr[cuser.language][loginview_file[i].string_index] + , ((pbits >> i) & 1 ? SHM->i18nstr[cuser.language][2079] : + SHM->i18nstr[cuser.language][2080])); clrtobot(); while ((i = getkey(SHM->i18nstr[cuser.language][2081]))!='\r') { diff --git a/mbbsd/var.c b/mbbsd/var.c index 3ff019f0..45fb71ac 100644 --- a/mbbsd/var.c +++ b/mbbsd/var.c @@ -2,74 +2,74 @@ #define INCLUDE_VAR_H #include "bbs.h" -char *str_permid[] = { - "基本權力", /* PERM_BASIC */ - "進入聊天室", /* PERM_CHAT */ - "找人聊天", /* PERM_PAGE */ - "發表文章", /* PERM_POST */ - "註冊程序認證", /* PERM_LOGINOK */ - "信件無上限", /* PERM_MAILLIMIT */ - "隱身術", /* PERM_CLOAK */ - "看見忍者", /* PERM_SEECLOAK */ - "永久保留帳號", /* PERM_XEMPT */ - "站長隱身術", /* PERM_DENYPOST */ - "板主", /* PERM_BM */ - "帳號總管", /* PERM_ACCOUNTS */ - "聊天室總管", /* PERM_CHATCLOAK */ - "看板總管", /* PERM_BOARD */ - "站長", /* PERM_SYSOP */ - "BBSADM", /* PERM_POSTMARK */ - "不列入排行榜", /* PERM_NOTOP */ - "違法通緝中", /* PERM_VIOLATELAW */ - "不接受站外的信", /* PERM_ */ - "不允許\認證碼註冊", /* PERM_NOREGCODE */ - "視覺站長", /* PERM_VIEWSYSOP */ - "觀察使用者行蹤", /* PERM_LOGUSER */ - "精華區總整理權", /* PERM_Announce */ - "公關組", /* PERM_RELATION */ - "特務組", /* PERM_SMG */ - "程式組", /* PERM_PRG */ - "活動組", /* PERM_ACTION */ - "美工組", /* PERM_PAINT */ - "立法組", /* PERM_LAW */ - "小組長", /* PERM_SYSSUBOP */ - "一級主管", /* PERM_LSYSOP */ - "Ptt" /* PERM_PTT */ +int str_permid[] = { + 2572, /* PERM_BASIC */ + 2573, /* PERM_CHAT */ + 2574, /* PERM_PAGE */ + 2575, /* PERM_POST */ + 2576, /* PERM_LOGINOK */ + 2577, /* PERM_MAILLIMIT */ + 2578, /* PERM_CLOAK */ + 2579, /* PERM_SEECLOAK */ + 2580, /* PERM_XEMPT */ + 2581, /* PERM_DENYPOST */ + 2582, /* PERM_BM */ + 2583, /* PERM_ACCOUNTS */ + 2584, /* PERM_CHATCLOAK */ + 2585, /* PERM_BOARD */ + 2586, /* PERM_SYSOP */ + 3440, /* PERM_POSTMARK */ + 2587, /* PERM_NOTOP */ + 2588, /* PERM_VIOLATELAW */ + 2589, /* PERM_ */ + 2590, /* PERM_NOREGCODE */ + 2591, /* PERM_VIEWSYSOP */ + 2592, /* PERM_LOGUSER */ + 2593, /* PERM_Announce */ + 2594, /* PERM_RELATION */ + 2595, /* PERM_SMG */ + 2596, /* PERM_PRG */ + 2597, /* PERM_ACTION */ + 2598, /* PERM_PAINT */ + 2599, /* PERM_LAW */ + 2600, /* PERM_SYSSUBOP */ + 2601, /* PERM_LSYSOP */ + 2602 /* PERM_PTT */ }; -char *str_permboard[] = { - "不可 Zap", /* BRD_NOZAP */ - "不列入統計", /* BRD_NOCOUNT */ - "不轉信", /* BRD_NOTRAN */ - "群組板", /* BRD_GROUPBOARD */ - "隱藏板", /* BRD_HIDE */ - "限制(不需設定)", /* BRD_POSTMASK */ - "匿名板", /* BRD_ANONYMOUS */ - "預設匿名板", /* BRD_DEFAULTANONYMOUS */ - "違法改進中看板", /* BRD_BAD */ - "連署專用看板", /* BRD_VOTEBOARD */ - "已警告要廢除", /* BRD_WARNEL */ - "熱門看板群組", /* BRD_TOP */ - "不可推薦", /* BRD_NORECOMMEND */ - "布落格", /* BRD_BLOG */ - "板主設定列入記錄", /* BRD_BMCOUNT */ - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", - "沒想到", +int str_permboard[] = { + 2603, /* BRD_NOZAP */ + 2604, /* BRD_NOCOUNT */ + 2605, /* BRD_NOTRAN */ + 2606, /* BRD_GROUPBOARD */ + 2607, /* BRD_HIDE */ + 2608, /* BRD_POSTMASK */ + 2609, /* BRD_ANONYMOUS */ + 2610, /* BRD_DEFAULTANONYMOUS */ + 2611, /* BRD_BAD */ + 2612, /* BRD_VOTEBOARD */ + 2613, /* BRD_WARNEL */ + 2614, /* BRD_TOP */ + 2615, /* BRD_NORECOMMEND */ + 2616, /* BRD_BLOG */ + 2617, /* BRD_BMCOUNT */ + 2618, + 2619, + 2620, + 2621, + 2622, + 2623, + 2624, + 2625, + 2626, + 2627, + 2628, + 2629, + 2630, + 2631, + 2632, + 2633, + 2634, }; int usernum; @@ -121,21 +121,21 @@ char *fn_proverb = "proverb"; /* are descript in userec.loginview */ -char *loginview_file[NUMVIEWFILE][2] = { - {FN_NOTE_ANS, "酸甜苦辣流言板"}, - {FN_TOPSONG, "點歌排行榜"}, - {"etc/topusr", "十大排行榜"}, - {"etc/topusr100", "百大排行榜"}, - {"etc/birth.today", "今日壽星"}, - {"etc/weather.tmp", "天氣快報"}, - {"etc/stock.tmp", "股市快報"}, - {"etc/day", "今日十大話題"}, - {"etc/week", "一週五十大話題"}, - {"etc/today", "今天上站人次"}, - {"etc/yesterday", "昨日上站人次"}, - {"etc/history", "歷史上的今天"}, - {"etc/topboardman", "精華區排行榜"}, - {"etc/topboard.tmp", "看板人氣排行榜"} +loginview_file_t loginview_file[] = { + {FN_NOTE_ANS, 2635}, + {FN_TOPSONG, 2636}, + {"etc/topusr", 2637}, + {"etc/topusr100", 2638}, + {"etc/birth.today", 2639}, + {"etc/weather.tmp", 2640}, + {"etc/stock.tmp", 2641}, + {"etc/day", 2642}, + {"etc/week", 2643}, + {"etc/today", 2644}, + {"etc/yesterday", 2645}, + {"etc/history", 2646}, + {"etc/topboardman", 2647}, + {"etc/topboard.tmp", 2648} }; /* message */ @@ -179,136 +179,134 @@ char *BBSName = BBSNAME; /* #define MAX_MODES 78 */ /* MAX_MODES is defined in common.h */ -char *ModeTypeTable[MAX_MODES] = { - "發呆", /* IDLE */ - "主選單", /* MMENU */ - "系統維護", /* ADMIN */ - "郵件選單", /* MAIL */ - "交談選單", /* TMENU */ - "使用者選單", /* UMENU */ - "XYZ 選單", /* XMENU */ - "分類看板", /* CLASS */ - "Play選單", /* PMENU */ - "編特別名單", /* NMENU */ - "Ptt量販店", /* PSALE */ - "發表文章", /* POSTING */ - "看板列表", /* READBRD */ - "閱\讀文章", /* READING */ - "新文章列表", /* READNEW */ - "選擇看板", /* SELECT */ - "讀信", /* RMAIL */ - "寫信", /* SMAIL */ - "聊天室", /* CHATING */ - "其他", /* XMODE */ - "尋找好友", /* FRIEND */ - "上線使用者", /* LAUSERS */ - "使用者名單", /* LUSERS */ - "追蹤站友", /* MONITOR */ - "呼叫", /* PAGE */ - "查詢", /* TQUERY */ - "交談", /* TALK */ - "編名片檔", /* EDITPLAN */ - "編簽名檔", /* EDITSIG */ - "投票中", /* VOTING */ - "設定資料", /* XINFO */ - "寄給站長", /* MSYSOP */ - "汪汪汪", /* WWW */ - "打大老二", /* BIG2 */ - "回應", /* REPLY */ - "被水球打中", /* HIT */ - "水球準備中", /* DBACK */ - "筆記本", /* NOTE */ - "編輯文章", /* EDITING */ - "發系統通告", /* MAILALL */ - "摸兩圈", /* MJ */ - "電腦擇友", /* P_FRIEND */ - "上站途中", /* LOGIN */ - "查字典", /* DICT */ - "打橋牌", /* BRIDGE */ - "找檔案", /* ARCHIE */ - "打地鼠", /* GOPHER */ - "看News", /* NEWS */ - "情書產生器", /* LOVE */ - "編輯輔助器", /* EDITEXP */ - "申請IP位址", /* IPREG */ - "網管辦公中", /* NetAdm */ - "虛擬實業坊", /* DRINK */ - "計算機", /* CAL */ - "編輯座右銘", /* PROVERB */ - "公佈欄", /* ANNOUNCE */ - "刻流言板", /* EDNOTE */ - "英漢翻譯機", /* CDICT */ - "檢視自己物品", /* LOBJ */ - "點歌", /* OSONG */ - "正在玩小雞", /* CHICKEN */ - "玩彩券", /* TICKET */ - "猜數字", /* GUESSNUM */ - "遊樂場", /* AMUSE */ - "黑白棋", /* OTHELLO */ - "玩骰子", /* DICE */ - "發票對獎", /* VICE */ - "逼逼摳ing", /* BBCALL */ - "繳罰單", /* CROSSPOST */ - "五子棋", /* M_FIVE */ - "21點ing", /* JACK_CARD */ - "10點半ing", /* TENHALF */ - "超級九十九", /* CARD_99 */ - "火車查詢", /* RAIL_WAY */ - "搜尋選單", /* SREG */ - "下象棋", /* CHC */ - "下暗琪", /* DARK */ - "NBA大猜測" /* TMPJACK */ - "Ptt查榜系統", /* JCEE */ - "重編文章" /* REEDIT */ - "部落格", /* BLOGGING */ - "", /* for future usage */ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" +int ModeTypeTable[MAX_MODES] = { + 2649, /* IDLE */ + 2650, /* MMENU */ + 2651, /* ADMIN */ + 2652, /* MAIL */ + 2653, /* TMENU */ + 2654, /* UMENU */ + 2655, /* XMENU */ + 2656, /* CLASS */ + 2657, /* PMENU */ + 2658, /* NMENU */ + 2659, /* PSALE */ + 2660, /* POSTING */ + 2661, /* READBRD */ + 2662, /* READING */ + 2663, /* READNEW */ + 2664, /* SELECT */ + 2665, /* RMAIL */ + 2666, /* SMAIL */ + 2667, /* CHATING */ + 2668, /* XMODE */ + 2669, /* FRIEND */ + 2670, /* LAUSERS */ + 2671, /* LUSERS */ + 2672, /* MONITOR */ + 2673, /* PAGE */ + 2674, /* TQUERY */ + 2675, /* TALK */ + 2676, /* EDITPLAN */ + 2677, /* EDITSIG */ + 2678, /* VOTING */ + 2679, /* XINFO */ + 2680, /* MSYSOP */ + 2681, /* WWW */ + 2682, /* BIG2 */ + 2683, /* REPLY */ + 2684, /* HIT */ + 2685, /* DBACK */ + 2686, /* NOTE */ + 2687, /* EDITING */ + 2688, /* MAILALL */ + 2689, /* MJ */ + 2690, /* P_FRIEND */ + 2691, /* LOGIN */ + 2692, /* DICT */ + 2693, /* BRIDGE */ + 2694, /* ARCHIE */ + 2695, /* GOPHER */ + 2696, /* NEWS */ + 2697, /* LOVE */ + 2698, /* EDITEXP */ + 2699, /* IPREG */ + 2700, /* NetAdm */ + 2701, /* DRINK */ + 2702, /* CAL */ + 2703, /* PROVERB */ + 2704, /* ANNOUNCE */ + 2705, /* EDNOTE */ + 2706, /* CDICT */ + 2707, /* LOBJ */ + 2708, /* OSONG */ + 2709, /* CHICKEN */ + 2710, /* TICKET */ + 2711, /* GUESSNUM */ + 2712, /* AMUSE */ + 2713, /* OTHELLO */ + 2714, /* DICE */ + 2715, /* VICE */ + 2716, /* BBCALL */ + 2717, /* CROSSPOST */ + 2718, /* M_FIVE */ + 2719, /* JACK_CARD */ + 2720, /* TENHALF */ + 2721, /* CARD_99 */ + 2722, /* RAIL_WAY */ + 2723, /* SREG */ + 2724, /* CHC */ + 2725, /* DARK */ + 2726, /* TMPJACK */ + 2727, /* JCEE */ + 2728, /* REEDIT */ + 2729, /* BLOGGING */ + 0, /* for future usage */ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 }; /* term.c */ @@ -598,18 +596,18 @@ word_t *toplev; #ifndef _BBS_UTIL_C_ /* menu.c */ commands_t cmdlist[] = { - {admin, PERM_SYSOP | PERM_VIEWSYSOP, "00Admin 【 系統維護區 】"}, - {Announce, 0, "AAnnounce 【 精華公佈欄 】"}, - {Boards, 0, "FFavorite 【 我 的 最愛 】"}, - {root_board, 0, "CClass 【 分組討論區 】"}, - {Mail, PERM_BASIC, "MMail 【 私人信件區 】"}, - {Talk, 0, "TTalk 【 休閒聊天區 】"}, - {User, 0, "UUser 【 個人設定區 】"}, - {Xyz, 0, "XXyz 【 系統工具區 】"}, - {Play_Play, PERM_BASIC, "PPlay 【 娛樂/休閒生活】"}, - {Name_Menu, PERM_LOGINOK, "NNamelist 【 編特別名單 】"}, - {Goodbye, 0, "GGoodbye 離開,再見……"}, - {NULL, 0, NULL} + {admin, PERM_SYSOP | PERM_VIEWSYSOP, 2730}, + {Announce, 0, 2731}, + {Boards, 0, 2732}, + {root_board, 0, 2733}, + {Mail, PERM_BASIC, 2734}, + {Talk, 0, 2735}, + {User, 0, 2736}, + {Xyz, 0, 2737}, + {Play_Play, PERM_BASIC, 2738}, + {Name_Menu, PERM_LOGINOK, 2739}, + {Goodbye, 0, 2740}, + {NULL, 0, 0} }; #endif |