diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 44 | ||||
-rw-r--r-- | mbbsd/args.c | 2 | ||||
-rw-r--r-- | mbbsd/bbs.c | 22 | ||||
-rw-r--r-- | mbbsd/board.c | 76 | ||||
-rw-r--r-- | mbbsd/cache.c | 2 | ||||
-rw-r--r-- | mbbsd/cal.c | 96 | ||||
-rw-r--r-- | mbbsd/calendar.c | 8 | ||||
-rw-r--r-- | mbbsd/card.c | 112 | ||||
-rw-r--r-- | mbbsd/chat.c | 92 | ||||
-rw-r--r-- | mbbsd/chc.c | 66 | ||||
-rw-r--r-- | mbbsd/chicken.c | 138 | ||||
-rw-r--r-- | mbbsd/dark.c | 56 | ||||
-rw-r--r-- | mbbsd/dice.c | 138 | ||||
-rw-r--r-- | mbbsd/edit.c | 104 | ||||
-rw-r--r-- | mbbsd/fav.c | 2 | ||||
-rw-r--r-- | mbbsd/friend.c | 38 | ||||
-rw-r--r-- | mbbsd/gamble.c | 70 | ||||
-rw-r--r-- | mbbsd/gomo.c | 58 | ||||
-rw-r--r-- | mbbsd/guess.c | 80 | ||||
-rw-r--r-- | mbbsd/i18n.c | 2 | ||||
-rw-r--r-- | mbbsd/indict.c | 30 | ||||
-rw-r--r-- | mbbsd/lovepaper.c | 12 | ||||
-rw-r--r-- | mbbsd/mail.c | 194 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 60 | ||||
-rw-r--r-- | mbbsd/menu.c | 56 | ||||
-rw-r--r-- | mbbsd/more.c | 16 | ||||
-rw-r--r-- | mbbsd/name.c | 6 | ||||
-rw-r--r-- | mbbsd/othello.c | 82 | ||||
-rw-r--r-- | mbbsd/record.c | 4 | ||||
-rw-r--r-- | mbbsd/register.c | 44 | ||||
-rw-r--r-- | mbbsd/stuff.c | 22 | ||||
-rw-r--r-- | mbbsd/syspost.c | 42 | ||||
-rw-r--r-- | mbbsd/talk.c | 314 | ||||
-rw-r--r-- | mbbsd/topsong.c | 2 | ||||
-rw-r--r-- | mbbsd/user.c | 414 | ||||
-rw-r--r-- | mbbsd/vice.c | 12 | ||||
-rw-r--r-- | mbbsd/vote.c | 106 | ||||
-rw-r--r-- | mbbsd/voteboard.c | 160 | ||||
-rw-r--r-- | mbbsd/xyz.c | 50 |
39 files changed, 1407 insertions, 1425 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index b9f311ae..30a2fd65 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -66,7 +66,7 @@ search_key_user(char *passwdfile, int mode) assert(fp1); clear(); - getdata(0, 0, mode ? I18N[4] : SHM->i18nstr[cuser.language][5], key, sizeof(key), DOECHO); + getdata(0, 0, mode ? I18N[4] : I18N[5], key, sizeof(key), DOECHO); if(!key[0]) return 0; while ((fread(&user, sizeof(user), 1, fp1)) > 0 && coun < MAX_USERS) { @@ -208,7 +208,7 @@ static void bperm_msg(boardheader_t * board) { prints(I18N[20], board->brdname, - board->brdattr & BRD_POSTMASK ? I18N[21] : SHM->i18nstr[cuser.language][22]); + board->brdattr & BRD_POSTMASK ? I18N[21] : I18N[22]); } unsigned int @@ -221,10 +221,10 @@ setperms(unsigned int pbits, int *pstring) for (i = 0; i < NUMPERMS / 2; i++) { prints("%c. %-20s %-15s %c. %-20s %s\n", 'A' + i, I18N[pstring[i]], - ((pbits >> i) & 1 ? I18N[23] : SHM->i18nstr[cuser.language][24]), + ((pbits >> i) & 1 ? I18N[23] : I18N[24]), i < 10 ? 'Q' + i : '0' + i - 10, I18N[pstring[i + 16]], - ((pbits >> (i + 16)) & 1 ? I18N[25] : SHM->i18nstr[cuser.language][26])); + ((pbits >> (i + 16)) & 1 ? I18N[25] : I18N[26])); } clrtobot(); while( @@ -238,7 +238,7 @@ setperms(unsigned int pbits, int *pstring) else { pbits ^= (1 << i); move(i % 16 + 4, i <= 15 ? 24 : 64); - prints((pbits >> i) & 1 ? I18N[28] : SHM->i18nstr[cuser.language][29]); + prints((pbits >> i) & 1 ? I18N[28] : I18N[29]); } } return pbits; @@ -322,7 +322,7 @@ m_mod_board(char *bname) case 'v': memcpy(&newbh, &bh, sizeof(bh)); outs(I18N[36]); - outs((bh.brdattr & BRD_BAD) ? I18N[37] : SHM->i18nstr[cuser.language][38]); + outs((bh.brdattr & BRD_BAD) ? I18N[37] : I18N[38]); getdata(21, 0, I18N[39], genbuf, 5, LCECHO); if (genbuf[0] == 'y') { if (newbh.brdattr & BRD_BAD) @@ -353,7 +353,7 @@ m_mod_board(char *bname) memset(&bh, 0, sizeof(bh)); snprintf(bh.title, sizeof(bh.title), I18N[40], bname, cuser.userid); - post_msg("Security", bh.title, I18N[41], SHM->i18nstr[cuser.language][42]); + post_msg("Security", bh.title, I18N[41], I18N[42]); substitute_record(fn_board, &bh, sizeof(bh), bid); reset_board(bid); sort_bcache(); @@ -593,7 +593,7 @@ x_file() } aborted = vedit(fpath, NA, NULL); prints(I18N[67], fpath, - (aborted == -1) ? I18N[68] : SHM->i18nstr[cuser.language][69]); + (aborted == -1) ? I18N[68] : I18N[69]); pressanykey(); return FULLUPDATE; } @@ -778,8 +778,8 @@ auto_scan(char fdata[][STRLEN], char ans[]) int i; char temp[10]; - if (!strncmp(fdata[2], I18N[87], 2) || strstr(fdata[2], SHM->i18nstr[cuser.language][88]) - || strstr(fdata[2], I18N[89]) || strstr(fdata[2], SHM->i18nstr[cuser.language][90])) { + if (!strncmp(fdata[2], I18N[87], 2) || strstr(fdata[2], I18N[88]) + || strstr(fdata[2], I18N[89]) || strstr(fdata[2], I18N[90])) { ans[0] = '0'; return 1; } @@ -815,23 +815,23 @@ auto_scan(char fdata[][STRLEN], char ans[]) return 5; } if (strstr(fdata[3], I18N[96])) { - if (strstr(fdata[3], I18N[97]) || strstr(fdata[3], SHM->i18nstr[cuser.language][98]) || - strstr(fdata[3], I18N[99]) || strstr(fdata[3], SHM->i18nstr[cuser.language][100]) || - strstr(fdata[3], I18N[101]) || strstr(fdata[3], SHM->i18nstr[cuser.language][102]) || - strstr(fdata[3], I18N[103]) || strstr(fdata[3], SHM->i18nstr[cuser.language][104]) || - strstr(fdata[3], I18N[105]) || strstr(fdata[3], SHM->i18nstr[cuser.language][106]) || - strstr(fdata[3], I18N[107]) || strstr(fdata[3], SHM->i18nstr[cuser.language][108])) + if (strstr(fdata[3], I18N[97]) || strstr(fdata[3], I18N[98]) || + strstr(fdata[3], I18N[99]) || strstr(fdata[3], I18N[100]) || + strstr(fdata[3], I18N[101]) || strstr(fdata[3], I18N[102]) || + strstr(fdata[3], I18N[103]) || strstr(fdata[3], I18N[104]) || + strstr(fdata[3], I18N[105]) || strstr(fdata[3], I18N[106]) || + strstr(fdata[3], I18N[107]) || strstr(fdata[3], I18N[108])) good++; } else if (strstr(fdata[3], I18N[109])) good++; - if (strstr(fdata[4], I18N[110]) || strstr(fdata[4], SHM->i18nstr[cuser.language][111]) || + if (strstr(fdata[4], I18N[110]) || strstr(fdata[4], I18N[111]) || strstr(fdata[4], I18N[112])) { ans[0] = '2'; return 3; } - if (strstr(fdata[4], I18N[113]) || strstr(fdata[4], SHM->i18nstr[cuser.language][114])) { - if (strstr(fdata[4], I18N[115]) || strstr(fdata[4], SHM->i18nstr[cuser.language][116])) { + if (strstr(fdata[4], I18N[113]) || strstr(fdata[4], I18N[114])) { + if (strstr(fdata[4], I18N[115]) || strstr(fdata[4], I18N[116])) { if (strstr(fdata[4], I18N[117])) good++; } @@ -864,8 +864,8 @@ scan_register_form(char *regfile, int automode, int neednum) "uid", "ident", "name", "career", "addr", "phone", "email", NULL }; char *finfo[] = { - I18N[118], SHM->i18nstr[cuser.language][119], SHM->i18nstr[cuser.language][120], SHM->i18nstr[cuser.language][121], SHM->i18nstr[cuser.language][122], - I18N[123], SHM->i18nstr[cuser.language][124], NULL + I18N[118], I18N[119], I18N[120], I18N[121], I18N[122], + I18N[123], I18N[124], NULL }; char *reason[] = { I18N[125], @@ -945,7 +945,7 @@ scan_register_form(char *regfile, int automode, int neednum) prints(I18N[139], finfo[0], fdata[0]); prints(I18N[140], finfo[1], fdata[1]); #ifdef FOREIGN_REG - prints(I18N[141], finfo[2], fdata[2], muser.uflag2 & FOREIGN ? SHM->i18nstr[cuser.language][142] : ""); + prints(I18N[141], finfo[2], fdata[2], muser.uflag2 & FOREIGN ? I18N[142] : ""); #else prints(I18N[143], finfo[2], fdata[2]); #endif diff --git a/mbbsd/args.c b/mbbsd/args.c index bf36827b..32156517 100644 --- a/mbbsd/args.c +++ b/mbbsd/args.c @@ -1,4 +1,4 @@ -/* $Id: args.c,v 1.8 2003/06/26 01:04:03 kcwu Exp $ */ +/* $Id$ */ #include "bbs.h" #ifdef HAVE_SETPROCTITLE diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index bee3cd26..860d9628 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -5,7 +5,7 @@ static int recommend(int ent, fileheader_t * fhdr, char *direct); #ifdef ASSESS static char *badpost_reason[] = { - I18N[245], SHM->i18nstr[cuser.language][246], SHM->i18nstr[cuser.language][247] + I18N[245], I18N[246], I18N[247] }; #endif @@ -31,10 +31,10 @@ void anticrosspost() { log_file("etc/illegal_money", 1, I18N[248], cuser.userid, ctime(&now)); - post_violatelaw(cuser.userid, I18N[249], "Cross-post", SHM->i18nstr[cuser.language][250]); + post_violatelaw(cuser.userid, I18N[249], "Cross-post", I18N[250]); cuser.userlevel |= PERM_VIOLATELAW; cuser.vl_count++; - mail_by_link(I18N[251], SHM->i18nstr[cuser.language][252], + mail_by_link(I18N[251], I18N[252], BBSHOME "/etc/crosspost.txt"); u_exit("Cross Post"); exit(0); @@ -450,7 +450,7 @@ setupbidinfo(bid_t *bidinfo) static void print_bidinfo(FILE *io, bid_t bidinfo) { - char *payby[4]={ I18N[283],SHM->i18nstr[cuser.language][284],SHM->i18nstr[cuser.language][285],SHM->i18nstr[cuser.language][286]}; + char *payby[4]={ I18N[283],I18N[284],I18N[285],I18N[286]}; if(io) { if(!bidinfo.userid[0]) @@ -532,7 +532,7 @@ do_general(int isbid) } move(19, 0); prints(I18N[307], - isbid?I18N[308]:SHM->i18nstr[cuser.language][309], + isbid?I18N[308]:I18N[309], currboard, bp->title + 7); if(isbid) @@ -1177,8 +1177,8 @@ hold_gamble(int ent, fileheader_t * fhdr, char *direct) snprintf(genbuf, sizeof(genbuf), I18N[346], currboard, - i, i < 100 ? I18N[347] : i < 500 ? SHM->i18nstr[cuser.language][348] : - i < 1000 ? I18N[349] : i < 5000 ? SHM->i18nstr[cuser.language][350] : SHM->i18nstr[cuser.language][351], + i, i < 100 ? I18N[347] : i < 500 ? I18N[348] : + i < 1000 ? I18N[349] : i < 5000 ? I18N[350] : I18N[351], bp->endgamble ? I18N[352] : "", bp->endgamble ? Cdate(&bp->endgamble) : "" ); @@ -1685,8 +1685,8 @@ del_post(int ent, fileheader_t * fhdr, char *direct) else strcpy(reason, badpost_reason[i - 1]); if (!(inc_badpost(num, 1) % 10)){ - post_violatelaw(xuser.userid, I18N[400], SHM->i18nstr[cuser.language][401], SHM->i18nstr[cuser.language][402]); - mail_violatelaw(xuser.userid, I18N[403], SHM->i18nstr[cuser.language][404], SHM->i18nstr[cuser.language][405]); + post_violatelaw(xuser.userid, I18N[400], I18N[401], I18N[402]); + mail_violatelaw(xuser.userid, I18N[403], I18N[404], I18N[405]); xuser.userlevel |= PERM_VIOLATELAW; } sprintf(genbuf,I18N[406], reason, fhdr->title); @@ -2112,7 +2112,7 @@ good_post(int ent, fileheader_t * fhdr, char *direct) return DONOTHING; if(getans(fhdr->filemode & FILE_DIGEST ? - I18N[433] : SHM->i18nstr[cuser.language][434]) == 'n') + I18N[433] : I18N[434]) == 'n') return READ_REDRAW; if (fhdr->filemode & FILE_DIGEST) { @@ -2201,7 +2201,7 @@ b_changerecommend(int ent, fileheader_t * fhdr, char *direct) bp->brdattr ^= BRD_NORECOMMEND; substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); vmsg(I18N[457], - (bp->brdattr & BRD_NORECOMMEND) ? I18N[458] : SHM->i18nstr[cuser.language][459]); + (bp->brdattr & BRD_NORECOMMEND) ? I18N[458] : I18N[459]); return FULLUPDATE; } diff --git a/mbbsd/board.c b/mbbsd/board.c index c4a00ef7..8272847d 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -38,10 +38,10 @@ void imovefav(int old) char buf[5]; int new; - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][468], buf, sizeof(buf), DOECHO); + getdata(b_lines - 1, 0, I18N[468], buf, sizeof(buf), DOECHO); new = atoi(buf) - 1; if (new < 0 || brdnum <= new){ - vmsg(SHM->i18nstr[cuser.language][469]); + vmsg(I18N[469]); return; } move_in_current_folder(old, new); @@ -385,8 +385,8 @@ get_fav_type(boardstat_t *ptr) static void brdlist_foot() { - prints(SHM->i18nstr[cuser.language][471], - yank_flag == 0 ? SHM->i18nstr[cuser.language][472] : yank_flag == 1 ? SHM->i18nstr[cuser.language][473] : SHM->i18nstr[cuser.language][474]); + prints(I18N[471], + yank_flag == 0 ? I18N[472] : yank_flag == 1 ? I18N[473] : I18N[474]); } static void @@ -396,16 +396,16 @@ show_brdlist(int head, int clsflag, int newflag) if (class_bid == 1) { currstat = CLASS; myrow = 6; - showtitle(SHM->i18nstr[cuser.language][475], BBSName); + showtitle(I18N[475], BBSName); movie(0); move(1, 0); outs( - SHM->i18nstr[cuser.language][476]); + I18N[476]); } else if (clsflag) { - showtitle(SHM->i18nstr[cuser.language][477], BBSName); - prints(SHM->i18nstr[cuser.language][478], - newflag ? SHM->i18nstr[cuser.language][479] : SHM->i18nstr[cuser.language][480], - SHM->i18nstr[cuser.language][481]); + showtitle(I18N[477], BBSName); + prints(I18N[478], + newflag ? I18N[479] : I18N[480], + I18N[481]); move(b_lines, 0); brdlist_foot(); } @@ -414,11 +414,11 @@ show_brdlist(int head, int clsflag, int newflag) char *color[8] = {"", "\033[32m", "\033[33m", "\033[36m", "\033[34m", "\033[1m", "\033[1;32m", "\033[1;33m"}; - char *unread[2] = {"\33[37m \033[m", SHM->i18nstr[cuser.language][482]}; + char *unread[2] = {"\33[37m \033[m", I18N[482]}; if (yank_flag == 0 && get_fav_type(&nbrd[0]) == 0){ move(3, 0); - outs(SHM->i18nstr[cuser.language][483]); + outs(I18N[483]); return; } @@ -440,13 +440,13 @@ show_brdlist(int head, int clsflag, int newflag) else if (ptr->myattr & NBRD_FOLDER){ char *title = get_folder_title(ptr->bid); if( !newflag ) - prints(SHM->i18nstr[cuser.language][484], + prints(I18N[484], head, ptr->myattr & NBRD_TAG ? 'D' : ' ', !(cuser.uflag2 & FAVNOHILIGHT) ? "\033[1;36m" : "", title); else - prints(SHM->i18nstr[cuser.language][485], + prints(I18N[485], get_data_number(get_fav_folder(getfolder(ptr->bid))), !(cuser.uflag2 & FAVNOHILIGHT) ? "\033[1;36m" : "", title); @@ -471,7 +471,7 @@ show_brdlist(int head, int clsflag, int newflag) } if (class_bid != 1) { if (!GROUPOP() && !HasPerm(B_BH(ptr))) { - outs(SHM->i18nstr[cuser.language][486]); + outs(I18N[486]); } else { prints("%s%-13s\033[m%s%5.5s\033[0;37m%2.2s\033[m%-34.34s", @@ -486,11 +486,11 @@ show_brdlist(int head, int clsflag, int newflag) if (B_BH(ptr)->brdattr & BRD_BAD) outs(" X "); else if (B_BH(ptr)->nuser >= 5000) - outs(SHM->i18nstr[cuser.language][487]); + outs(I18N[487]); else if (B_BH(ptr)->nuser >= 2000) - outs(SHM->i18nstr[cuser.language][488]); + outs(I18N[488]); else if (B_BH(ptr)->nuser >= 1000) - outs(SHM->i18nstr[cuser.language][489]); + outs(I18N[489]); else if (B_BH(ptr)->nuser >= 100) outs("\033[1mHOT\033[m"); else if (B_BH(ptr)->nuser > 50) @@ -578,7 +578,7 @@ choose_board(int newflag) load_boards(keyword); if (brdnum <= 0 && yank_flag > 0) { if (keyword[0] != 0) { - vmsg(SHM->i18nstr[cuser.language][510]); + vmsg(I18N[510]); keyword[0] = 0; brdnum = -1; continue; @@ -728,15 +728,15 @@ choose_board(int newflag) show_brdlist(head, 1, newflag); break; case '/': - getdata_buf(b_lines - 1, 0, SHM->i18nstr[cuser.language][511], + getdata_buf(b_lines - 1, 0, I18N[511], keyword, sizeof(keyword), DOECHO); brdnum = -1; break; case 'S': if(yank_flag == 0){ move(b_lines - 2, 0); - prints(SHM->i18nstr[cuser.language][512]); - tmp = getans(SHM->i18nstr[cuser.language][513]); + prints(I18N[512]); + tmp = getans(I18N[513]); if( tmp == '1' ) fav_sort_by_name(); else if( tmp == '2' ) @@ -755,7 +755,7 @@ choose_board(int newflag) if (HAS_PERM(PERM_SYSOP)) { ptr = &nbrd[num]; if (ptr->myattr & NBRD_SYMBOLIC) { - if (getans(SHM->i18nstr[cuser.language][514]) == 'y') + if (getans(I18N[514]) == 'y') delete_symbolic_link(getbcache(ptr->bid), ptr->bid); } brdnum = -1; @@ -792,7 +792,7 @@ choose_board(int newflag) } else if (HAS_PERM(PERM_LOGINOK) && yank_flag == 0) { if (fav_add_line() == NULL) { - vmsg(SHM->i18nstr[cuser.language][515]); + vmsg(I18N[515]); break; } /* done move if it's the first item. */ @@ -815,7 +815,7 @@ choose_board(int newflag) ptr = &nbrd[num]; if (yank_flag == 0) { if (ptr->myattr & NBRD_FAV) { - if (getans(SHM->i18nstr[cuser.language][516]) != 'y') + if (getans(I18N[516]) != 'y') break; fav_remove_item(ptr->bid, get_fav_type(ptr)); ptr->myattr &= ~NBRD_FAV; @@ -828,7 +828,7 @@ choose_board(int newflag) } else { if (fav_add_board(ptr->bid) == NULL) - vmsg(SHM->i18nstr[cuser.language][517]); + vmsg(I18N[517]); else ptr->myattr |= NBRD_FAV; } @@ -850,14 +850,14 @@ choose_board(int newflag) if (HAS_PERM(PERM_LOGINOK) && yank_flag == 0) { fav_type_t *ft; if (fav_stack_full()){ - vmsg(SHM->i18nstr[cuser.language][518]); + vmsg(I18N[518]); break; } if ((ft = fav_add_folder()) == NULL) { - vmsg(SHM->i18nstr[cuser.language][519]); + vmsg(I18N[519]); break; } - fav_set_folder_title(ft, SHM->i18nstr[cuser.language][520]); + fav_set_folder_title(ft, I18N[520]); /* don't move if it's the first item */ if (get_fav_type(&nbrd[0]) != 0) move_in_current_folder(brdnum, num); @@ -869,7 +869,7 @@ choose_board(int newflag) if (HAS_PERM(PERM_LOGINOK) && nbrd[num].myattr & NBRD_FOLDER) { fav_type_t *ft = getfolder(nbrd[num].bid); strlcpy(buf, get_item_title(ft), sizeof(buf)); - getdata_buf(b_lines - 1, 0, SHM->i18nstr[cuser.language][521], buf, 65, DOECHO); + getdata_buf(b_lines - 1, 0, I18N[521], buf, 65, DOECHO); fav_set_folder_title(ft, buf); brdnum = -1; } @@ -878,14 +878,14 @@ choose_board(int newflag) if (HAS_PERM(PERM_LOGINOK)) { char c, fname[80]; if (!current_fav_at_root()) { - vmsg(SHM->i18nstr[cuser.language][522]); + vmsg(I18N[522]); break; } - c = getans(SHM->i18nstr[cuser.language][523]); + c = getans(I18N[523]); if(!c) break; - if(getans(SHM->i18nstr[cuser.language][524]) != 'y') + if(getans(I18N[524]) != 'y') break; switch(c){ case '1': @@ -901,7 +901,7 @@ choose_board(int newflag) setuserfile(fname, FAV4); sprintf(buf, "%s.bak", fname); if (!dashf(buf)){ - vmsg(SHM->i18nstr[cuser.language][525]); + vmsg(I18N[525]); break; } Copy(buf, fname); @@ -914,22 +914,22 @@ choose_board(int newflag) break; case 'z': if (HAS_PERM(PERM_LOGINOK)) - vmsg(SHM->i18nstr[cuser.language][526]); + vmsg(I18N[526]); break; case 'Z': if (HAS_PERM(PERM_LOGINOK)) { char genbuf[256]; - sprintf(genbuf, SHM->i18nstr[cuser.language][527], cuser.uflag2 & FAVNEW_FLAG ? SHM->i18nstr[cuser.language][528] : ""); + sprintf(genbuf, I18N[527], cuser.uflag2 & FAVNEW_FLAG ? I18N[528] : ""); if (getans(genbuf) != 'y') break; cuser.uflag2 ^= FAVNEW_FLAG; if (cuser.uflag2 & FAVNEW_FLAG) { subscribe_newfav(); - vmsg(SHM->i18nstr[cuser.language][529]); + vmsg(I18N[529]); } else - vmsg(SHM->i18nstr[cuser.language][530]); + vmsg(I18N[530]); } break; diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 2569a45f..6639a5c5 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -414,7 +414,7 @@ count_logins(int uid, int show) for (count = 0; (ulist[i + count] && uid == ulist[i + count]->uid); count++) { if (show) - prints(SHM->i18nstr[cuser.language][531], + prints(I18N[531], count + 1, modestring(ulist[i + count], 0), ulist[i + count]->from); } diff --git a/mbbsd/cal.c b/mbbsd/cal.c index 69aa4f24..dfc5ffdd 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -31,12 +31,12 @@ lockutmpmode(int unmode, int state) clear(); move(10, 20); if (errorno == 1) - prints(SHM->i18nstr[cuser.language][532], - SHM->i18nstr[cuser.language][ModeTypeTable[currutmp->lockmode]], - SHM->i18nstr[cuser.language][ModeTypeTable[unmode]]); + prints(I18N[532], + I18N[ModeTypeTable[currutmp->lockmode]], + I18N[ModeTypeTable[unmode]]); else - prints(SHM->i18nstr[cuser.language][533], - SHM->i18nstr[cuser.language][ModeTypeTable[unmode]]); + prints(I18N[533], + I18N[ModeTypeTable[unmode]]); pressanykey(); return errorno; } @@ -66,8 +66,8 @@ vice(int money, char *item) setuserfile(buf, VICE_NEW); log_file(buf, 1, "%8.8d\n", viceserial); snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][534], item, money, viceserial); - mail_id(cuser.userid, buf, "etc/vice.txt", SHM->i18nstr[cuser.language][535]); + I18N[534], item, money, viceserial); + mail_id(cuser.userid, buf, "etc/vice.txt", I18N[535]); return 0; } @@ -95,50 +95,50 @@ osong(char *defaultid) /* Jaky 一人一天點一首 */ if (!strcmp(buf, Cdatedate(&cuser.lastsong)) && !HAS_PERM(PERM_SYSOP)) { move(22, 0); - vmsg(SHM->i18nstr[cuser.language][536]); + vmsg(I18N[536]); unlockutmpmode(); return 0; } if (cuser.money < 200) { move(22, 0); - vmsg(SHM->i18nstr[cuser.language][537]); + vmsg(I18N[537]); unlockutmpmode(); return 0; } move(12, 0); clrtobot(); - prints(SHM->i18nstr[cuser.language][538], cuser.userid); + prints(I18N[538], cuser.userid); trans_buffer[0] = 0; if (!defaultid) { - getdata(13, 0, SHM->i18nstr[cuser.language][539], + getdata(13, 0, I18N[539], destid, sizeof(destid), DOECHO); while (!destid[0]) { - a_menu(SHM->i18nstr[cuser.language][540], SONGBOOK, 0); + a_menu(I18N[540], SONGBOOK, 0); clear(); - getdata(13, 0, SHM->i18nstr[cuser.language][541], + getdata(13, 0, I18N[541], destid, sizeof(destid), DOECHO); } } else strlcpy(destid, defaultid, sizeof(destid)); /* Heat:點歌者匿名功能 */ - getdata(14, 0, SHM->i18nstr[cuser.language][542], ano, sizeof(ano), DOECHO); + getdata(14, 0, I18N[542], ano, sizeof(ano), DOECHO); if (!destid[0]) { unlockutmpmode(); return 0; } - getdata_str(14, 0, SHM->i18nstr[cuser.language][543], say, - sizeof(say), DOECHO, SHM->i18nstr[cuser.language][544]); + getdata_str(14, 0, I18N[543], say, + sizeof(say), DOECHO, I18N[544]); snprintf(save_title, sizeof(save_title), - "%s:%s", (ano[0] == 'y') ? SHM->i18nstr[cuser.language][545] : cuser.userid, say); - getdata_str(16, 0, SHM->i18nstr[cuser.language][546], + "%s:%s", (ano[0] == 'y') ? I18N[545] : cuser.userid, say); + getdata_str(16, 0, I18N[546], receiver, sizeof(receiver), LCECHO, destid); if (!trans_buffer[0]) { - outs(SHM->i18nstr[cuser.language][547]); + outs(I18N[547]); pressanykey(); - a_menu(SHM->i18nstr[cuser.language][548], SONGBOOK, 0); + a_menu(I18N[548], SONGBOOK, 0); } if (!trans_buffer[0] || strstr(trans_buffer, "home") || strstr(trans_buffer, "boards") || !(fp = fopen(trans_buffer, "r"))) { @@ -156,14 +156,14 @@ osong(char *defaultid) unlockutmpmode(); return 0; } - strlcpy(mail.owner, SHM->i18nstr[cuser.language][549], sizeof(mail.owner)); + strlcpy(mail.owner, I18N[549], sizeof(mail.owner)); snprintf(mail.title, sizeof(mail.title), - SHM->i18nstr[cuser.language][550], - (ano[0] == 'y') ? SHM->i18nstr[cuser.language][551] : cuser.userid, destid); + I18N[550], + (ano[0] == 'y') ? I18N[551] : cuser.userid, destid); while (fgets(buf, sizeof(buf), fp)) { char *po; - if (!strncmp(buf, SHM->i18nstr[cuser.language][552], 6)) { + if (!strncmp(buf, I18N[552], 6)) { clear(); move(10, 10); outs(buf); @@ -177,7 +177,7 @@ osong(char *defaultid) po[0] = 0; snprintf(genbuf, sizeof(genbuf), "%s%s%s", buf, - (ano[0] == 'y') ? SHM->i18nstr[cuser.language][553] : cuser.userid, po + 7); + (ano[0] == 'y') ? I18N[553] : cuser.userid, po + 7); strlcpy(buf, genbuf, sizeof(buf)); } while ((po = strstr(buf, "<~Des~>"))) { @@ -204,10 +204,10 @@ osong(char *defaultid) delete_range(OSONGPATH "/.DIR", 1, nsongs - 500); } /* 把第一首拿掉 */ - vice(200, SHM->i18nstr[cuser.language][554]); + vice(200, I18N[554]); } snprintf(save_title, sizeof(save_title), - "%s:%s", (ano[0] == 'y') ? SHM->i18nstr[cuser.language][555] : cuser.userid, say); + "%s:%s", (ano[0] == 'y') ? I18N[555] : cuser.userid, say); hold_mail(filename, destid); if (receiver[0]) { @@ -219,7 +219,7 @@ osong(char *defaultid) } clear(); outs( - SHM->i18nstr[cuser.language][556]); + I18N[556]); pressanykey(); sortsong(); topsong(); @@ -250,10 +250,10 @@ inmailbox(int m) int p_cloak() { - if (getans(currutmp->invisible ? SHM->i18nstr[cuser.language][557] : SHM->i18nstr[cuser.language][558]) != 'y') + if (getans(currutmp->invisible ? I18N[557] : I18N[558]) != 'y') return 0; if (cuser.money >= 19) { - vice(19, SHM->i18nstr[cuser.language][559]); + vice(19, I18N[559]); currutmp->invisible %= 2; vmsg((currutmp->invisible ^= 1) ? MSG_CLOAKED : MSG_UNCLOAK); } @@ -264,14 +264,14 @@ p_cloak() int p_from() { - if (getans(SHM->i18nstr[cuser.language][560]) != 'y') + if (getans(I18N[560]) != 'y') return 0; reload_money(); if (cuser.money < 49) return 0; - if (getdata_buf(b_lines - 1, 0, SHM->i18nstr[cuser.language][561], + if (getdata_buf(b_lines - 1, 0, I18N[561], currutmp->from, sizeof(currutmp->from), DOECHO)) { - vice(49, SHM->i18nstr[cuser.language][562]); + vice(49, I18N[562]); currutmp->from_alias = 0; } return 0; @@ -284,11 +284,11 @@ p_exmail() int n; if (cuser.exmailbox >= MAX_EXKEEPMAIL) { - vmsg(SHM->i18nstr[cuser.language][563], MAX_EXKEEPMAIL); + vmsg(I18N[563], MAX_EXKEEPMAIL); return 0; } snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][564], cuser.exmailbox); + I18N[564], cuser.exmailbox); getdata_str(b_lines - 2, 0, buf, ans, sizeof(ans), LCECHO, "10"); @@ -302,7 +302,7 @@ p_exmail() reload_money(); if (cuser.money < n * 1000) return 0; - vice(n * 1000, SHM->i18nstr[cuser.language][565]); + vice(n * 1000, I18N[565]); inmailbox(n); return 0; } @@ -317,10 +317,10 @@ mail_redenvelop(char *from, char *to, int money, char mode) stampfile(genbuf, &fhdr); if (!(fp = fopen(genbuf, "w"))) return; - fprintf(fp, SHM->i18nstr[cuser.language][566] + fprintf(fp, I18N[566] ,from, ctime(&now), to, money); fclose(fp); - snprintf(fhdr.title, sizeof(fhdr.title), SHM->i18nstr[cuser.language][567]); + snprintf(fhdr.title, sizeof(fhdr.title), I18N[567]); strlcpy(fhdr.owner, from, sizeof(fhdr.owner)); if (mode == 'y') @@ -351,9 +351,9 @@ p_give() char id[IDLEN + 1], money_buf[20]; move(1, 0); - usercomplete(SHM->i18nstr[cuser.language][568], id); + usercomplete(I18N[568], id); if (!id[0] || !strcmp(cuser.userid, id) || - !getdata(2, 0, SHM->i18nstr[cuser.language][569], money_buf, 7, LCECHO)) + !getdata(2, 0, I18N[569], money_buf, 7, LCECHO)) return 0; money = atoi(money_buf); reload_money(); @@ -363,9 +363,9 @@ p_give() return 0; /* 繳完稅就沒錢給了 */ deumoney(searchuser(id), money - tax); demoney(-money); - log_file(FN_MONEY,1, SHM->i18nstr[cuser.language][570], + log_file(FN_MONEY,1, I18N[570], cuser.userid, id, money - tax, ctime(&now)); - mail_redenvelop(cuser.userid, id, money - tax, getans(SHM->i18nstr[cuser.language][571])); + mail_redenvelop(cuser.userid, id, money - tax, getans(I18N[571])); } return 0; } @@ -378,15 +378,15 @@ p_sysinfo(void) extern char *compile_time; load = cpuload(NULL); - cpuloadstr = (load < 5 ? SHM->i18nstr[cuser.language][572] : (load < 20 ? SHM->i18nstr[cuser.language][573] : SHM->i18nstr[cuser.language][574])); + cpuloadstr = (load < 5 ? I18N[572] : (load < 20 ? I18N[573] : I18N[574])); clear(); - showtitle(SHM->i18nstr[cuser.language][575], BBSNAME); + showtitle(I18N[575], BBSNAME); move(2, 0); - prints(SHM->i18nstr[cuser.language][576]); + prints(I18N[576]); prints(TITLE_COLOR BBSNAME); prints("\033[m (" MYIP); - prints(SHM->i18nstr[cuser.language][577], + prints(I18N[577], cpuloadstr, SHM->UTMPnumber, #ifdef DYMAX_ACTIVE GLOBALVAR[9] > 1000 ? GLOBALVAR[9] : MAX_ACTIVE, @@ -397,10 +397,10 @@ p_sysinfo(void) if (HAS_PERM(PERM_SYSOP)) { struct rusage ru; getrusage(RUSAGE_SELF, &ru); - prints(SHM->i18nstr[cuser.language][578], + prints(I18N[578], ((int)sbrk(0) - 0x8048000) / 1024, (int)ru.ru_idrss, (int)ru.ru_isrss); - prints(SHM->i18nstr[cuser.language][579] + prints(I18N[579] #ifdef CRITICAL_MEMORY " CRITICAL_MEMORY" #endif diff --git a/mbbsd/calendar.c b/mbbsd/calendar.c index 5cb644c2..85f602ce 100644 --- a/mbbsd/calendar.c +++ b/mbbsd/calendar.c @@ -188,15 +188,15 @@ FreeCalBuffer(char **buf) static int GenerateCalendar(char **buf, int y, int m, int today, event_t * e) { - char *week_str[7] = {"日", "一", "二", "三", "四", "五", "六"}; + char *week_str[7] = {SHM->i18nstr[cuser.language][2741], SHM->i18nstr[cuser.language][2742], SHM->i18nstr[cuser.language][2743], SHM->i18nstr[cuser.language][2744], SHM->i18nstr[cuser.language][2745], SHM->i18nstr[cuser.language][2746], SHM->i18nstr[cuser.language][2747]}; char *month_color[12] = { "\33[1;32m", "\33[1;33m", "\33[1;35m", "\33[1;36m", "\33[1;32m", "\33[1;33m", "\33[1;35m", "\33[1;36m", "\33[1;32m", "\33[1;33m", "\33[1;35m", "\33[1;36m" }; char *month_str[12] = { - "一月 ", "二月 ", "三月 ", "四月 ", "五月 ", "六月 ", - "七月 ", "八月 ", "九月 ", "十月 ", "十一月", "十二月" + SHM->i18nstr[cuser.language][2748], SHM->i18nstr[cuser.language][2749], SHM->i18nstr[cuser.language][2750], SHM->i18nstr[cuser.language][2751], SHM->i18nstr[cuser.language][2752], SHM->i18nstr[cuser.language][2753], + SHM->i18nstr[cuser.language][2754], SHM->i18nstr[cuser.language][2755], SHM->i18nstr[cuser.language][2756], SHM->i18nstr[cuser.language][2757], SHM->i18nstr[cuser.language][2758], SHM->i18nstr[cuser.language][2759] }; char *p, attr1[16], *attr2; @@ -292,7 +292,7 @@ calendar() for (i = 0; i < 22; i++) { outs(buf[i]); if (i == 0) { - prints("\t\33[1;37m現在是 %d.%02d.%02d %2d:%02d:%02d%cm\33[m", + prints(SHM->i18nstr[cuser.language][2760], snow.tm_year + 1900, snow.tm_mon + 1, snow.tm_mday, (snow.tm_hour == 0 || snow.tm_hour == 12) ? 12 : snow.tm_hour % 12, snow.tm_min, snow.tm_sec, diff --git a/mbbsd/card.c b/mbbsd/card.c index 1b20cd41..97cb170b 100644 --- a/mbbsd/card.c +++ b/mbbsd/card.c @@ -31,7 +31,7 @@ static int card_select(int *now) { char *cc[2] = {"\033[44m \033[m", - SHM->i18nstr[cuser.language][580]}; + I18N[580]}; while (1) { move(20, 0); @@ -79,55 +79,55 @@ static void card_display(int cline, int number, int flower, int show) { int color = 31; - char *cn[13] = {SHM->i18nstr[cuser.language][581], SHM->i18nstr[cuser.language][582], SHM->i18nstr[cuser.language][583], SHM->i18nstr[cuser.language][584], SHM->i18nstr[cuser.language][585], SHM->i18nstr[cuser.language][586], - SHM->i18nstr[cuser.language][587], SHM->i18nstr[cuser.language][588], SHM->i18nstr[cuser.language][589], "10", SHM->i18nstr[cuser.language][590], SHM->i18nstr[cuser.language][591], SHM->i18nstr[cuser.language][592]}; + char *cn[13] = {I18N[581], I18N[582], I18N[583], I18N[584], I18N[585], I18N[586], + I18N[587], I18N[588], I18N[589], "10", I18N[590], I18N[591], I18N[592]}; if (flower == 0 || flower == 3) color = 36; if ((show < 0) && (cline > 1 && cline < 8)) - prints(SHM->i18nstr[cuser.language][593]); + prints(I18N[593]); else switch (cline) { case 1: - prints(SHM->i18nstr[cuser.language][594]); + prints(I18N[594]); break; case 2: - prints(SHM->i18nstr[cuser.language][595], color, cn[number - 1]); + prints(I18N[595], color, cn[number - 1]); break; case 3: if (flower == 1) - prints(SHM->i18nstr[cuser.language][596], color); + prints(I18N[596], color); else - prints(SHM->i18nstr[cuser.language][597], color); + prints(I18N[597], color); break; case 4: if (flower == 1) - prints(SHM->i18nstr[cuser.language][598], color); + prints(I18N[598], color); else if (flower == 3) - prints(SHM->i18nstr[cuser.language][599], color); + prints(I18N[599], color); else - prints(SHM->i18nstr[cuser.language][600], color); + prints(I18N[600], color); break; case 5: if (flower == 0) - prints(SHM->i18nstr[cuser.language][601], color); + prints(I18N[601], color); else if (flower == 3) - prints(SHM->i18nstr[cuser.language][602], color); + prints(I18N[602], color); else - prints(SHM->i18nstr[cuser.language][603], color); + prints(I18N[603], color); break; case 6: if (flower == 0) - prints(SHM->i18nstr[cuser.language][604], color); + prints(I18N[604], color); else if (flower == 3) - prints(SHM->i18nstr[cuser.language][605], color); + prints(I18N[605], color); else - prints(SHM->i18nstr[cuser.language][606], color); + prints(I18N[606], color); break; case 7: - prints(SHM->i18nstr[cuser.language][607], color, cn[number - 1]); + prints(I18N[607], color, cn[number - 1]); break; case 8: - prints(SHM->i18nstr[cuser.language][608]); + prints(I18N[608]); break; } } @@ -176,11 +176,11 @@ card_start(char name[]) clear(); stand_title(name); move(1, 0); - prints(SHM->i18nstr[cuser.language][609]); + prints(I18N[609]); move(10, 0); - prints(SHM->i18nstr[cuser.language][610]); + prints(I18N[610]); move(19, 0); - prints(SHM->i18nstr[cuser.language][611]); + prints(I18N[611]); } static int @@ -262,14 +262,14 @@ card_99() int cpu[5], c[5], me[5], m[5]; int cards[52]; int count = 0; - char *ff[4] = {SHM->i18nstr[cuser.language][612], SHM->i18nstr[cuser.language][613], - SHM->i18nstr[cuser.language][614], SHM->i18nstr[cuser.language][615]}; - char *cn[13] = {SHM->i18nstr[cuser.language][616], SHM->i18nstr[cuser.language][617], SHM->i18nstr[cuser.language][618], SHM->i18nstr[cuser.language][619], SHM->i18nstr[cuser.language][620], SHM->i18nstr[cuser.language][621], - SHM->i18nstr[cuser.language][622], SHM->i18nstr[cuser.language][623], SHM->i18nstr[cuser.language][624], "10", SHM->i18nstr[cuser.language][625], SHM->i18nstr[cuser.language][626], SHM->i18nstr[cuser.language][627]}; + char *ff[4] = {I18N[612], I18N[613], + I18N[614], I18N[615]}; + char *cn[13] = {I18N[616], I18N[617], I18N[618], I18N[619], I18N[620], I18N[621], + I18N[622], I18N[623], I18N[624], "10", I18N[625], I18N[626], I18N[627]}; for (i = 0; i < 5; i++) cpu[i] = c[i] = me[i] = m[i] = -1; setutmpmode(CARD_99); - card_start(SHM->i18nstr[cuser.language][628]); + card_start(I18N[628]); card_new(cards); for (i = 0; i < 5; i++) { cpu[i] = card_give(cards); @@ -281,8 +281,8 @@ card_99() turn = 1; move(21, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][629], count, 99 - count); - prints(SHM->i18nstr[cuser.language][630]); + prints(I18N[629], count, 99 - count); + prints(I18N[630]); while (1) { i = card_select(&j); if (i == 0) /* 放棄遊戲 */ @@ -290,7 +290,7 @@ card_99() count = card_99_add(card_number(me[j]), i, count); move(21 + (turn / 2) % 2, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][631], + prints(I18N[631], turn, ff[card_flower(me[j])], cn[card_number(me[j]) - 1], count, 99 - count); me[j] = card_give(cards); @@ -302,14 +302,14 @@ card_99() if (count > 99) { move(22, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][632], + prints(I18N[632], turn, count, 99 - count); pressanykey(); return 0; } i = card_99_cpu(cpu, &count); move(21 + (turn / 2 + 1) % 2, 40); - prints(SHM->i18nstr[cuser.language][633], + prints(I18N[633], turn, ff[card_flower(cpu[i])], cn[card_number(cpu[i]) - 1], count, 99 - count); cpu[i] = card_give(cards); @@ -319,7 +319,7 @@ card_99() if (count > 99) { move(22, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][634], + prints(I18N[634], turn, count, 99 - count); pressanykey(); return 0; @@ -372,7 +372,7 @@ card_double_ask() char buf[100], buf2[3]; snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][635], + I18N[635], cuser.userid, cuser.money, JACK); reload_money(); if (cuser.money < JACK) @@ -388,7 +388,7 @@ card_ask() { char buf[100], buf2[3]; - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][636], + snprintf(buf, sizeof(buf), I18N[636], cuser.userid, cuser.money); getdata(20, 0, buf, buf2, sizeof(buf2), LCECHO); if (buf2[0] == 'y' || buf2[0] == 'Y') @@ -432,13 +432,13 @@ card_jack(int *db) if ((*db) < 0) { card_new(cards); - card_start(SHM->i18nstr[cuser.language][637]); + card_start(I18N[637]); for (i = 0; i < 2; i++) { cpu[i] = card_give(cards); me[i] = card_give(cards); } } else { - card_start(SHM->i18nstr[cuser.language][638]); + card_start(I18N[638]); cpu[0] = card_give(cards); cpu[1] = card_give(cards); me[0] = *db; @@ -450,11 +450,11 @@ card_jack(int *db) (card_number(me[1]) == 0 && card_number(me[0]) == 12)) { if (card_flower(me[0]) == 0 && card_flower(me[1]) == 0) { game_log(JACK, JACK * 10); - vmsg(SHM->i18nstr[cuser.language][639], JACK * 10); + vmsg(I18N[639], JACK * 10); return 0; } else { game_log(JACK, JACK * 5); - vmsg(SHM->i18nstr[cuser.language][640], JACK * 5); + vmsg(I18N[640], JACK * 5); return 0; } } @@ -463,7 +463,7 @@ card_jack(int *db) c[0] = 1; card_show(cpu, c, me, m); game_log(JACK, 0); - vmsg(SHM->i18nstr[cuser.language][641]); + vmsg(I18N[641]); return 0; } if ((*db < 0) && (card_number(me[0]) == card_number(me[1])) && @@ -479,20 +479,20 @@ card_jack(int *db) card_show(cpu, c, me, m); if (card_alls_lower(me) > 21) { game_log(JACK, 0); - vmsg(SHM->i18nstr[cuser.language][642]); + vmsg(I18N[642]); return 0; } i++; if ((i == 3) && (card_number(me[0]) == 7) && (card_number(me[1]) == 7) && (card_number(me[2]) == 7)) { game_log(JACK, JACK * 7); - vmsg(SHM->i18nstr[cuser.language][643], JACK * 7); + vmsg(I18N[643], JACK * 7); return 0; } } if (i == 5) { /* 過五關 */ game_log(JACK, JACK * 5); - vmsg(SHM->i18nstr[cuser.language][644], 5 * JACK); + vmsg(I18N[644], 5 * JACK); return 0; } j = 2; @@ -504,14 +504,14 @@ card_jack(int *db) if (card_alls_lower(cpu) > 21) { card_show(cpu, c, me, m); game_log(JACK, JACK * 2); - vmsg(SHM->i18nstr[cuser.language][645], JACK * 2); + vmsg(I18N[645], JACK * 2); return 0; } j++; } card_show(cpu, c, me, m); game_log(JACK, 0); - vmsg(SHM->i18nstr[cuser.language][646]); + vmsg(I18N[646]); return 0; } @@ -525,16 +525,16 @@ g_card_jack() while (1) { reload_money(); if (cuser.money < JACK) { - outs(SHM->i18nstr[cuser.language][647]); + outs(I18N[647]); return 0; } - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][648], + getdata(b_lines - 1, 0, I18N[648], buf, 3, LCECHO); if ((*buf != 'y') && (*buf != 'Y')) break; else { db = -1; - vice(PMONEY, SHM->i18nstr[cuser.language][649]); + vice(PMONEY, I18N[649]); card_jack(&db); if (db >= 0) card_jack(&db); @@ -563,7 +563,7 @@ ten_helf() int cpu[5], c[5], me[5], m[5]; int cards[52]; - card_start(SHM->i18nstr[cuser.language][650]); + card_start(I18N[650]); card_new(cards); for (i = 0; i < 5; i++) cpu[i] = c[i] = me[i] = m[i] = -1; @@ -579,14 +579,14 @@ ten_helf() card_show(cpu, c, me, m); if (card_all(me) > 21) { game_log(TEN_HALF, 0); - vmsg(SHM->i18nstr[cuser.language][651]); + vmsg(I18N[651]); return 0; } i++; } if (i == 5) { /* 過五關 */ game_log(TEN_HALF, PMONEY * 5); - vmsg(SHM->i18nstr[cuser.language][652], 5 * PMONEY); + vmsg(I18N[652], 5 * PMONEY); return 0; } j = 1; @@ -598,14 +598,14 @@ ten_helf() if (card_all(cpu) > 21) { card_show(cpu, c, me, m); game_log(TEN_HALF, PMONEY * 2); - vmsg(SHM->i18nstr[cuser.language][653], PMONEY * 2); + vmsg(I18N[653], PMONEY * 2); return 0; } j++; } card_show(cpu, c, me, m); game_log(TEN_HALF, 0); - vmsg(SHM->i18nstr[cuser.language][654]); + vmsg(I18N[654]); return 0; } @@ -618,16 +618,16 @@ g_ten_helf() while (1) { reload_money(); if (cuser.money < TEN_HALF) { - outs(SHM->i18nstr[cuser.language][655]); + outs(I18N[655]); return 0; } getdata(b_lines - 1, 0, - SHM->i18nstr[cuser.language][656], + I18N[656], buf, 3, LCECHO); if (buf[0] != 'y' && buf[0] != 'Y') return 0; else { - vice(PMONEY, SHM->i18nstr[cuser.language][657]); + vice(PMONEY, I18N[657]); ten_helf(); } } diff --git a/mbbsd/chat.c b/mbbsd/chat.c index 53066280..ee08b9b8 100644 --- a/mbbsd/chat.c +++ b/mbbsd/chat.c @@ -18,7 +18,7 @@ printchatline(char *str) } outs(str); outc('\n'); - outs(SHM->i18nstr[cuser.language][658]); + outs(I18N[658]); if (flog) fprintf(flog, "%s\n", str); @@ -34,7 +34,7 @@ chat_clear() move(b_lines, 0); clrtoeol(); move(chatline = 2, 0); - outs(SHM->i18nstr[cuser.language][659]); + outs(I18N[659]); } static void @@ -92,7 +92,7 @@ chat_recv(int fd, char chatroom[IDLEN], char *chatid) case 't': move(0, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][660], + prints(I18N[660], chatroom, bptr + 2); } } else @@ -131,7 +131,7 @@ printuserent(userinfo_t * uentp) uentp->invisible ? '#' : ' ', modestring(uentp, 1)); if (cnt < 2) - strcat(pline, SHM->i18nstr[cuser.language][661]); + strcat(pline, I18N[661]); strcat(uline, pline); if (++cnt == 3) { printchatline(uline); @@ -154,30 +154,30 @@ static void chat_help(char *arg) { if (strstr(arg, " op")) { - printchatline(SHM->i18nstr[cuser.language][662]); - chathelp("[/f]lag [+-][ls]", SHM->i18nstr[cuser.language][663]); - chathelp("[/i]nvite <id>", SHM->i18nstr[cuser.language][664]); - chathelp("[/k]ick <id>", SHM->i18nstr[cuser.language][665]); - chathelp("[/o]p <id>", SHM->i18nstr[cuser.language][666]); - chathelp("[/t]opic <text>", SHM->i18nstr[cuser.language][667]); - chathelp("[/w]all", SHM->i18nstr[cuser.language][668]); + printchatline(I18N[662]); + chathelp("[/f]lag [+-][ls]", I18N[663]); + chathelp("[/i]nvite <id>", I18N[664]); + chathelp("[/k]ick <id>", I18N[665]); + chathelp("[/o]p <id>", I18N[666]); + chathelp("[/t]opic <text>", I18N[667]); + chathelp("[/w]all", I18N[668]); } else { - chathelp("[//]help", SHM->i18nstr[cuser.language][669]); - chathelp("[/.]help", SHM->i18nstr[cuser.language][670]); - chathelp("[/h]elp op", SHM->i18nstr[cuser.language][671]); - chathelp("[/a]ct <msg>", SHM->i18nstr[cuser.language][672]); - chathelp("[/b]ye [msg]", SHM->i18nstr[cuser.language][673]); - chathelp("[/c]lear", SHM->i18nstr[cuser.language][674]); - chathelp("[/j]oin <room>", SHM->i18nstr[cuser.language][675]); - chathelp("[/l]ist [room]", SHM->i18nstr[cuser.language][676]); - chathelp("[/m]sg <id> <msg>", SHM->i18nstr[cuser.language][677]); - chathelp("[/n]ick <id>", SHM->i18nstr[cuser.language][678]); - chathelp("[/p]ager", SHM->i18nstr[cuser.language][679]); - chathelp("[/q]uery", SHM->i18nstr[cuser.language][680]); - chathelp("[/r]oom", SHM->i18nstr[cuser.language][681]); - chathelp("[/u]sers", SHM->i18nstr[cuser.language][682]); - chathelp("[/w]ho", SHM->i18nstr[cuser.language][683]); - chathelp("[/w]hoin <room>", SHM->i18nstr[cuser.language][684]); + chathelp("[//]help", I18N[669]); + chathelp("[/.]help", I18N[670]); + chathelp("[/h]elp op", I18N[671]); + chathelp("[/a]ct <msg>", I18N[672]); + chathelp("[/b]ye [msg]", I18N[673]); + chathelp("[/c]lear", I18N[674]); + chathelp("[/j]oin <room>", I18N[675]); + chathelp("[/l]ist [room]", I18N[676]); + chathelp("[/m]sg <id> <msg>", I18N[677]); + chathelp("[/n]ick <id>", I18N[678]); + chathelp("[/p]ager", I18N[679]); + chathelp("[/q]uery", I18N[680]); + chathelp("[/r]oom", I18N[681]); + chathelp("[/u]sers", I18N[682]); + chathelp("[/w]ho", I18N[683]); + chathelp("[/w]hoin <room>", I18N[684]); } } @@ -187,7 +187,7 @@ chat_date() char genbuf[200]; snprintf(genbuf, sizeof(genbuf), - SHM->i18nstr[cuser.language][686], BBSNAME, Cdate(&now)); + I18N[686], BBSNAME, Cdate(&now)); printchatline(genbuf); } @@ -196,8 +196,8 @@ chat_pager() { char genbuf[200]; - char *msgs[] = {SHM->i18nstr[cuser.language][687], SHM->i18nstr[cuser.language][688], SHM->i18nstr[cuser.language][689], SHM->i18nstr[cuser.language][690], SHM->i18nstr[cuser.language][691]}; - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][692], + char *msgs[] = {I18N[687], I18N[688], I18N[689], I18N[690], I18N[691]}; + snprintf(genbuf, sizeof(genbuf), I18N[692], msgs[currutmp->pager = (currutmp->pager + 1) % 5]); printchatline(genbuf); } @@ -214,14 +214,14 @@ chat_query(char *arg) char buf[128], *ptr; FILE *fp; - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][693], + snprintf(buf, sizeof(buf), I18N[693], xuser.userid, xuser.username, xuser.numlogins, xuser.numposts); printchatline(buf); snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][694], Cdate(&xuser.lastlogin), - (xuser.lasthost[0] ? xuser.lasthost : SHM->i18nstr[cuser.language][695])); + I18N[694], Cdate(&xuser.lastlogin), + (xuser.lasthost[0] ? xuser.lasthost : I18N[695])); printchatline(buf); sethomefile(buf, xuser.userid, fn_plans); @@ -242,13 +242,13 @@ static void chat_users() { char buf[256]; - snprintf(buf, sizeof(buf), "%s%s%s", SHM->i18nstr[cuser.language][696], BBSNAME, SHM->i18nstr[cuser.language][697]); + snprintf(buf, sizeof(buf), "%s%s%s", I18N[696], BBSNAME, I18N[697]); printchatline(""); printchatline(buf); printchatline(msg_shortulist); if (apply_ulist(printuserent) == -1) - printchatline(SHM->i18nstr[cuser.language][698]); + printchatline(I18N[698]); printuserent(NULL); } @@ -309,7 +309,7 @@ t_chat() int chatting = YEA; char fpath[80]; - outs(SHM->i18nstr[cuser.language][699]); + outs(I18N[699]); if (!(h = gethostbyname("localhost"))) { perror("gethostbyname"); return -1; @@ -323,7 +323,7 @@ t_chat() sin.sin_port = htons(NEW_CHATPORT); cfd = socket(sin.sin_family, SOCK_STREAM, 0); if (connect(cfd, (struct sockaddr *) & sin, sizeof sin) != 0) { - outs(SHM->i18nstr[cuser.language][700]); + outs(I18N[700]); system("bin/xchatd"); pressanykey(); close(cfd); @@ -331,7 +331,7 @@ t_chat() } while (1) { - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][701], chatid, 9, DOECHO); + getdata(b_lines - 1, 0, I18N[701], chatid, 9, DOECHO); if(!chatid[0]) strlcpy(chatid, cuser.userid, sizeof(chatid)); chatid[8] = '\0'; @@ -348,11 +348,11 @@ t_chat() if (!strcmp(inbuf, CHAT_LOGIN_OK)) break; else if (!strcmp(inbuf, CHAT_LOGIN_EXISTS)) - ptr = SHM->i18nstr[cuser.language][702]; + ptr = I18N[702]; else if (!strcmp(inbuf, CHAT_LOGIN_INVALID)) - ptr = SHM->i18nstr[cuser.language][703]; + ptr = I18N[703]; else if (!strcmp(inbuf, CHAT_LOGIN_BOGUS)) - ptr = SHM->i18nstr[cuser.language][704]; + ptr = I18N[704]; move(b_lines - 2, 0); outs(ptr); @@ -376,7 +376,7 @@ t_chat() move(STOP_LINE, 0); outs(msg_seperator); move(STOP_LINE, 60); - outs(SHM->i18nstr[cuser.language][705]); + outs(I18N[705]); move(1, 0); outs(msg_seperator); print_chatid(chatid); @@ -413,7 +413,7 @@ t_chat() if (!newmail && currutmp->mailalert) { newmail = 1; - printchatline(SHM->i18nstr[cuser.language][706]); + printchatline(I18N[706]); } if (ch == I_OTHERDATA) {/* incoming */ if (chat_recv(cfd, chatroom, chatid) == -1) { @@ -514,7 +514,7 @@ t_chat() fclose(flog); more(fpath, NA); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][707], + getdata(b_lines - 1, 0, I18N[707], ans, sizeof(ans), LCECHO); if (*ans == 'm') { fileheader_t mymail; @@ -524,8 +524,8 @@ t_chat() sethomepath(genbuf, cuser.userid); stampfile(genbuf, &mymail); mymail.filemode = FILE_READ ; - strlcpy(mymail.owner, SHM->i18nstr[cuser.language][708], sizeof(mymail.owner)); - strlcpy(mymail.title, SHM->i18nstr[cuser.language][709], sizeof(mymail.title)); + strlcpy(mymail.owner, I18N[708], sizeof(mymail.owner)); + strlcpy(mymail.title, I18N[709], sizeof(mymail.title)); sethomedir(title, cuser.userid); append_record(title, &mymail, sizeof(mymail)); Rename(fpath, genbuf); diff --git a/mbbsd/chc.c b/mbbsd/chc.c index b5bd8696..c0a040a9 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -111,7 +111,7 @@ getstep(board_t board, rc_t *from, rc_t *to) fc = (turn == (chc_my ^ 1) ? from->c + 1 : 9 - from->c); tc = (turn == (chc_my ^ 1) ? to->c + 1 : 9 - to->c); if (from->r == to->r) - dir = SHM->i18nstr[cuser.language][758]; + dir = I18N[758]; else { if (from->c == to->c) tc = from->r - to->r; @@ -120,9 +120,9 @@ getstep(board_t board, rc_t *from, rc_t *to) if ((turn == (chc_my ^ 1) && to->r > from->r) || (turn == chc_my && to->r < from->r)) - dir = SHM->i18nstr[cuser.language][759]; + dir = I18N[759]; else - dir = SHM->i18nstr[cuser.language][760]; + dir = I18N[760]; } sprintf(buf, "%s%s%s%s", chess_str[turn][CHE_P(board[from->r][from->c])], @@ -139,7 +139,7 @@ showstep(board_t board) eatten = board[chc_to.r][chc_to.c]; if (eatten) - prints(SHM->i18nstr[cuser.language][761], + prints(I18N[761], CHE_O(eatten) == 0 ? BLACK_COLOR : RED_COLOR, chess_str[CHE_O(eatten)][CHE_P(eatten)]); prints("\033[m"); @@ -153,8 +153,8 @@ chc_drawline(board_t board, chcusr_t *user1, chcusr_t *user2, int line) move(line, 0); clrtoeol(); if (line == 0) { - prints(SHM->i18nstr[cuser.language][762], - user1->userid, user2->userid, chc_mode & CHC_WATCH ? SHM->i18nstr[cuser.language][763] : ""); + prints(I18N[762], + user1->userid, user2->userid, chc_mode & CHC_WATCH ? I18N[763] : ""); } else if (line >= 3 && line <= 21) { outs(" "); for (i = 0; i < 9; i++) { @@ -181,25 +181,25 @@ chc_drawline(board_t board, chcusr_t *user1, chcusr_t *user2, int line) if (line >= 3 && line < 3 + (int)dim(hint_str)) { outs(hint_str[line - 3]); } else if (line == SIDE_ROW) { - prints(SHM->i18nstr[cuser.language][764], + prints(I18N[764], chc_my == 0 ? BLACK_COLOR : RED_COLOR, - SHM->i18nstr[cuser.language][710 + chc_my]); + I18N[710 + chc_my]); } else if (line == TURN_ROW) { prints("%s%s\033[m", TURN_COLOR, - chc_my == chc_turn ? SHM->i18nstr[cuser.language][765] : SHM->i18nstr[cuser.language][766]); + chc_my == chc_turn ? I18N[765] : I18N[766]); } else if (line == STEP_ROW && !chc_firststep) { showstep(board); } else if (line == TIME_ROW) { - prints(SHM->i18nstr[cuser.language][767], chc_lefttime / 60, chc_lefttime % 60); + prints(I18N[767], chc_lefttime / 60, chc_lefttime % 60); } else if (line == WARN_ROW) { outs(chc_warnmsg); } else if (line == MYWIN_ROW) { - prints(SHM->i18nstr[cuser.language][768], + prints(I18N[768], user1->userid, user1->win, user1->lose - 1, user1->tie); } else if (line == HISWIN_ROW) { - prints(SHM->i18nstr[cuser.language][769], + prints(I18N[769], user2->userid, user2->win, user2->lose - 1, user2->tie); } @@ -334,21 +334,21 @@ chc_init_board(board_t board) board[6][6] = board[6][8] = CHE(7, chc_my); /* 兵 */ for (i = 1; i < 10; i++) { - num_str[i] = SHM->i18nstr[cuser.language][711 + i]; + num_str[i] = I18N[711 + i]; } num_str[0] = ""; for (i = 0; i < 2; i++) for (j = 1; j < 8; j++) { - chess_str[i][j] = SHM->i18nstr[cuser.language][720 + i * 7 + j]; + chess_str[i][j] = I18N[720 + i * 7 + j]; } chess_str[0][0] = chess_str[1][0] = " "; for (i = 0; i < BRD_ROW * 2 - 1; i++) - chess_brd[i] = SHM->i18nstr[cuser.language][735 + i]; + chess_brd[i] = I18N[735 + i]; for (i = 0; i < 4; i++) - hint_str[i] = SHM->i18nstr[cuser.language][754 + i]; + hint_str[i] = I18N[754 + i]; } static void @@ -579,7 +579,7 @@ hisplay(int s, chcusr_t *user1, chcusr_t *user2, board_t board, board_t tmpbrd) } else { if (chc_from.r == -1) { chc_hepass = 1; - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][770], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[770], sizeof(chc_warnmsg)); chc_drawline(board, user1, user2, WARN_ROW); } else { /* 座標變換 @@ -672,7 +672,7 @@ myplay(int s, chcusr_t *user1, chcusr_t *user2, board_t board, board_t tmpbrd) chc_ipass = 1; chc_from.r = -1; chc_broadcast_send(act_list, board); - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][771], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[771], sizeof(chc_warnmsg)); chc_drawline(board, user1, user2, WARN_ROW); bell(); break; @@ -703,7 +703,7 @@ myplay(int s, chcusr_t *user1, chcusr_t *user2, board_t board, board_t tmpbrd) chc_drawline(board, user1, user2, LTR(chc_to.r)); endturn = 1; } else { - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][772], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[772], sizeof(chc_warnmsg)); bell(); chc_drawline(board, user1, user2, WARN_ROW); } @@ -733,7 +733,7 @@ mainloop(int s, chcusr_t *user1, chcusr_t *user2, board_t board, play_func_t pla chc_firststep = 0; chc_drawline(board, user1, user2, TURN_ROW); if (chc_ischeck(board, chc_turn)) { - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][773], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[773], sizeof(chc_warnmsg)); bell(); } else chc_warnmsg[0] = 0; @@ -743,15 +743,15 @@ mainloop(int s, chcusr_t *user1, chcusr_t *user2, board_t board, play_func_t pla if (chc_mode & CHC_VERSUS) { if (endgame == 1) { - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][774], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[774], sizeof(chc_warnmsg)); user1->win++; currutmp->chc_win++; } else if (endgame == 2) { - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][775], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[775], sizeof(chc_warnmsg)); user1->lose++; currutmp->chc_lose++; } else { - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][776], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[776], sizeof(chc_warnmsg)); user1->tie++; currutmp->chc_tie++; } @@ -760,17 +760,17 @@ mainloop(int s, chcusr_t *user1, chcusr_t *user2, board_t board, play_func_t pla passwd_update(usernum, &cuser); } else if (chc_mode & CHC_WATCH) { - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][777], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[777], sizeof(chc_warnmsg)); } else { - strlcpy(chc_warnmsg, SHM->i18nstr[cuser.language][778], sizeof(chc_warnmsg)); + strlcpy(chc_warnmsg, I18N[778], sizeof(chc_warnmsg)); } chc_log("=> "); if (endgame == 3) - chc_log(SHM->i18nstr[cuser.language][779]); + chc_log(I18N[779]); else{ - sprintf(buf, SHM->i18nstr[cuser.language][780], chc_my && endgame == 1 ? SHM->i18nstr[cuser.language][781] : SHM->i18nstr[cuser.language][782]); + sprintf(buf, I18N[780], chc_my && endgame == 1 ? I18N[781] : I18N[782]); chc_log(buf); } @@ -911,7 +911,7 @@ chc(int s, int mode) setuserfile(file, CHC_LOG); if (chc_log_open(&user1, &user2, file) < 0) - vmsg(SHM->i18nstr[cuser.language][783]); + vmsg(I18N[783]); mainloop(s, &user1, &user2, board, play_func); @@ -929,13 +929,13 @@ chc(int s, int mode) currutmp->mode = mode0; - if (getans(SHM->i18nstr[cuser.language][784]) == 'y') { + if (getans(I18N[784]) == 'y') { char title[80]; sprintf(title, "%s V.S. %s", user1.userid, user2.userid); chc_log("\n--\n\n"); chc_log_poem(); chc_log_close(); - mail_id(cuser.userid, title, file, SHM->i18nstr[cuser.language][785]); + mail_id(cuser.userid, title, file, I18N[785]); } else chc_log_close(); @@ -948,7 +948,7 @@ chc_init_utmp(void) char uident[16]; userinfo_t *uin; - stand_title(SHM->i18nstr[cuser.language][786]); + stand_title(I18N[786]); generalnamecomplete(msg_uid, uident, sizeof(uident), SHM->UTMPnumber, completeutmp_compar, @@ -999,11 +999,11 @@ chc_watch(void) if (uin->uid == currutmp->uid || uin->mode != CHC) return -1; - if (getans(SHM->i18nstr[cuser.language][787]) != 'y') + if (getans(I18N[787]) != 'y') return 0; if ((sock = make_connection_to_somebody(uin, 10)) < 0) { - vmsg(SHM->i18nstr[cuser.language][788]); + vmsg(I18N[788]); return -1; } msgsock = accept(sock, (struct sockaddr *) 0, (socklen_t *) 0); diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index 2c63f274..fe075e9c 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -85,8 +85,8 @@ new_chicken() clear(); move(2, 0); - outs(SHM->i18nstr[cuser.language][867]); - i = getans(SHM->i18nstr[cuser.language][868]); + outs(I18N[867]); + i = getans(I18N[868]); i -= 'a'; if (i < 0 || i > NUM_KINDS - 1) @@ -97,15 +97,15 @@ new_chicken() reload_money(); price = egg_price[(int)mychicken->type]; if (cuser.money < price) { - vmsg(SHM->i18nstr[cuser.language][869], price); + vmsg(I18N[869], price); return 0; } - vice(price, SHM->i18nstr[cuser.language][870]); + vice(price, I18N[870]); while (strlen(mychicken->name) < 3) - getdata(8, 0, SHM->i18nstr[cuser.language][871], mychicken->name, + getdata(8, 0, I18N[871], mychicken->name, sizeof(mychicken->name), DOECHO); - log_file(CHICKENLOG, 1, SHM->i18nstr[cuser.language][872], + log_file(CHICKENLOG, 1, I18N[872], cuser.userid, mychicken->name, chicken_type[(int)mychicken->type], ctime(&now)); mychicken->lastvisit = mychicken->birthday = mychicken->cbirth = now; @@ -151,11 +151,11 @@ show_chicken_stat(chicken_t * thechicken) struct tm *ptime; ptime = localtime(&thechicken->birthday); - prints(SHM->i18nstr[cuser.language][873], + prints(I18N[873], thechicken->name, chicken_type[(int)thechicken->type], 15 - strlen(thechicken->name), "", ptime->tm_year % 100, ptime->tm_mon + 1, ptime->tm_mday, - SHM->i18nstr[cuser.language][age > 16 ? 789 : age + 789], + I18N[age > 16 ? 789 : age + 789], age, thechicken->hp, thechicken->hp_max, thechicken->mm, thechicken->mm_max, thechicken->attack, thechicken->run, thechicken->book, @@ -180,7 +180,7 @@ show_chicken_data(chicken_t * thechicken, chicken_t * pkchicken) /* Ptt:debug */ thechicken->type %= NUM_KINDS; clear(); - showtitle(pkchicken ? SHM->i18nstr[cuser.language][874] : SHM->i18nstr[cuser.language][875], BBSName); + showtitle(pkchicken ? I18N[874] : I18N[875], BBSName); move(1, 0); show_chicken_stat(thechicken); @@ -192,48 +192,48 @@ show_chicken_data(chicken_t * thechicken, chicken_t * pkchicken) move(18, 0); if (thechicken->sick) - outs(SHM->i18nstr[cuser.language][876]); + outs(I18N[876]); if (thechicken->sick > thechicken->hp / 5) - outs(SHM->i18nstr[cuser.language][877]); + outs(I18N[877]); if (thechicken->clean > 150) - outs(SHM->i18nstr[cuser.language][878]); + outs(I18N[878]); else if (thechicken->clean > 80) - outs(SHM->i18nstr[cuser.language][879]); + outs(I18N[879]); else if (thechicken->clean < 20) - outs(SHM->i18nstr[cuser.language][880]); + outs(I18N[880]); if (thechicken->weight > thechicken->hp_max * 4) - outs(SHM->i18nstr[cuser.language][881]); + outs(I18N[881]); else if (thechicken->weight > thechicken->hp_max * 3) - outs(SHM->i18nstr[cuser.language][882]); + outs(I18N[882]); else if (thechicken->weight < (thechicken->hp_max / 4)) - outs(SHM->i18nstr[cuser.language][883]); + outs(I18N[883]); else if (thechicken->weight < (thechicken->hp_max / 2)) - outs(SHM->i18nstr[cuser.language][884]); + outs(I18N[884]); if (thechicken->tiredstrong > thechicken->hp * 1.7) - outs(SHM->i18nstr[cuser.language][885]); + outs(I18N[885]); else if (thechicken->tiredstrong > thechicken->hp) - outs(SHM->i18nstr[cuser.language][886]); + outs(I18N[886]); else if (thechicken->tiredstrong < thechicken->hp / 4) - outs(SHM->i18nstr[cuser.language][887]); + outs(I18N[887]); if (thechicken->hp < thechicken->hp_max / 4) - outs(SHM->i18nstr[cuser.language][888]); + outs(I18N[888]); if (thechicken->happy > 500) - outs(SHM->i18nstr[cuser.language][889]); + outs(I18N[889]); else if (thechicken->happy < 100) - outs(SHM->i18nstr[cuser.language][890]); + outs(I18N[890]); if (thechicken->satis > 500) - outs(SHM->i18nstr[cuser.language][891]); + outs(I18N[891]); else if (thechicken->satis < 50) - outs(SHM->i18nstr[cuser.language][892]); + outs(I18N[892]); if (pkchicken) { outs("\n"); show_chicken_stat(pkchicken); - outs(SHM->i18nstr[cuser.language][893]); + outs(I18N[893]); } } @@ -271,7 +271,7 @@ ch_clean() static void ch_guess() { - char *guess[3] = {SHM->i18nstr[cuser.language][894], SHM->i18nstr[cuser.language][895], SHM->i18nstr[cuser.language][896]}, me, ch, win; + char *guess[3] = {I18N[894], I18N[895], I18N[896]}, me, ch, win; chicken_t *mychicken = &cuser.mychicken; mychicken->happy += time_change[(int)mychicken->type][HAPPY] * 1.5; @@ -280,7 +280,7 @@ ch_guess() mychicken->attack += time_change[(int)mychicken->type][ATTACK] / 4; move(20, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][897]); + outs(I18N[897]); me = igetch(); me -= '1'; if (me > 2 || me < 0) @@ -289,7 +289,7 @@ ch_guess() ch = (me + win + 3) % 3; prints("%s:%s ! %s:%s !.....%s", cuser.userid, guess[(int)me], mychicken->name, guess[(int)ch], - win == 0 ? SHM->i18nstr[cuser.language][898] : win < 0 ? SHM->i18nstr[cuser.language][899] : SHM->i18nstr[cuser.language][900]); + win == 0 ? I18N[898] : win < 0 ? I18N[899] : I18N[900]); pressanykey(); } @@ -343,7 +343,7 @@ ch_buyitem(int money, char *picture, int *item, int haveticket) int num = 0; char buf[5]; - getdata_str(b_lines - 1, 0, SHM->i18nstr[cuser.language][901], + getdata_str(b_lines - 1, 0, I18N[901], buf, sizeof(buf), DOECHO, "1"); num = atoi(buf); if (num < 1) @@ -352,13 +352,13 @@ ch_buyitem(int money, char *picture, int *item, int haveticket) if (cuser.money > money * num) { *item += num; if( haveticket ) - vice(money * num, SHM->i18nstr[cuser.language][902]); + vice(money * num, I18N[902]); else demoney(-money * num); show_file(picture, 5, 14, NO_RELOAD); pressanykey(); } else { - vmsg(SHM->i18nstr[cuser.language][903]); + vmsg(I18N[903]); } } @@ -399,13 +399,13 @@ ch_kill() chicken_t *mychicken = &cuser.mychicken; int ans; - ans = getans(SHM->i18nstr[cuser.language][904]); + ans = getans(I18N[904]); if (ans == 'y') { - vice(100, SHM->i18nstr[cuser.language][905]); + vice(100, I18N[905]); more(CHICKEN_PIC "/deadth", YEA); log_file(CHICKENLOG, 1, - SHM->i18nstr[cuser.language][906], cuser.userid, mychicken->name, + I18N[906], cuser.userid, mychicken->name, chicken_type[(int)mychicken->type], ctime(&now)); mychicken->name[0] = 0; } @@ -443,24 +443,24 @@ ch_sell() money = MAX_CHICKEN_MONEY; //防止怪雞 if (mychicken->type == 1 || mychicken->type == 7) { - outs(SHM->i18nstr[cuser.language][907]); + outs(I18N[907]); pressanykey(); return 0; } if (age < 5) { - outs(SHM->i18nstr[cuser.language][908]); + outs(I18N[908]); pressanykey(); return 0; } if (age > 30) { - outs(SHM->i18nstr[cuser.language][909]); + outs(I18N[909]); pressanykey(); return 0; } - ans = getans(SHM->i18nstr[cuser.language][910], age, + ans = getans(I18N[910], age, chicken_type[(int)mychicken->type], money); if (ans == 'y') { - log_file(CHICKENLOG, 1, SHM->i18nstr[cuser.language][911], + log_file(CHICKENLOG, 1, I18N[911], cuser.userid, mychicken->name, chicken_type[(int)mychicken->type], money, ctime(&now)); mychicken->lastvisit = mychicken->name[0] = 0; @@ -616,7 +616,7 @@ deadtype(chicken_t * thechicken) if (thechicken == mychicken) { log_file(CHICKENLOG, 1, - SHM->i18nstr[cuser.language][912], + I18N[912], cuser.userid, thechicken->name, chicken_type[(int)thechicken->type], ctime(&now)); mychicken->name[0] = 0; @@ -667,12 +667,12 @@ ch_changename() chicken_t *mychicken = &cuser.mychicken; char newname[20] = ""; - getdata_str(b_lines - 1, 0, SHM->i18nstr[cuser.language][913], newname, 18, DOECHO, + getdata_str(b_lines - 1, 0, I18N[913], newname, 18, DOECHO, mychicken->name); if (strlen(newname) >= 3 && strcmp(newname, mychicken->name)) { strlcpy(mychicken->name, newname, sizeof(mychicken->name)); - log_file(CHICKENLOG, 1, SHM->i18nstr[cuser.language][914], + log_file(CHICKENLOG, 1, I18N[914], cuser.userid, mychicken->name, chicken_type[(int)mychicken->type], newname, ctime(&now)); } @@ -686,7 +686,7 @@ select_menu() reload_money(); move(19, 0); - prints(SHM->i18nstr[cuser.language][915], + prints(I18N[915], cuser.money, /* * chicken_food[(int)mychicken->type], @@ -766,38 +766,38 @@ recover_chicken(chicken_t * thechicken) if (now - thechicken->lastvisit > (60 * 60 * 24 * 7)) return 0; - outmsg(SHM->i18nstr[cuser.language][916]); + outmsg(I18N[916]); bell(); igetch(); - outmsg(SHM->i18nstr[cuser.language][917]); + outmsg(I18N[917]); bell(); igetch(); - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][918], + snprintf(buf, sizeof(buf), I18N[918], chicken_type[(int)thechicken->type], price * 2); outmsg(buf); bell(); - getdata_str(21, 0, SHM->i18nstr[cuser.language][919], buf, 3, LCECHO, "N"); + getdata_str(21, 0, I18N[919], buf, 3, LCECHO, "N"); if (buf[0] == 'y' || buf[0] == 'Y') { reload_money(); if (cuser.money < price * 2) { - outmsg(SHM->i18nstr[cuser.language][920]); + outmsg(I18N[920]); bell(); igetch(); return 0; } - strlcpy(thechicken->name, SHM->i18nstr[cuser.language][921], sizeof(thechicken->name)); + strlcpy(thechicken->name, I18N[921], sizeof(thechicken->name)); thechicken->hp = thechicken->hp_max; thechicken->sick = 0; thechicken->satis = 2; - vice(money, SHM->i18nstr[cuser.language][922]); + vice(money, I18N[922]); snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][923], money); + I18N[923], money); outmsg(buf); bell(); igetch(); return 1; } - outmsg(SHM->i18nstr[cuser.language][924]); + outmsg(I18N[924]); bell(); igetch(); thechicken->lastvisit = 0; @@ -810,12 +810,12 @@ recover_chicken(chicken_t * thechicken) void copy_i18nstring() { int i; for (i = 0; i < NUM_KINDS; i++) { - chicken_type[i] = SHM->i18nstr[cuser.language][806 + i]; - chicken_food[i] = SHM->i18nstr[cuser.language][821 + i]; - attack_type[i] = SHM->i18nstr[cuser.language][836 + i]; + chicken_type[i] = I18N[806 + i]; + chicken_food[i] = I18N[821 + i]; + attack_type[i] = I18N[836 + i]; } for (i = 0; i < 16; i++) - damage_degree[i] = SHM->i18nstr[cuser.language][851 + i]; + damage_degree[i] = I18N[851 + i]; } int chicken_main() @@ -864,7 +864,7 @@ chickenpk(int fd) reload_chicken(); if (!ochicken->name[0] || !mychicken->name[0]) { bell(); - vmsg(SHM->i18nstr[cuser.language][925]); /* Ptt:妨止page時把寵物賣掉 */ + vmsg(I18N[925]); /* Ptt:妨止page時把寵物賣掉 */ add_io(0, 0); close(fd); unlockutmpmode(); @@ -895,11 +895,11 @@ chickenpk(int fd) case 'c': catched = 1; move(16, 0); - outs(SHM->i18nstr[cuser.language][926]); + outs(I18N[926]); break; case 'd': move(16, 0); - outs(SHM->i18nstr[cuser.language][927]); + outs(I18N[927]); break; } if (data[0] == 'd' || data[0] == 'q' || data[0] == 'l') @@ -914,7 +914,7 @@ chickenpk(int fd) case 'y': if (catched == 1) { snprintf(data, sizeof(data), - SHM->i18nstr[cuser.language][928], ochicken->name); + I18N[928], ochicken->name); } break; case 'n': @@ -924,14 +924,14 @@ chickenpk(int fd) r = r % (attmax + 2); if (r) { snprintf(data, sizeof(data), - SHM->i18nstr[cuser.language][929], mychicken->name, + I18N[929], mychicken->name, damage_degree[r / 3 > 15 ? 15 : r / 3], attack_type[(int)mychicken->type], ochicken->name, r); ochicken->hp -= r; } else snprintf(data, sizeof(data), - SHM->i18nstr[cuser.language][930], mychicken->name); + I18N[930], mychicken->name); break; case 'o': if (mychicken->oo > 0) { @@ -940,27 +940,27 @@ chickenpk(int fd) if (mychicken->hp > mychicken->hp_max) mychicken->hp = mychicken->hp_max; mychicken->tiredstrong = 0; - snprintf(data, sizeof(data), SHM->i18nstr[cuser.language][931], + snprintf(data, sizeof(data), I18N[931], mychicken->name); } else snprintf(data, sizeof(data), - SHM->i18nstr[cuser.language][932], + I18N[932], mychicken->name); break; case 'q': if (r % (mychicken->run + 1) > r % (ochicken->run + 1)) - snprintf(data, sizeof(data), SHM->i18nstr[cuser.language][933], + snprintf(data, sizeof(data), I18N[933], mychicken->name); else snprintf(data, sizeof(data), - SHM->i18nstr[cuser.language][934], + I18N[934], mychicken->name, ochicken->name); break; } if (deadtype(ochicken)) { strtok(data, "\n"); strlcpy(buf, data, sizeof(buf)); - snprintf(data, sizeof(data), SHM->i18nstr[cuser.language][935], + snprintf(data, sizeof(data), I18N[935], buf + 1, ochicken->name, mychicken->name); } move(17, 0); diff --git a/mbbsd/dark.c b/mbbsd/dark.c index 2f987432..45528bfc 100644 --- a/mbbsd/dark.c +++ b/mbbsd/dark.c @@ -121,7 +121,7 @@ brd_prints() { clear(); move(1, 0); - outs(SHM->i18nstr[cuser.language][950]); + outs(I18N[950]); } static void @@ -135,18 +135,18 @@ draw_line(sint y, sint f) strlcpy(buf, "\033[43;30m", sizeof(buf)); for (i = 0; i < 8; i++) { if (brd[y][i].die == 1) - snprintf(tmp, sizeof(tmp), SHM->i18nstr[cuser.language][951]); + snprintf(tmp, sizeof(tmp), I18N[951]); else if (brd[y][i].out == 0) - snprintf(tmp, sizeof(tmp), SHM->i18nstr[cuser.language][952]); + snprintf(tmp, sizeof(tmp), I18N[952]); else { - snprintf(tmp, sizeof(tmp), SHM->i18nstr[cuser.language][953], + snprintf(tmp, sizeof(tmp), I18N[953], (f == i) ? "1;47;" : "", (brd[y][i].color) ? 31 : 34, - (brd[y][i].color) ? SHM->i18nstr[cuser.language][936 + brd[y][i].value] : - SHM->i18nstr[cuser.language][943 + brd[y][i].value]); + (brd[y][i].color) ? I18N[936 + brd[y][i].value] : + I18N[943 + brd[y][i].value]); } strcat(buf, tmp); } - strcat(buf, SHM->i18nstr[cuser.language][954]); + strcat(buf, I18N[954]); move(cury[y], 3); clrtoeol(); @@ -272,7 +272,7 @@ playing(sint fd, sint color, sint ch, sint * b, userinfo_t * uin) case 'u': move(0, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][955], (brd[my][mx].color == RED) ? SHM->i18nstr[cuser.language][956] : SHM->i18nstr[cuser.language][957], SHM->i18nstr[cuser.language][936 + brd[my][mx].value], cont); + prints(I18N[955], (brd[my][mx].color == RED) ? I18N[956] : I18N[957], I18N[936 + brd[my][mx].value], cont); *b = -1; break; case '\r': /* 吃 or 移動 ly跟lx必須大於0 */ @@ -294,7 +294,7 @@ playing(sint fd, sint color, sint ch, sint * b, userinfo_t * uin) else rcount--; move(cur_eaty, cur_eatx); - prints("%s", (color) ? SHM->i18nstr[cuser.language][943 + brd[my][mx].value] : SHM->i18nstr[cuser.language][brd[my][mx].value]); + prints("%s", (color) ? I18N[943 + brd[my][mx].value] : I18N[brd[my][mx].value]); if (cur_eatx >= 26) { cur_eatx = 5; cur_eaty++; @@ -349,15 +349,15 @@ main_dark(int fd, userinfo_t * uin) if (currutmp->turn) { brd_rand(); send(fd, &brd, sizeof(brd), 0); - mouts(21, 0, SHM->i18nstr[cuser.language][958]); - mouts(22, 0, SHM->i18nstr[cuser.language][959]); + mouts(21, 0, I18N[958]); + mouts(22, 0, I18N[959]); } else { recv(fd, &brd, sizeof(brd), 0); - mouts(21, 0, SHM->i18nstr[cuser.language][960]); + mouts(21, 0, I18N[960]); } move(12, 3); - prints(SHM->i18nstr[cuser.language][961], currutmp->userid, currutmp->mateid); - outs(SHM->i18nstr[cuser.language][962]); + prints(I18N[961], currutmp->userid, currutmp->mateid); + outs(I18N[962]); if (currutmp->turn) move(cury[0], curx[0]); @@ -384,11 +384,11 @@ main_dark(int fd, userinfo_t * uin) break; } if (curr.end == -3) - mouts(23, 30, SHM->i18nstr[cuser.language][963]); + mouts(23, 30, I18N[963]); else if (curr.end == -4) - mouts(23, 30, SHM->i18nstr[cuser.language][964]); + mouts(23, 30, I18N[964]); else if (curr.end == -5) - mouts(23, 30, SHM->i18nstr[cuser.language][965]); + mouts(23, 30, I18N[965]); else mouts(23, 30, ""); @@ -397,7 +397,7 @@ main_dark(int fd, userinfo_t * uin) mx = curr.x; redraw(); if (curr.end) - mouts(22, 0, SHM->i18nstr[cuser.language][966]); + mouts(22, 0, I18N[966]); move(cury[my], curx[mx]); } else { if (currutmp->turn == 'p') { @@ -414,7 +414,7 @@ main_dark(int fd, userinfo_t * uin) if (ch == 'y') { currutmp->color = (currutmp->color == '1') ? '0' : '1'; uin->color = (uin->color == '1') ? '0' : '1'; - mouts(21, 0, (currutmp->color == '1') ? SHM->i18nstr[cuser.language][967] : SHM->i18nstr[cuser.language][968]); + mouts(21, 0, (currutmp->color == '1') ? I18N[967] : I18N[968]); } else { mouts(23, 30, ""); currutmp->turn = (uin->turn) ? 0 : 1; @@ -422,7 +422,7 @@ main_dark(int fd, userinfo_t * uin) } else if (currutmp->turn == 'g') { if (ch == 'y') { cont = 1; - mouts(21, 0, SHM->i18nstr[cuser.language][969]); + mouts(21, 0, I18N[969]); } else { mouts(23, 30, ""); currutmp->turn = (uin->turn) ? 0 : 1; @@ -432,7 +432,7 @@ main_dark(int fd, userinfo_t * uin) if (uin->turn == 'g') { cont = 1; uin->turn = (currutmp->turn) ? 0 : 1; - mouts(21, 10, SHM->i18nstr[cuser.language][970]); + mouts(21, 10, I18N[970]); } end = playing(fd, currutmp->color - '0', ch, &go_on, uin); @@ -465,12 +465,12 @@ main_dark(int fd, userinfo_t * uin) continue; } if (!i && currutmp->color == '1') { - mouts(21, 0, SHM->i18nstr[cuser.language][971]); + mouts(21, 0, I18N[971]); i++; move(cury[my], curx[mx]); } if (!i && currutmp->color == '0') { - mouts(21, 0, SHM->i18nstr[cuser.language][972]); + mouts(21, 0, I18N[972]); i++; move(cury[my], curx[mx]); } @@ -483,7 +483,7 @@ main_dark(int fd, userinfo_t * uin) move(22, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][973], currutmp->mateid); + prints(I18N[973], currutmp->mateid); currutmp->turn = 0; uin->turn = 1; } else { @@ -493,7 +493,7 @@ main_dark(int fd, userinfo_t * uin) } move(22, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][974], currutmp->mateid); + prints(I18N[974], currutmp->mateid); } } } @@ -504,15 +504,15 @@ main_dark(int fd, userinfo_t * uin) if (currutmp->turn == 'w') { move(22, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][975]); + prints(I18N[975]); } else { move(22, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][976]); + prints(I18N[976]); } break; case -3: - mouts(22, 0, SHM->i18nstr[cuser.language][977]); + mouts(22, 0, I18N[977]); break; default: add_io(0, 0); diff --git a/mbbsd/dice.c b/mbbsd/dice.c index b6336d93..164d686e 100644 --- a/mbbsd/dice.c +++ b/mbbsd/dice.c @@ -95,30 +95,18 @@ static void show_data(void) { move(0, 0); - prints("\033[31m ┌───────────────────────" - "──────────┐\033[m\n"); - prints("\033[45;37m倍率一\033[m\033[31m │ \033[33m[1]押一點 [2]押二點 " - "[3]押三點 [4]押四點 [5]押五點 [6]押六點 \033[31m │\033[m\n"); - prints("\033[31m │ \033[33m[7]押小 [8]押大 " - " \033[31m │\033[m\n"); - prints("\033[31m │ " - " │\033[m\n"); - prints("\033[45;37m賠率三\033[m\033[31m │ \033[33m[11]押中(總點數等於11" - "或10) \033[31m │\033[m\n"); - prints("\033[31m │ " - " │\033[m\n"); - prints("\033[45;37m賠率五\033[m\033[31m │ \033[33m[74]押小且四點 [83]押" - "大且三點 [66]押連號 \033[31m │\033[m\n"); - prints("\033[31m │ " - " │\033[m\n"); - prints("\033[31m │ \033[33m[12]押一二點 [13]押一三點 [14]押一四點" - " [15]押一五點 [16]押一六點\033[31m │\033[m\n"); - prints("\033[31m │ \033[33m[23]押二三點 [24]押二四點 [25]押二五點" - " [26]押二六點 [34]押三四點\033[31m │\033[m\n"); - prints("\033[31m │ \033[33m[35]押三五點 [36]押三六點 [45]押四五點" - " [46]押四六點 [56]押五六點\033[31m │\033[m\n"); - prints("\033[31m └────────────────────────" - "─────────┘\033[m\n"); + prints(I18N[3441]); + prints(I18N[3442]); + prints(I18N[3443]); + prints(I18N[3444]); + prints(I18N[3445]); + prints(I18N[3446]); + prints(I18N[3447]); + prints(I18N[3448]); + prints(I18N[3449]); + prints(I18N[3450]); + prints(I18N[3451]); + prints(I18N[3452]); } static void @@ -187,7 +175,7 @@ del(int value[100],int total, dicedata_t * table) do { move(22, 0); clrtoeol(); - getdata(21, 0, "輸入退選的數字(打q離開): ", data, 3, LCECHO); + getdata(21, 0, I18N[3453], data, 3, LCECHO); if (data[0] == 'q' || data[0] == 'Q') return 0; } while (!IsNum(data, strlen(data))); @@ -196,20 +184,20 @@ del(int value[100],int total, dicedata_t * table) for (i = 0; i < total; i++) { if (table[i].mybet == index) { do { - getdata(21, 0, "多少錢: ", data, 10, LCECHO); + getdata(21, 0, I18N[3454], data, 10, LCECHO); } while (!IsNum(data, strlen(data))); money = atoi(data); if (money > table[i].mymoney) { move(22, 0); clrtoeol(); - prints("不夠扣啦"); + prints(I18N[3455]); i--; continue; } demoney(money); move(19, 0); clrtoeol(); - prints("你現在有 %u Ptt$歐", cuser.money); + prints(I18N[3456], cuser.money); table[i].mymoney -= money; show_count(value, index, -money); break; @@ -241,83 +229,81 @@ show_output(int bet[]) prints(" "); } move(12, 0); - prints("\033[1;31m ┌──────────────────────" - "─┐\033[m\n\n\n\n\n\n"); - prints("\033[1;31m └──────────────────────" - "─┘\033[m"); + prints(I18N[3457]); + prints(I18N[3458]); for (i = 0; i < 3; i++, j += 25) { switch (bet[i]) { case 1: move(13, j); - prints("\033[37m╭────╮\033[m"); + prints(I18N[3459]); move(14, j); - prints("\033[37m│ │\033[m"); + prints(I18N[3460]); move(15, j); - prints("\033[37m│ ● │\033[m"); + prints(I18N[3461]); move(16, j); - prints("\033[37m│ │\033[m"); + prints(I18N[3462]); move(17, j); - prints("\033[37m╰────╯\033[m"); + prints(I18N[3463]); break; case 2: move(13, j); - prints("\033[37m╭────╮\033[m"); + prints(I18N[3464]); move(14, j); - prints("\033[37m│ ●│\033[m"); + prints(I18N[3465]); move(15, j); - prints("\033[37m│ │\033[m"); + prints(I18N[3466]); move(16, j); - prints("\033[37m│● │\033[m"); + prints(I18N[3467]); move(17, j); - prints("\033[37m╰────╯\033[m"); + prints(I18N[3468]); break; case 3: move(13, j); - prints("\033[37m╭────╮\033[m"); + prints(I18N[3469]); move(14, j); - prints("\033[37m│ ●│\033[m"); + prints(I18N[3470]); move(15, j); - prints("\033[37m│ ● │\033[m"); + prints(I18N[3471]); move(16, j); - prints("\033[37m│● │\033[m"); + prints(I18N[3472]); move(17, j); - prints("\033[37m╰────╯\033[m"); + prints(I18N[3473]); break; case 4: move(13, j); - prints("\033[37m╭────╮\033[m"); + prints(I18N[3474]); move(14, j); - prints("\033[37m│● ●│\033[m"); + prints(I18N[3475]); move(15, j); - prints("\033[37m│ │\033[m"); + prints(I18N[3476]); move(16, j); - prints("\033[37m│● ●│\033[m"); + prints(I18N[3477]); move(17, j); - prints("\033[37m╰────╯\033[m"); + prints(I18N[3478]); break; case 5: move(13, j); - prints("\033[37m╭────╮\033[m"); + prints(I18N[3479]); move(14, j); - prints("\033[37m│● ●│\033[m"); + prints(I18N[3480]); move(15, j); - prints("\033[37m│ ● │\033[m"); + prints(I18N[3481]); move(16, j); - prints("\033[37m│● ●│\033[m"); + prints(I18N[3482]); move(17, j); - prints("\033[37m╰────╯\033[m"); + prints(I18N[3483]); break; case 6: move(13, j); - prints("\033[37m╭────╮\033[m"); + prints(I18N[3484]); move(14, j); - prints("\033[37m│● ●│\033[m"); + prints(I18N[3485]); move(15, j); - prints("\033[37m│● ●│\033[m"); + prints(I18N[3486]); move(16, j); - prints("\033[37m│● ●│\033[m"); + prints(I18N[3487]); move(17, j); - prints("\033[37m╰────╯\033[m"); + prints(I18N[3488]); break; } } @@ -338,7 +324,7 @@ dice_main(void) reload_money(); if (cuser.money < 10) { move(19, 0); - prints("\033[1;37m超過十元再來玩吧~~\033[m"); + prints(I18N[3489]); pressanykey(); return 0; } @@ -361,15 +347,15 @@ dice_main(void) while (1) { move(19, 0); - prints("\033[1;32m你現在有\033[1;31m %u \033[1;32mPtt$歐\033[m", + prints(I18N[3490], cuser.money); - getdata(20, 0, "\033[1;37m數字:加選 d:退選 s:開始或離開\033[m: ", + getdata(20, 0, I18N[3491], input, 5, LCECHO); reload_money(); if (input[0] != 's' && input[0] != 'd' && cuser.money < 10) { move(21, 0); clrtoeol(); - prints("\033[1;37m超過十元才能賭~\033[m"); + prints(I18N[3492]); continue; } if (input[0] == 'd' || input[0] == 'D') { @@ -389,8 +375,7 @@ dice_main(void) while (1) { if (cuser.money < 10) break; - getdata(21, 0, "\033[1;32m賭多少錢呢\033[1;37m(大於10 小於500)" - "\033[m: ", input, sizeof(input), LCECHO); + getdata(21, 0, I18N[3493], input, sizeof(input), LCECHO); if (!(money = IsLegal(input)) || input[0] == '0') continue; reload_money(); @@ -404,7 +389,7 @@ dice_main(void) sig = 1; break; } else { - vice(money, "骰子"); + vice(money, I18N[3494]); table[j].mymoney += money; j = -1; break; @@ -418,13 +403,13 @@ dice_main(void) bzero((char *)&table[i], sizeof(dicedata_t)); table[i].mybet = index; table[i++].mymoney = money; - vice(money, "骰子"); + vice(money, I18N[3495]); } break; } reload_money(); move(19, 0); - prints("\033[1;32m你現在有 \033[1;31m%u\033[1;32m Ptt$歐", + prints(I18N[3496], cuser.money); if (sig != 2) show_count(value,index, money); @@ -449,7 +434,7 @@ dice_main(void) total += table[j].mymoney * ya; if (table[j].mymoney * ya > 500) { /* 超過500塊錢才做log 減少io */ snprintf(data, sizeof(data), - "%-15s 押%-2d選項%-8d塊錢 中了%d倍 淨賺:%-8d\n", + I18N[3497], cuser.userid, table[j].mybet, table[j].mymoney, ya, table[j].mymoney * ya); fputs(data, winfp); @@ -459,20 +444,19 @@ dice_main(void) if (total > 0) { move(21, 0); - prints("\033[1;32m你贏了 \033[1;31m%d\033[1;32m Ptt$ 唷~~" - " \033[m", total); + prints(I18N[3498], total); } else { move(21, 0); clrtoeol(); - prints("\033[1;32m真可惜 下次再來碰碰運氣吧\033[m"); + prints(I18N[3499]); } move(19, 0); clrtoeol(); - prints("\033[1;32m你現在有 \033[1;31m%u\033[1;32m Ptt$歐\033[m", + prints(I18N[3500], cuser.money); - getdata(23, 0, "\033[1;32m繼續奮鬥[\033[1;37my/n\033[1;32m]\033[m: ", + getdata(23, 0, I18N[3501], input, 2, LCECHO); } while (input[0] != 'n' && input[0] != 'N'); fclose(winfp); diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 4ee6ca3a..71458288 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -63,7 +63,7 @@ static char fp_bak[] = "bak"; static void indigestion(int i) { - fprintf(stderr, SHM->i18nstr[cuser.language][978], i); + fprintf(stderr, I18N[978], i); } /* Thor: ansi 座標轉換 for color 編輯模式 */ @@ -121,7 +121,7 @@ n2ansi(int nx, textline_t * line) static void edit_msg() { - char *edit_mode[2] = {SHM->i18nstr[cuser.language][979], SHM->i18nstr[cuser.language][980]}; + char *edit_mode[2] = {I18N[979], I18N[980]}; register int n = currpnt; if (my_ansimode) /* Thor: 作 ansi 編輯 */ @@ -129,7 +129,7 @@ edit_msg() n++; move(b_lines, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][981], + prints(I18N[981], "37;44", edit_mode[insert_character], my_ansimode ? 'A' : 'a', indent_mode ? 'I' : 'i', @@ -527,7 +527,7 @@ ask_tmpbuf(int y) static char fp_buf[10] = "buf.0"; char msg[36]; - strlcpy(msg, SHM->i18nstr[cuser.language][982], sizeof(msg)); + strlcpy(msg, I18N[982], sizeof(msg)); msg[19] = fp_buf[4]; do { if (!getdata(y, 0, msg, fp_buf + 4, 4, DOECHO)) @@ -555,7 +555,7 @@ read_tmpbuf(int n) setuserfile(fp_tmpbuf, tmpf); if (n != 0 && n != 5 && more(fp_tmpbuf, NA) != -1) - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][983], ans, sizeof(ans), LCECHO); + getdata(b_lines - 1, 0, I18N[983], ans, sizeof(ans), LCECHO); if (*ans != 'n' && (fp = fopen(fp_tmpbuf, "r"))) { load_file(fp); while (curr_window_line >= b_lines) { @@ -575,7 +575,7 @@ write_tmpbuf() setuserfile(fp_tmpbuf, ask_tmpbuf(3)); if (dashf(fp_tmpbuf)) { more(fp_tmpbuf, NA); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][984], + getdata(b_lines - 1, 0, I18N[984], ans, sizeof(ans), LCECHO); if (ans[0] == 'q') @@ -598,7 +598,7 @@ erase_tmpbuf() setuserfile(fp_tmpbuf, ask_tmpbuf(3)); if (more(fp_tmpbuf, NA) != -1) - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][985], + getdata(b_lines - 1, 0, I18N[985], ans, sizeof(ans), LCECHO); if (*ans == 'y') unlink(fp_tmpbuf); @@ -634,8 +634,8 @@ restore_backup() setuserfile(bakfile, fp_bak); if (dashf(bakfile)) { - stand_title(SHM->i18nstr[cuser.language][986]); - getdata(1, 0, SHM->i18nstr[cuser.language][987], + stand_title(I18N[986]); + getdata(1, 0, I18N[987], buf, 4, LCECHO); if (buf[0] != 'q') { setuserfile(buf, ask_tmpbuf(3)); @@ -660,8 +660,8 @@ garbage_line(char *str) while (*str == ' ' || *str == '\t') str++; if (qlevel >= 1) { - if (!strncmp(str, SHM->i18nstr[cuser.language][988], 3) || !strncmp(str, "==>", 3) || - strstr(str, SHM->i18nstr[cuser.language][989])) + if (!strncmp(str, I18N[988], 3) || !strncmp(str, "==>", 3) || + strstr(str, I18N[989])) return 1; } return (*str == '\n'); @@ -673,7 +673,7 @@ do_quote() int op; char buf[256]; - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][990], + getdata(b_lines - 1, 0, I18N[990], buf, 3, LCECHO); op = buf[0]; @@ -706,9 +706,9 @@ do_quote() ptr = quote_user; indent_mode = 0; - insert_string(SHM->i18nstr[cuser.language][991]); + insert_string(I18N[991]); insert_string(ptr); - insert_string(SHM->i18nstr[cuser.language][992]); + insert_string(I18N[992]); if (op != 'a') /* 去掉 header */ while (fgets(buf, 256, inf) && buf[0] != '\n'); @@ -724,7 +724,7 @@ do_quote() insert_string(Ptt_prints(buf, NO_RELOAD)); else { if (curredit & EDIT_LIST) /* 去掉 mail list 之 header */ - while (fgets(buf, 256, inf) && (!strncmp(buf, SHM->i18nstr[cuser.language][993], 3))); + while (fgets(buf, 256, inf) && (!strncmp(buf, I18N[993], 3))); while (fgets(buf, 256, inf)) { if (!strcmp(buf, "--\n")) break; @@ -767,11 +767,11 @@ check_quote() if ((included_line >> 2) > post_line) { move(4, 0); - outs(SHM->i18nstr[cuser.language][994]); + outs(I18N[994]); { char ans[4]; - getdata(12, 12, SHM->i18nstr[cuser.language][995], + getdata(12, 12, I18N[995], ans, sizeof(ans), LCECHO); if (ans[0] == 'w') return 0; @@ -823,9 +823,9 @@ write_header(FILE * fp) if (currbrdattr & BRD_ANONYMOUS) { int defanony = (currbrdattr & BRD_DEFAULTANONYMOUS); if (defanony) - getdata(3, 0, SHM->i18nstr[cuser.language][996], real_name, sizeof(real_name), DOECHO); + getdata(3, 0, I18N[996], real_name, sizeof(real_name), DOECHO); else - getdata(3, 0, SHM->i18nstr[cuser.language][997], + getdata(3, 0, I18N[997], real_name, sizeof(real_name), DOECHO); if (!real_name[0] && defanony) { strlcpy(real_name, "Anonymous", sizeof(real_name)); @@ -858,7 +858,7 @@ write_header(FILE * fp) fprintf(fp, "%s %s (%s) %s %s\n", str_author1, postlog.author, (((!strcmp(real_name, "r") && defanony) || (!real_name[0] && (!defanony))) ? cuser.username : - SHM->i18nstr[cuser.language][998]), + I18N[998]), local_article ? str_post2 : str_post1, currboard); } else { fprintf(fp, "%s %s (%s) %s %s\n", str_author1, cuser.userid, @@ -873,7 +873,7 @@ write_header(FILE * fp) } save_title[72] = '\0'; - fprintf(fp, SHM->i18nstr[cuser.language][999], save_title, ctime(&now)); + fprintf(fp, I18N[999], save_title, ctime(&now)); } void @@ -887,10 +887,10 @@ addsignature(FILE * fp, int ifuseanony) static char msg[64]; char ch; - strlcpy(msg, SHM->i18nstr[cuser.language][1000], sizeof(msg)); + strlcpy(msg, I18N[1000], sizeof(msg)); if (!strcmp(cuser.userid, STR_GUEST)) { - fprintf(fp, "%s" BBSNAME "(" MYHOSTNAME "%s%s\n", SHM->i18nstr[cuser.language][1001], - SHM->i18nstr[cuser.language][1002], fromhost); + fprintf(fp, "%s" BBSNAME "(" MYHOSTNAME "%s%s\n", I18N[1001], + I18N[1002], fromhost); return; } if (!ifuseanony) { @@ -923,20 +923,20 @@ addsignature(FILE * fp, int ifuseanony) #ifdef HAVE_ORIGIN #ifdef HAVE_ANONYMOUS if (ifuseanony) - fprintf(fp, "%s"BBSNAME"("MYHOSTNAME"%s%s\n", SHM->i18nstr[cuser.language][1003], - SHM->i18nstr[cuser.language][1004], SHM->i18nstr[cuser.language][1005]); + fprintf(fp, "%s"BBSNAME"("MYHOSTNAME"%s%s\n", I18N[1003], + I18N[1004], I18N[1005]); else { char temp[33]; strncpy(temp, fromhost, 31); temp[32] = '\0'; - fprintf(fp, "%s"BBSNAME"("MYHOSTNAME"%s%s\n", SHM->i18nstr[cuser.language][1006], - SHM->i18nstr[cuser.language][1007], temp); + fprintf(fp, "%s"BBSNAME"("MYHOSTNAME"%s%s\n", I18N[1006], + I18N[1007], temp); } #else strncpy(temp, fromhost, 15); - fprintf(fp, "%s"BBSNAME"("MYHOSTNAME"%s%s\n", SHM->i18nstr[cuser.language][1008], - SHM->i18nstr[cuser.language][1009], temp); + fprintf(fp, "%s"BBSNAME"("MYHOSTNAME"%s%s\n", I18N[1008], + I18N[1009], temp); #endif #endif } @@ -950,18 +950,18 @@ write_file(char *fpath, int saveheader, int *islocal) char ans[TTLEN], *msg; int aborted = 0, line = 0, checksum[3], sum = 0, po = 1; - stand_title(SHM->i18nstr[cuser.language][1010]); + stand_title(I18N[1010]); if (currstat == SMAIL) - msg = SHM->i18nstr[cuser.language][1011]; + msg = I18N[1011]; else if (local_article) - msg = SHM->i18nstr[cuser.language][1012]; + msg = I18N[1012]; else - msg = SHM->i18nstr[cuser.language][1013]; + msg = I18N[1013]; getdata(1, 0, msg, ans, 2, LCECHO); switch (ans[0]) { case 'a': - outs(SHM->i18nstr[cuser.language][1014]); + outs(I18N[1014]); aborted = -1; break; case 'r': @@ -976,16 +976,16 @@ write_file(char *fpath, int saveheader, int *islocal) return KEEP_EDITING; case 't': move(3, 0); - prints(SHM->i18nstr[cuser.language][1015], save_title); + prints(I18N[1015], save_title); strlcpy(ans, save_title, sizeof(ans)); - if (getdata_buf(4, 0, SHM->i18nstr[cuser.language][1016], ans, sizeof(ans), DOECHO)) + if (getdata_buf(4, 0, I18N[1016], ans, sizeof(ans), DOECHO)) strlcpy(save_title, ans, sizeof(save_title)); return KEEP_EDITING; case 's': if (!HAS_PERM(PERM_LOGINOK)) { local_article = 1; move(2, 0); - prints(SHM->i18nstr[cuser.language][1017]); + prints(I18N[1017]); pressanykey(); } else local_article = 0; @@ -1065,7 +1065,7 @@ write_file(char *fpath, int saveheader, int *islocal) ) { ptime = localtime(&now); fprintf(fp, - SHM->i18nstr[cuser.language][1018], + I18N[1018], cuser.userid, fromhost, ptime->tm_mon + 1, ptime->tm_mday, ptime->tm_hour, ptime->tm_min); } @@ -1151,7 +1151,7 @@ goto_line(int lino) char buf[10]; if (lino > 0 || - (getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1019], buf, sizeof(buf), DOECHO) && + (getdata(b_lines - 1, 0, I18N[1019], buf, sizeof(buf), DOECHO) && sscanf(buf, "%d", &lino) && lino > 0)) { textline_t *p; @@ -1210,10 +1210,10 @@ search_str(int mode) char ans[4] = "n"; if (!mode) { - if (getdata_buf(b_lines - 1, 0, SHM->i18nstr[cuser.language][1020], + if (getdata_buf(b_lines - 1, 0, I18N[1020], str, sizeof(str), DOECHO)) if (*str) { - if (getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1021], + if (getdata(b_lines - 1, 0, I18N[1021], ans, sizeof(ans), LCECHO) && *ans == 'y') fptr = strstr; else @@ -1401,7 +1401,7 @@ block_del(int hide) clrtoeol(); if (hide == 1) tmpfname[4] = 'q'; - else if (!hide && !getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1022], + else if (!hide && !getdata(b_lines - 1, 0, I18N[1022], tmpfname + 4, 4, LCECHO)) tmpfname[4] = '0'; if (tmpfname[4] < '0' || tmpfname[4] > '9') @@ -1410,14 +1410,14 @@ block_del(int hide) setuserfile(fp_tmpbuf, tmpfname); if (tmpfname[4] != '5' && dashf(fp_tmpbuf)) { more(fp_tmpbuf, NA); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1023], ans, 2, LCECHO); + getdata(b_lines - 1, 0, I18N[1023], ans, 2, LCECHO); if (*ans == 'q') tmpfname[4] = 'q'; else if (*ans != 'a') *ans = 'w'; } if (tmpfname[4] != '5') { - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1024], + getdata(b_lines - 1, 0, I18N[1024], ans + 2, 4, LCECHO); if (ans[2] != 'y') ans[2] = 'n'; @@ -1775,7 +1775,7 @@ vedit(char *fpath, int saveheader, int *islocal) line_dirty = 1; break; case Ctrl('Q'): /* Quit without saving */ - ch = ask(SHM->i18nstr[cuser.language][1025]); + ch = ask(I18N[1025]); if (ch == 'y' || ch == 'Y') { currutmp->mode = mode0; currutmp->destuid = destuid0; @@ -1808,7 +1808,7 @@ vedit(char *fpath, int saveheader, int *islocal) move(b_lines - 2, 55); outs("\033[1;33;40mB\033[41mR\033[42mG\033[43mY\033[44mL\033[45mP\033[46mC\033[47mW\033[m"); if (getdata(b_lines - 1, 0, - SHM->i18nstr[cuser.language][1026], + I18N[1026], ans, sizeof(ans), LCECHO)) { char t[] = "BRGYLPCW"; char color[15]; @@ -2013,7 +2013,7 @@ vedit(char *fpath, int saveheader, int *islocal) { unsigned int currstat0 = currstat; setutmpmode(EDITEXP); - a_menu(SHM->i18nstr[cuser.language][1027], "etc/editexp", + a_menu(I18N[1027], "etc/editexp", (HAS_PERM(PERM_SYSOP) ? SYSOP : NOBODY)); currstat = currstat0; } @@ -2023,9 +2023,9 @@ vedit(char *fpath, int saveheader, int *islocal) indent_mode = 0; while (fgets(line, WRAPMARGIN + 2, fp1)) { - if (!strncmp(line, SHM->i18nstr[cuser.language][1028], 5) || - !strncmp(line, SHM->i18nstr[cuser.language][1029], 5) || - !strncmp(line, SHM->i18nstr[cuser.language][1030], 5)) + if (!strncmp(line, I18N[1028], 5) || + !strncmp(line, I18N[1029], 5) || + !strncmp(line, I18N[1030], 5)) continue; insert_string(line); } @@ -2169,7 +2169,7 @@ vedit(char *fpath, int saveheader, int *islocal) char ans[4]; getdata(b_lines - 1, 0, - SHM->i18nstr[cuser.language][1031], + I18N[1031], ans, sizeof(ans), LCECHO); insert_c = (*ans) ? *ans : ' '; } diff --git a/mbbsd/fav.c b/mbbsd/fav.c index 932fffd9..362deceb 100644 --- a/mbbsd/fav.c +++ b/mbbsd/fav.c @@ -143,7 +143,7 @@ static char *get_item_class(fav_type_t *ft) case FAVT_BOARD: return bcache[cast_board(ft)->bid - 1].title; case FAVT_FOLDER: - return SHM->i18nstr[cuser.language][1032]; + return I18N[1032]; case FAVT_LINE: return "----"; } diff --git a/mbbsd/friend.c b/mbbsd/friend.c index 5b6500e2..64bfdc82 100644 --- a/mbbsd/friend.c +++ b/mbbsd/friend.c @@ -78,9 +78,9 @@ friend_add(char *uident, int type, char* des) if (type != FRIEND_ALOHA && type != FRIEND_POST){ if(!des) - getdata(2, 0, SHM->i18nstr[cuser.language][friend_desc[type]], buf, sizeof(buf), DOECHO); + getdata(2, 0, I18N[friend_desc[type]], buf, sizeof(buf), DOECHO); else - getdata_str(2, 0, SHM->i18nstr[cuser.language][friend_desc[type]], buf, sizeof(buf), DOECHO, des); + getdata_str(2, 0, I18N[friend_desc[type]], buf, sizeof(buf), DOECHO, des); } if ((fp = fopen(fpath, "a"))) { @@ -115,7 +115,7 @@ friend_special(void) clrtoeol(); outs(genbuf); } - getdata(22, 0, SHM->i18nstr[cuser.language][1047], genbuf, 3, LCECHO); + getdata(22, 0, I18N[1047], genbuf, 3, LCECHO); if (genbuf[0] >= '0' && genbuf[0] <= '9') { special_list[5] = genbuf[0]; special_des[5] = genbuf[0]; @@ -136,21 +136,21 @@ friend_append(int type, int count) do { move(2, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][1048]); + outs(I18N[1048]); for (j = i = 0; i <= 4; i++) if (i != type) { ++j; - prints(" (%d) %-s\n", j, SHM->i18nstr[cuser.language][1039 + (int)i]); + prints(" (%d) %-s\n", j, I18N[1039 + (int)i]); } if (HAVE_PERM(PERM_SYSOP) || currmode & MODE_BOARD) for (; i < 8; ++i) if (i != type) { ++j; - prints(SHM->i18nstr[cuser.language][1049], j, currboard, - SHM->i18nstr[cuser.language][1039 + (int)i]); + prints(I18N[1049], j, currboard, + I18N[1039 + (int)i]); } - outs(SHM->i18nstr[cuser.language][1050]); - getdata(11, 0, SHM->i18nstr[cuser.language][1051], buf, 3, LCECHO); + outs(I18N[1050]); + getdata(11, 0, I18N[1051], buf, 3, LCECHO); if (!buf[0]) return; if (buf[0] == 's') @@ -224,7 +224,7 @@ friend_editdesc(char *uident, int type) fputs(genbuf, nfp); else if (!strncmp(genbuf, uident, length)) { char buf[50] = ""; - getdata(2, 0, SHM->i18nstr[cuser.language][1052], buf, 40, DOECHO); + getdata(2, 0, I18N[1052], buf, 40, DOECHO); fprintf(nfp, "%-13s%s\n", uident, buf); } } @@ -326,9 +326,9 @@ friend_edit(int type) } dirty = 0; while (1) { - stand_title(SHM->i18nstr[cuser.language][1039 + type]); + stand_title(I18N[1039 + type]); move(0, 40); - prints(SHM->i18nstr[cuser.language][1053], friend_max[type]); + prints(I18N[1053], friend_max[type]); count = 0; CreateNameList(); @@ -350,8 +350,8 @@ friend_edit(int type) fclose(fp); } getdata(1, 0, (count ? - SHM->i18nstr[cuser.language][1054] : - SHM->i18nstr[cuser.language][1055]), + I18N[1054] : + I18N[1055]), uident, 3, LCECHO); if (*uident == 'a') { move(1, 0); @@ -379,16 +379,16 @@ friend_edit(int type) } else if (*uident == 'l' && count) more(fpath, YEA); else if (*uident == 'k' && count) { - getdata(2, 0, SHM->i18nstr[cuser.language][1056], uident, 3, + getdata(2, 0, I18N[1056], uident, 3, LCECHO); if (*uident == 'a') unlink(fpath); dirty = 1; } else if (*uident == 'w' && count) { char wall[60]; - if (!getdata(0, 0, SHM->i18nstr[cuser.language][1057], wall, sizeof(wall), DOECHO)) + if (!getdata(0, 0, I18N[1057], wall, sizeof(wall), DOECHO)) continue; - if (getdata(0, 0, SHM->i18nstr[cuser.language][1058], line, 4, LCECHO) && + if (getdata(0, 0, I18N[1058], line, 4, LCECHO) && *line == 'n') continue; friend_water(wall, type); @@ -397,7 +397,7 @@ friend_edit(int type) } if (dirty) { move(2, 0); - outs(SHM->i18nstr[cuser.language][1059]); + outs(I18N[1059]); refresh(); if (type == FRIEND_ALOHA || type == FRIEND_POST) { snprintf(genbuf, sizeof(genbuf), "%s.old", fpath); @@ -427,7 +427,7 @@ friend_edit(int type) fgets(genbuf, 30, fp); fclose(fp); } - getdata_buf(2, 0, SHM->i18nstr[cuser.language][1060], genbuf, 30, + getdata_buf(2, 0, I18N[1060], genbuf, 30, DOECHO); if ((fp = fopen(line, "w"))) { fprintf(fp, "%s", genbuf); diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 3152a77d..3e4ae622 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -32,20 +32,20 @@ show_ticket_data(char betname[MAX_ITEM][MAX_ITEM_LEN],char *direct, int *price, clear(); if (bh) { - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][1061], bh->brdname); + snprintf(genbuf, sizeof(genbuf), I18N[1061], bh->brdname); if (bh->endgamble && now < bh->endgamble && bh->endgamble - now < 3600) { snprintf(t, sizeof(t), - SHM->i18nstr[cuser.language][1062], (int)(bh->endgamble - now)); + I18N[1062], (int)(bh->endgamble - now)); showtitle(genbuf, t); } else showtitle(genbuf, BBSNAME); } else - showtitle(SHM->i18nstr[cuser.language][1063], BBSNAME); + showtitle(I18N[1063], BBSNAME); move(2, 0); snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET_ITEMS, direct); if (!(fp = fopen(genbuf, "r"))) { - prints(SHM->i18nstr[cuser.language][1064]); + prints(I18N[1064]); snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET_OUTCOME, direct); more(genbuf, NA); return 0; @@ -56,11 +56,11 @@ show_ticket_data(char betname[MAX_ITEM][MAX_ITEM_LEN],char *direct, int *price, strtok(betname[count], "\r\n"); fclose(fp); - prints(SHM->i18nstr[cuser.language][1065], *price, - bh ? SHM->i18nstr[cuser.language][1066] : - SHM->i18nstr[cuser.language][1067], - bh ? SHM->i18nstr[cuser.language][1068] : "", - bh ? SHM->i18nstr[cuser.language][1069] : SHM->i18nstr[cuser.language][1070]); + prints(I18N[1065], *price, + bh ? I18N[1066] : + I18N[1067], + bh ? I18N[1068] : "", + bh ? I18N[1069] : I18N[1070]); snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET, direct); @@ -70,7 +70,7 @@ show_ticket_data(char betname[MAX_ITEM][MAX_ITEM_LEN],char *direct, int *price, } show_file(genbuf, 8, -1, NO_RELOAD); move(15, 0); - prints(SHM->i18nstr[cuser.language][1071]); + prints(I18N[1071]); total = load_ticket_record(direct, ticket); @@ -80,9 +80,9 @@ show_ticket_data(char betname[MAX_ITEM][MAX_ITEM_LEN],char *direct, int *price, if (i == 3) prints("\n"); } - prints(SHM->i18nstr[cuser.language][1072], total * (*price)); + prints(I18N[1072], total * (*price)); if (end) { - prints(SHM->i18nstr[cuser.language][1073]); + prints(I18N[1073]); return -count; } return count; @@ -136,7 +136,7 @@ ticket(int bid) } move(20, 0); reload_money(); - prints(SHM->i18nstr[cuser.language][1074], cuser.money, count); + prints(I18N[1074], cuser.money, count); ch = igetch(); /*-- Tim011127 @@ -154,7 +154,7 @@ ticket(int bid) ch_buyitem(price, "etc/buyticket", &n, 0); if (bid && !dashf(fn_ticket)) { - vmsg(SHM->i18nstr[cuser.language][1075]); + vmsg(I18N[1075]); break; } @@ -186,7 +186,7 @@ openticket(int bid) do { do { getdata(20, 0, - SHM->i18nstr[cuser.language][1076], buf, 3, LCECHO); + I18N[1076], buf, 3, LCECHO); bet = atoi(buf); move(0, 0); clrtoeol(); @@ -195,13 +195,13 @@ openticket(int bid) unlockutmpmode(); return 0; } - getdata(21, 0, SHM->i18nstr[cuser.language][1077], buf, 3, LCECHO); + getdata(21, 0, I18N[1077], buf, 3, LCECHO); } while (bet != atoi(buf)); if (fork()) { /* Ptt: 用 fork() 防止不正常斷線洗錢 */ move(22, 0); - prints(SHM->i18nstr[cuser.language][1078]); + prints(I18N[1078]); pressanykey(); unlockutmpmode(); return 0; @@ -230,20 +230,20 @@ openticket(int bid) if (bet != 98) { money = total * price; demoney(money * 0.02); - mail_redenvelop(SHM->i18nstr[cuser.language][1079], cuser.userid, money * 0.02, 'n'); + mail_redenvelop(I18N[1079], cuser.userid, money * 0.02, 'n'); money = ticket[bet] ? money * 0.95 / ticket[bet] : 9999999; } else { - vice(price * 10, SHM->i18nstr[cuser.language][1080]); + vice(price * 10, I18N[1080]); money = price; } setbfile(outcome, bh->brdname, FN_TICKET_OUTCOME); if ((fp = fopen(outcome, "w"))) { - fprintf(fp, SHM->i18nstr[cuser.language][1081]); + fprintf(fp, I18N[1081]); while (fgets(buf, sizeof(buf), fp1)) { buf[sizeof(buf)-1] = 0; fprintf(fp, "%s", buf); } - fprintf(fp, SHM->i18nstr[cuser.language][1082]); + fprintf(fp, I18N[1082]); fprintf(fp, "\033[33m"); for (i = 0; i < count; i++) { @@ -254,15 +254,15 @@ openticket(int bid) fprintf(fp, "\033[m\n"); if (bet != 98) { - fprintf(fp, SHM->i18nstr[cuser.language][1083], + fprintf(fp, I18N[1083], Cdatelite(&now), betname[bet], total * price, ticket[bet], total, (float)ticket[bet] / total, money); - fprintf(fp, SHM->i18nstr[cuser.language][1084], + fprintf(fp, I18N[1084], Cdatelite(&now), betname[bet], total * price, money, total ? (float)ticket[bet] / total : 0); } else - fprintf(fp, SHM->i18nstr[cuser.language][1085], Cdatelite(&now)); + fprintf(fp, I18N[1085], Cdatelite(&now)); } // XXX somebody may use fp even fp==NULL fclose(fp1); @@ -281,37 +281,37 @@ openticket(int bid) while (fscanf(fp1, "%s %d %d\n", userid, &mybet, &i) != EOF) { if (bet == 98 && mybet >= 0 && mybet < count) { if (fp) - fprintf(fp, SHM->i18nstr[cuser.language][1086] + fprintf(fp, I18N[1086] ,userid, i, betname[mybet], money * i); snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][1087], bh->brdname, money * i); + I18N[1087], bh->brdname, money * i); } else if (mybet == bet) { if (fp) - fprintf(fp, SHM->i18nstr[cuser.language][1088] + fprintf(fp, I18N[1088] ,userid, i, betname[mybet], money * i); - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][1089], bh->brdname, money * i); + snprintf(buf, sizeof(buf), I18N[1089], bh->brdname, money * i); } else continue; if ((uid = searchuser(userid)) == 0) continue; deumoney(uid, money * i); - mail_id(userid, buf, "etc/ticket.win", SHM->i18nstr[cuser.language][1090]); + mail_id(userid, buf, "etc/ticket.win", I18N[1090]); } fclose(fp1); } if (fp) { - fprintf(fp, "%s"BBSNAME"("MYHOSTNAME"%s%s\n", SHM->i18nstr[cuser.language][1091], - SHM->i18nstr[cuser.language][1092], fromhost); + fprintf(fp, "%s"BBSNAME"("MYHOSTNAME"%s%s\n", I18N[1091], + I18N[1092], fromhost); fclose(fp); } if (bet != 98) - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][1093], bh->brdname); + snprintf(buf, sizeof(buf), I18N[1093], bh->brdname); else - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][1094], bh->brdname); - post_file(bh->brdname, buf, outcome, SHM->i18nstr[cuser.language][1095]); - post_file("Record", buf + 7, outcome, SHM->i18nstr[cuser.language][1096]); + snprintf(buf, sizeof(buf), I18N[1094], bh->brdname); + post_file(bh->brdname, buf, outcome, I18N[1095]); + post_file("Record", buf + 7, outcome, I18N[1096]); setbfile(buf, bh->brdname, FN_TICKET_RECORD); unlink(buf); diff --git a/mbbsd/gomo.c b/mbbsd/gomo.c index ba68e4ba..7df76b53 100644 --- a/mbbsd/gomo.c +++ b/mbbsd/gomo.c @@ -164,7 +164,7 @@ HO_add(Horder_t * mv) static void HO_undo(Horder_t * mv) { - char *str = SHM->i18nstr[cuser.language][1099]; + char *str = I18N[1099]; int n1, n2, loc; *mv = *(--v); @@ -197,7 +197,7 @@ HO_log(Horder_t *pool, char *user) i = 0; do { - fprintf(log, "[%2d]%s ==> %c%d%c", i + 1, SHM->i18nstr[cuser.language][1097 + i % 2], + fprintf(log, "[%2d]%s ==> %c%d%c", i + 1, I18N[1097 + i % 2], 'A' + ptr->x, ptr->y + 1, (i % 2) ? '\n' : '\t'); i++; } while (++ptr < v); @@ -207,9 +207,9 @@ HO_log(Horder_t *pool, char *user) stampfile(buf1, &mymail); mymail.filemode = FILE_READ ; - strlcpy(mymail.owner, SHM->i18nstr[cuser.language][1100], sizeof(mymail.owner)); + strlcpy(mymail.owner, I18N[1100], sizeof(mymail.owner)); snprintf(mymail.title, sizeof(mymail.title), - SHM->i18nstr[cuser.language][1101], cuser.userid, user); + I18N[1101], cuser.userid, user); sethomedir(title, cuser.userid); Rename(buf, buf1); append_record(title, &mymail, sizeof(mymail)); @@ -226,12 +226,12 @@ countgomo(Horder_t *pool) static int chkmv(Horder_t * mv, int color, int limit) { - char *xtype[] = {SHM->i18nstr[cuser.language][1102], SHM->i18nstr[cuser.language][1103], - SHM->i18nstr[cuser.language][1104], SHM->i18nstr[cuser.language][1105], - SHM->i18nstr[cuser.language][1106], SHM->i18nstr[cuser.language][1107], - SHM->i18nstr[cuser.language][1108], SHM->i18nstr[cuser.language][1109], - SHM->i18nstr[cuser.language][1110], SHM->i18nstr[cuser.language][1111], - SHM->i18nstr[cuser.language][1112]}; + char *xtype[] = {I18N[1102], I18N[1103], + I18N[1104], I18N[1105], + I18N[1106], I18N[1107], + I18N[1108], I18N[1109], + I18N[1110], I18N[1111], + I18N[1112]}; int rule = getstyle(mv->x, mv->y, color, limit); if (rule > 1 && rule < 13) { move(15, 40); @@ -250,7 +250,7 @@ gomo_key(int fd, int ch, Horder_t * mv) pbuf[0] = ch; if (fd) add_io(0, 0); - oldgetdata(17, 0, SHM->i18nstr[cuser.language][1113], pbuf, sizeof(pbuf), DOECHO); + oldgetdata(17, 0, I18N[1113], pbuf, sizeof(pbuf), DOECHO); if (fd) add_io(fd, 0); vx = pbuf[0] - 'a'; @@ -305,22 +305,22 @@ gomoku(int fd) setutmpmode(M_FIVE); clear(); - prints(SHM->i18nstr[cuser.language][1114], + prints(I18N[1114], cuser.userid, my->mateid); show_file("etc/@five", 1, -1, ONLY_COLOR); move(11, 40); - prints(SHM->i18nstr[cuser.language][1115], me == BBLACK ? SHM->i18nstr[cuser.language][1116] : SHM->i18nstr[cuser.language][1117]); + prints(I18N[1115], me == BBLACK ? I18N[1116] : I18N[1117]); move(16, 40); prints("\033[1;33m%s", cuser.userid); move(17, 40); prints("\033[1;33m%s", my->mateid); move(16, 60); - prints(SHM->i18nstr[cuser.language][1118], cuser.five_win, cuser.five_lose, cuser.five_tie); + prints(I18N[1118], cuser.five_win, cuser.five_lose, cuser.five_tie); getuser(my->mateid); move(17, 60); - prints(SHM->i18nstr[cuser.language][1119], xuser.five_win, xuser.five_lose, xuser.five_tie); + prints(I18N[1119], xuser.five_win, xuser.five_lose, xuser.five_tie); cuser.five_lose++; /* 一進來先加一場敗場, 贏了後再扣回去, 避免快輸了惡意斷線 */ @@ -331,26 +331,26 @@ gomoku(int fd) hewantpass = iwantpass = 0; mv.x = mv.y = 7; move(18, 40); - prints(SHM->i18nstr[cuser.language][1120], my->turn ? SHM->i18nstr[cuser.language][1121] : SHM->i18nstr[cuser.language][1122], + prints(I18N[1120], my->turn ? I18N[1121] : I18N[1122], MAX_TIME / 60, MAX_TIME % 60); for (;;) { move(13, 40); - outs(my->turn ? SHM->i18nstr[cuser.language][1123] : SHM->i18nstr[cuser.language][1124]); + outs(my->turn ? I18N[1123] : I18N[1124]); if (lastcount != tick - now) { lastcount = tick - now; move(18, 40); - prints(SHM->i18nstr[cuser.language][1125], my->turn ? SHM->i18nstr[cuser.language][1126] : SHM->i18nstr[cuser.language][1127], + prints(I18N[1125], my->turn ? I18N[1126] : I18N[1127], lastcount / 60, lastcount % 60); if (lastcount <= 0 && my->turn) { move(19, 40); - outs(SHM->i18nstr[cuser.language][1128]); + outs(I18N[1128]); my->five_lose++; send(fd, '\0', 1, 0); break; } if (lastcount <= -5 && !my->turn) { move(19, 40); - outs(SHM->i18nstr[cuser.language][1129]); + outs(I18N[1129]); cuser.five_lose--; cuser.five_win++; my->five_win++; @@ -363,7 +363,7 @@ gomoku(int fd) } move(14, 40); if (hewantpass) { - outs(SHM->i18nstr[cuser.language][1130]); + outs(I18N[1130]); bell(); } else clrtoeol(); @@ -420,10 +420,10 @@ gomoku(int fd) my->five_win++; } passwd_update(usernum, &cuser); - outmsg(SHM->i18nstr[cuser.language][1131]); + outmsg(I18N[1131]); break; } else { - outmsg(SHM->i18nstr[cuser.language][1132]); + outmsg(I18N[1132]); my->five_lose++; break; } @@ -441,7 +441,7 @@ gomoku(int fd) } } if (my->turn && mv.x == -1 && mv.y == -1) { - outmsg(SHM->i18nstr[cuser.language][1133]); + outmsg(I18N[1133]); tick = hislasttick; HO_undo(&mv); my->turn = 0; @@ -456,10 +456,10 @@ gomoku(int fd) ku[(int)mv.x][(int)mv.y] = he; bell(); BGOTO(mv.x, mv.y); - outs(SHM->i18nstr[cuser.language][1097 + he - 1]); + outs(I18N[1097 + he - 1]); if (win) { - outmsg(win == 1 ? SHM->i18nstr[cuser.language][1134] : SHM->i18nstr[cuser.language][1135]); + outmsg(win == 1 ? I18N[1134] : I18N[1135]); if (win != 1) { cuser.five_lose--; cuser.five_win++; @@ -483,7 +483,7 @@ gomoku(int fd) int win; HO_add(&mv); BGOTO(mv.x, mv.y); - outs(SHM->i18nstr[cuser.language][1097 + me - 1]); + outs(I18N[1097 + me - 1]); win = chkmv(&mv, me, me == BBLACK); ku[(int)mv.x][(int)mv.y] = me; mylasttick = tick; @@ -492,7 +492,7 @@ gomoku(int fd) if (send(fd, &mv, sizeof(Horder_t), 0) != sizeof(Horder_t)) break; if (win) { - outmsg(win == 1 ? SHM->i18nstr[cuser.language][1136] : SHM->i18nstr[cuser.language][1137]); + outmsg(win == 1 ? I18N[1136] : I18N[1137]); if (win == 1) { cuser.five_lose--; cuser.five_win++; @@ -514,7 +514,7 @@ gomoku(int fd) if (v > pool) { char ans[4]; - getdata(19, 0, SHM->i18nstr[cuser.language][1138], ans, sizeof(ans), LCECHO); + getdata(19, 0, I18N[1138], ans, sizeof(ans), LCECHO); if (*ans == 'y') HO_log(pool, my->mateid); } diff --git a/mbbsd/guess.c b/mbbsd/guess.c index 6bfa9072..1f989807 100644 --- a/mbbsd/guess.c +++ b/mbbsd/guess.c @@ -8,16 +8,16 @@ show_table(char TABLE[], char ifcomputer) int i; move(0, 35); - prints(SHM->i18nstr[cuser.language][1139]); + prints(I18N[1139]); move(8, 1); - prints(SHM->i18nstr[cuser.language][1140]); + prints(I18N[1140]); prints("\033[1;33m=================\033[m\n"); if (ifcomputer) { - prints(SHM->i18nstr[cuser.language][1141]); - prints(SHM->i18nstr[cuser.language][1142]); + prints(I18N[1141]); + prints(I18N[1142]); } else { for (i = 1; i <= 6; i++) - prints(SHM->i18nstr[cuser.language][1143], i, TABLE[i]); + prints(I18N[1143], i, TABLE[i]); } prints("\033[33m=================\033[m"); } @@ -29,9 +29,9 @@ get_money(void) char data[20]; move(1, 0); - prints(SHM->i18nstr[cuser.language][1144], cuser.money); + prints(I18N[1144], cuser.money); do { - getdata(2, 0, SHM->i18nstr[cuser.language][1145], data, 9, LCECHO); + getdata(2, 0, I18N[1145], data, 9, LCECHO); money = 0; if (data[0] == 'q' || data[0] == 'Q') { unlockutmpmode(); @@ -53,7 +53,7 @@ get_money(void) move(1, 0); clrtoeol(); reload_money(); - prints(SHM->i18nstr[cuser.language][1146], cuser.money - money); + prints(I18N[1146], cuser.money - money); return money; } @@ -78,7 +78,7 @@ static char * get_data(char data[5], int count) { while (1) { - getdata(6, 0, SHM->i18nstr[cuser.language][1147], data, 5, LCECHO); + getdata(6, 0, I18N[1147], data, 5, LCECHO); if (check_data(data) == 1) break; } @@ -173,7 +173,7 @@ computer(int correct, int total, char flag[], int n[]) if (k == 40) { move(total + 8, 25); snprintf(data, sizeof(data), "%04d", guess); - prints(SHM->i18nstr[cuser.language][1148], data); + prints(I18N[1148], data); return 1; } else { move(total + 8, 25); @@ -227,28 +227,28 @@ guess_main() FILE *file; clear(); - showtitle(SHM->i18nstr[cuser.language][1149], BBSName); + showtitle(I18N[1149], BBSName); lockreturn0(GUESSNUM, LOCK_MULTI); reload_money(); if (cuser.money < 5) { clear(); move(12, 35); - prints(SHM->i18nstr[cuser.language][1150]); + prints(I18N[1150]); unlockutmpmode(); pressanykey(); return 1; } if ((money = get_money()) == 0) return 1; - vice(money, SHM->i18nstr[cuser.language][1151]); + vice(money, I18N[1151]); Diff_Random(answer); move(2, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][1152], money); + prints(I18N[1152], money); - getdata_str(4, 0, SHM->i18nstr[cuser.language][1153], + getdata_str(4, 0, I18N[1153], ifcomputer, sizeof(ifcomputer), LCECHO, "y"); if (ifcomputer[0] == 'y') { ifcomputer[0] = 1; @@ -259,17 +259,17 @@ guess_main() } if (ifcomputer[0]) { do { - getdata(5, 0, SHM->i18nstr[cuser.language][1154], + getdata(5, 0, I18N[1154], yournum, sizeof(yournum), LCECHO); } while (!legal(atoi(yournum))); move(8, 25); - prints(SHM->i18nstr[cuser.language][1155]); + prints(I18N[1155]); flag = malloc(sizeof(char) * 10000); n = malloc(sizeof(int) * 1500); initcomputer(flag); } move(8, 55); - prints(SHM->i18nstr[cuser.language][1156]); + prints(I18N[1156]); while (((!computerwin || !youwin) && count < 10 && (ifcomputer[0])) || (!ifcomputer[0] && count < 10 && !youwin)) { if (!computerwin && ifcomputer[0]) { @@ -278,7 +278,7 @@ guess_main() computerwin = 1; } move(20, 55); - prints(SHM->i18nstr[cuser.language][1157], count + 1); + prints(I18N[1157], count + 1); if (!youwin) { ++count; if (guess_play(get_data(data, count), answer, count)) @@ -290,33 +290,33 @@ guess_main() free(n); if (ifcomputer[0]) { if (count > c_count) { - prints(SHM->i18nstr[cuser.language][1158]); + prints(I18N[1158]); move(18, 35); - prints(SHM->i18nstr[cuser.language][1159], money); + prints(I18N[1159], money); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, SHM->i18nstr[cuser.language][1160], c_count); + fprintf(file, I18N[1160], c_count); if (youwin) - fprintf(file, SHM->i18nstr[cuser.language][1161], cuser.userid, count); + fprintf(file, I18N[1161], cuser.userid, count); else - fprintf(file, SHM->i18nstr[cuser.language][1162], cuser.userid); - fprintf(file, SHM->i18nstr[cuser.language][1163], cuser.userid, money); + fprintf(file, I18N[1162], cuser.userid); + fprintf(file, I18N[1163], cuser.userid, money); fclose(file); } } else if (count < c_count) { - prints(SHM->i18nstr[cuser.language][1164]); + prints(I18N[1164]); move(18, 35); - prints(SHM->i18nstr[cuser.language][1165], money * 2); + prints(I18N[1165], money * 2); demoney(money * 2); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, SHM->i18nstr[cuser.language][1166], cuser.userid, count, + fprintf(file, I18N[1166], cuser.userid, count, c_count, money * 2); fclose(file); } } else { - prints(SHM->i18nstr[cuser.language][1167], money); + prints(I18N[1167], money); demoney(money); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, SHM->i18nstr[cuser.language][1168], cuser.userid); + fprintf(file, I18N[1168], cuser.userid); fclose(file); } } @@ -327,26 +327,26 @@ guess_main() if (youwin) { demoney(TABLE[count] * money); if (count < 5) { - prints(SHM->i18nstr[cuser.language][1169]); + prints(I18N[1169]); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, SHM->i18nstr[cuser.language][1170], + fprintf(file, I18N[1170], cuser.userid, count, TABLE[count] * money); fclose(file); } } else if (count > 5) { - prints(SHM->i18nstr[cuser.language][1171]); + prints(I18N[1171]); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, SHM->i18nstr[cuser.language][1172], + fprintf(file, I18N[1172], cuser.userid, count, money); fclose(file); } } else { - prints(SHM->i18nstr[cuser.language][1173]); + prints(I18N[1173]); move(18, 35); clrtoeol(); - prints(SHM->i18nstr[cuser.language][1174], money); + prints(I18N[1174], money); if ((file = fopen(LOGPASS, "a"))) { - fprintf(file, SHM->i18nstr[cuser.language][1175], + fprintf(file, I18N[1175], cuser.userid, count, money); fclose(file); } @@ -356,11 +356,11 @@ guess_main() return 1; } move(17, 35); - prints(SHM->i18nstr[cuser.language][1176], answer); + prints(I18N[1176], answer); move(18, 35); - prints(SHM->i18nstr[cuser.language][1177]); + prints(I18N[1177]); if ((file = fopen(BBSHOME "/etc/loseguess.log", "a"))) { - fprintf(file, SHM->i18nstr[cuser.language][1178], cuser.userid, money); + fprintf(file, I18N[1178], cuser.userid, money); fclose(file); } unlockutmpmode(); diff --git a/mbbsd/i18n.c b/mbbsd/i18n.c index 650709d7..4105977d 100644 --- a/mbbsd/i18n.c +++ b/mbbsd/i18n.c @@ -6,7 +6,6 @@ #define MAX_STRING_LEN 4096 #define MAX_BUFFER_SIZE (MAX_LANG * MAX_STRING * 20) -#ifdef I18N int parse_hex(unsigned char *buf, unsigned char *ret) { int len = 0; unsigned char table[] = "0123456789ABCDEF"; @@ -151,4 +150,3 @@ void load_i18nstring() { load_language(lang_file[i], SHM->i18nstr[i], &offset); } } -#endif diff --git a/mbbsd/indict.c b/mbbsd/indict.c index 6d040476..7c2566f4 100644 --- a/mbbsd/indict.c +++ b/mbbsd/indict.c @@ -18,12 +18,12 @@ addword(char *database,char word[]) if (HAVE_PERM(PERM_LOGINOK)) { clear(); move(4, 0); - outs(SHM->i18nstr[cuser.language][1179]); - prints(SHM->i18nstr[cuser.language][1180], buf); - outs(SHM->i18nstr[cuser.language][1181]); + outs(I18N[1179]); + prints(I18N[1180], buf); + outs(I18N[1181]); getdata(10, 0, ":", buf, 65, DOECHO); if (buf[0]) { - getdata(13, 0, SHM->i18nstr[cuser.language][1182], a, sizeof(a), LCECHO); + getdata(13, 0, I18N[1182], a, sizeof(a), LCECHO); if (a[0] != 'n') fprintf(fp, "%-65s[%s]\n", buf, cuser.userid); } @@ -42,15 +42,15 @@ choose_dict(char *dict,int dictlen,char *database,int databaselen) move(12, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][1183]); + outs(I18N[1183]); if ((fp = fopen(REFER, "r"))) { for(n=0; n<MAX_DICT && fscanf(fp,"%s %s",buf[n],data[n])==2; n++) { // XXX check buffer size - prints(SHM->i18nstr[cuser.language][1184], n + 1, buf[n]); + prints(I18N[1184], n + 1, buf[n]); } fclose(fp); - getdata(22, 14, SHM->i18nstr[cuser.language][1185], cho, 3, LCECHO); + getdata(22, 14, I18N[1185], cho, 3, LCECHO); c=atoi(cho); if (c >= 1 && c <= n) { @@ -71,7 +71,7 @@ use_dict(char *dict,char *database) char j, f, buf[120], sys[100]; int i = 0; - strlcpy(sys, SHM->i18nstr[cuser.language][1186], sizeof(sys)); + strlcpy(sys, I18N[1186], sizeof(sys)); setutmpmode(DICT); if (!HAS_PERM(PERM_SYSOP)) sys[0] = 0; @@ -79,14 +79,14 @@ use_dict(char *dict,char *database) clear(); snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][1187], dict); + I18N[1187], dict); strlcpy(&buf[100], "\033[m\n", sizeof(buf) - 100); for (;;) { move(0, 0); - prints(SHM->i18nstr[cuser.language][1188], dict); - prints(SHM->i18nstr[cuser.language][1189], sys); + prints(I18N[1188], dict); + prints(I18N[1189], sys); getdata(2, 0, ":", word, 18, DOECHO); - outs(SHM->i18nstr[cuser.language][1190]); + outs(I18N[1190]); str_lower(word, word); if (word[0] == 0) return 0; @@ -111,7 +111,7 @@ use_dict(char *dict,char *database) clear(); continue; } else { - outs(SHM->i18nstr[cuser.language][1191]); + outs(I18N[1191]); continue; } } @@ -130,7 +130,7 @@ use_dict(char *dict,char *database) i++; if (!((i + 1) % 17)) { move(23, 0); - outs(SHM->i18nstr[cuser.language][1192]); + outs(I18N[1192]); j = igetch(); if (j == 'q') break; @@ -145,7 +145,7 @@ use_dict(char *dict,char *database) fclose(fp); } if (i == 0) { - getdata(5, 0, SHM->i18nstr[cuser.language][1193], lang, 3, LCECHO); + getdata(5, 0, I18N[1193], lang, 3, LCECHO); if (lang[0] == 'y') { clear(); move(4, 0); diff --git a/mbbsd/lovepaper.c b/mbbsd/lovepaper.c index 6816b38e..681ddeee 100644 --- a/mbbsd/lovepaper.c +++ b/mbbsd/lovepaper.c @@ -20,16 +20,16 @@ x_love() move(1, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][1195]); - outs(SHM->i18nstr[cuser.language][1196]); + outs(I18N[1195]); + outs(I18N[1196]); - if (!getdata(7, 0, SHM->i18nstr[cuser.language][1197], receiver, sizeof(receiver), DOECHO)) + if (!getdata(7, 0, I18N[1197], receiver, sizeof(receiver), DOECHO)) return 0; if (receiver[0] && !(searchuser(receiver) && - getdata(8, 0, SHM->i18nstr[cuser.language][1198], save_title, + getdata(8, 0, I18N[1198], save_title, sizeof(save_title), DOECHO))) { move(10, 0); - outs(SHM->i18nstr[cuser.language][1199]); + outs(I18N[1199]); pressanykey(); return 0; } @@ -88,7 +88,7 @@ x_love() if (vedit(path, YEA, NULL) == -1) { unlink(path); clear(); - outs(SHM->i18nstr[cuser.language][1200]); + outs(I18N[1200]); pressanykey(); return -2; } diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 8fc3533d..2b9fca71 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -17,20 +17,20 @@ setforward() fscanf(fp, "%s", ip); // XXX check buffer size fclose(fp); } - getdata_buf(b_lines - 1, 0, SHM->i18nstr[cuser.language][1202], + getdata_buf(b_lines - 1, 0, I18N[1202], ip, sizeof(ip), DOECHO); if (ip[0] && ip[0] != ' ') { - getdata(b_lines, 0, SHM->i18nstr[cuser.language][1203], yn, sizeof(yn), + getdata(b_lines, 0, I18N[1203], yn, sizeof(yn), LCECHO); if (yn[0] != 'n' && (fp = fopen(buf, "w"))) { fprintf(fp, "%s", ip); fclose(fp); - vmsg(SHM->i18nstr[cuser.language][1204]); + vmsg(I18N[1204]); return 0; } } unlink(buf); - vmsg(SHM->i18nstr[cuser.language][1205]); + vmsg(I18N[1205]); return 0; } @@ -40,9 +40,9 @@ built_mail_index() char genbuf[128]; move(b_lines - 4, 0); - outs(SHM->i18nstr[cuser.language][1206]); + outs(I18N[1206]); getdata(b_lines - 1, 0, - SHM->i18nstr[cuser.language][1207], genbuf, 3, + I18N[1207], genbuf, 3, LCECHO); if (genbuf[0] != 'y') return 0; @@ -51,7 +51,7 @@ built_mail_index() BBSHOME "/bin/buildir " BBSHOME "/home/%c/%s", cuser.userid[0], cuser.userid); move(22, 0); - prints(SHM->i18nstr[cuser.language][1208]); + prints(I18N[1208]); pressanykey(); system(genbuf); return 0; @@ -116,13 +116,13 @@ m_internet() { char receiver[60]; - getdata(20, 0, SHM->i18nstr[cuser.language][1209], receiver, sizeof(receiver), DOECHO); + getdata(20, 0, I18N[1209], receiver, sizeof(receiver), DOECHO); if (strchr(receiver, '@') && !invalidaddr(receiver) && - getdata(21, 0, SHM->i18nstr[cuser.language][1210], save_title, STRLEN, DOECHO)) + getdata(21, 0, I18N[1210], save_title, STRLEN, DOECHO)) do_send(receiver, save_title); else { move(22, 0); - outs(SHM->i18nstr[cuser.language][1211]); + outs(I18N[1211]); pressanykey(); } return 0; @@ -159,7 +159,7 @@ chkmailbox() mailsumlimit) { bell(); bell(); - vmsg(SHM->i18nstr[cuser.language][1212], mailkeep, mailmaxkeep); + vmsg(I18N[1212], mailkeep, mailmaxkeep); return mailkeep; } } @@ -177,7 +177,7 @@ do_hold_mail(char *fpath, char *receiver, char *holder) stampfile(buf, &mymail); mymail.filemode = FILE_READ ; - strlcpy(mymail.owner, SHM->i18nstr[cuser.language][1214], sizeof(mymail.owner)); + strlcpy(mymail.owner, I18N[1214], sizeof(mymail.owner)); if (receiver) { snprintf(title, sizeof(title), "(%s) %s", receiver, save_title); strncpy(mymail.title, title, TTLEN); @@ -196,7 +196,7 @@ hold_mail(char *fpath, char *receiver) { char buf[4]; - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1215], + getdata(b_lines - 1, 0, I18N[1215], buf, sizeof(buf), LCECHO); if (buf[0] == 'y') @@ -222,7 +222,7 @@ do_send(char *userid, char *title) return -3; if (!title) - getdata(2, 0, SHM->i18nstr[cuser.language][1216], save_title, STRLEN - 20, DOECHO); + getdata(2, 0, I18N[1216], save_title, STRLEN - 20, DOECHO); curredit |= EDIT_MAIL; curredit &= ~EDIT_ITEM; } @@ -240,17 +240,17 @@ do_send(char *userid, char *title) return -2; } clear(); - prints(SHM->i18nstr[cuser.language][1217], + prints(I18N[1217], userid, title); ch = igetch(); switch (ch) { case 'N': case 'n': - outs(SHM->i18nstr[cuser.language][1218]); + outs(I18N[1218]); res = -2; break; default: - outs(SHM->i18nstr[cuser.language][1219]); + outs(I18N[1219]); res = #ifndef USE_BSMTP bbs_sendmail(fpath, title, userid); @@ -299,7 +299,7 @@ my_send(char *uident) outs(msg_cancel); break; case -3: - prints(SHM->i18nstr[cuser.language][1220], uident); + prints(I18N[1220], uident); break; } pressanykey(); @@ -310,7 +310,7 @@ m_send() { char uident[40]; - stand_title(SHM->i18nstr[cuser.language][1221]); + stand_title(I18N[1221]); usercomplete(msg_uid, uident); showplans(uident); if (uident[0]) @@ -326,18 +326,18 @@ multi_list(int *reciper) char genbuf[200]; while (1) { - stand_title(SHM->i18nstr[cuser.language][1222]); - ShowNameList(3, 0, SHM->i18nstr[cuser.language][1201]); + stand_title(I18N[1222]); + ShowNameList(3, 0, I18N[1201]); move(1, 0); - prints(SHM->i18nstr[cuser.language][1223]); + prints(I18N[1223]); getdata(2, 0, - SHM->i18nstr[cuser.language][1224], + I18N[1224], genbuf, 4, LCECHO); switch (genbuf[0]) { case 'a': while (1) { move(1, 0); - usercomplete(SHM->i18nstr[cuser.language][1225], uid); + usercomplete(I18N[1225], uid); if (uid[0] == '\0') break; @@ -350,18 +350,18 @@ multi_list(int *reciper) AddNameList(uid); (*reciper)++; } - ShowNameList(3, 0, SHM->i18nstr[cuser.language][1201]); + ShowNameList(3, 0, I18N[1201]); } break; case 'd': while (*reciper) { move(1, 0); - namecomplete(SHM->i18nstr[cuser.language][1226], uid); + namecomplete(I18N[1226], uid); if (uid[0] == '\0') break; if (RemoveNameList(uid)) (*reciper)--; - ShowNameList(3, 0, SHM->i18nstr[cuser.language][1201]); + ShowNameList(3, 0, I18N[1201]); } break; case '0': @@ -378,15 +378,15 @@ multi_list(int *reciper) genbuf[0] = '1'; case 'i': setuserfile(genbuf, genbuf[0] == '1' ? listfile : fn_overrides); - ToggleNameList(reciper, genbuf, SHM->i18nstr[cuser.language][1201]); + ToggleNameList(reciper, genbuf, I18N[1201]); break; case 'o': setuserfile(genbuf, "alohaed"); - ToggleNameList(reciper, genbuf, SHM->i18nstr[cuser.language][1201]); + ToggleNameList(reciper, genbuf, I18N[1201]); break; case 'n': setuserfile(genbuf, "postlist"); - ToggleNameList(reciper, genbuf, SHM->i18nstr[cuser.language][1201]); + ToggleNameList(reciper, genbuf, I18N[1201]); break; case 'q': *reciper = 0; @@ -415,7 +415,7 @@ multi_send(char *title) fp = fopen(quote_file, "r"); assert(fp); while (fgets(genbuf, 256, fp)) { - if (strncmp(genbuf, SHM->i18nstr[cuser.language][1227], 3)) { + if (strncmp(genbuf, I18N[1227], 3)) { if (listing) break; } else { @@ -428,12 +428,12 @@ multi_send(char *title) reciper++; } } while ((ptr = (char *)strtok(NULL, " \n\r"))); - } else if (!strncmp(genbuf + 3, SHM->i18nstr[cuser.language][1228], 6)) + } else if (!strncmp(genbuf + 3, I18N[1228], 6)) listing = 1; } } fclose(fp); - ShowNameList(3, 0, SHM->i18nstr[cuser.language][1201]); + ShowNameList(3, 0, I18N[1201]); } multi_list(&reciper); move(1, 0); @@ -444,21 +444,21 @@ multi_send(char *title) if (title) do_reply_title(2, title); else { - getdata(2, 0, SHM->i18nstr[cuser.language][1229], fpath, sizeof(fpath), DOECHO); - snprintf(save_title, sizeof(save_title), SHM->i18nstr[cuser.language][1230], fpath); + getdata(2, 0, I18N[1229], fpath, sizeof(fpath), DOECHO); + snprintf(save_title, sizeof(save_title), I18N[1230], fpath); } setuserfile(fpath, fn_notes); if ((fp = fopen(fpath, "w"))) { - fprintf(fp, SHM->i18nstr[cuser.language][1231], reciper); + fprintf(fp, I18N[1231], reciper); listing = 80; for (p = toplev; p; p = p->next) { reciper = strlen(p->word) + 1; if (listing + reciper > 75) { listing = reciper; - fprintf(fp, SHM->i18nstr[cuser.language][1232]); + fprintf(fp, I18N[1232]); } else listing += reciper; @@ -518,7 +518,7 @@ multi_reply(int ent, fileheader_t * fhdr, char *direct) if (!(fhdr->filemode & FILE_MULTI)) return mail_reply(ent, fhdr, direct); - stand_title(SHM->i18nstr[cuser.language][1234]); + stand_title(I18N[1234]); strlcpy(quote_user, fhdr->owner, sizeof(quote_user)); setuserfile(quote_file, fhdr->filename); multi_send(fhdr->title); @@ -528,7 +528,7 @@ multi_reply(int ent, fileheader_t * fhdr, char *direct) int mail_list() { - stand_title(SHM->i18nstr[cuser.language][1235]); + stand_title(I18N[1235]); multi_send(NULL); return 0; } @@ -543,16 +543,16 @@ mail_all() int i, unum; char *userid; - stand_title(SHM->i18nstr[cuser.language][1236]); + stand_title(I18N[1236]); setutmpmode(SMAIL); - getdata(2, 0, SHM->i18nstr[cuser.language][1237], fpath, sizeof(fpath), DOECHO); + getdata(2, 0, I18N[1237], fpath, sizeof(fpath), DOECHO); snprintf(save_title, sizeof(save_title), - SHM->i18nstr[cuser.language][1238], fpath); + I18N[1238], fpath); setuserfile(fpath, fn_notes); if ((fp = fopen(fpath, "w"))) { - fprintf(fp, SHM->i18nstr[cuser.language][1239]); + fprintf(fp, I18N[1239]); fprintf(fp, "---------------------------------------------------------------------------\n"); fclose(fp); } @@ -570,7 +570,7 @@ mail_all() curredit = 0; setutmpmode(MAILALL); - stand_title(SHM->i18nstr[cuser.language][1240]); + stand_title(I18N[1240]); sethomepath(genbuf, cuser.userid); stampfile(genbuf, &mymail); @@ -619,7 +619,7 @@ mail_mbox() fileheader_t fhdr; snprintf(cmd, sizeof(cmd), "/tmp/%s.uu", cuser.userid); - snprintf(fhdr.title, sizeof(fhdr.title), SHM->i18nstr[cuser.language][1241], cuser.userid); + snprintf(fhdr.title, sizeof(fhdr.title), I18N[1241], cuser.userid); doforward(cmd, &fhdr, 'Z'); return 0; } @@ -629,7 +629,7 @@ m_forward(int ent, fileheader_t * fhdr, char *direct) { char uid[STRLEN]; - stand_title(SHM->i18nstr[cuser.language][1242]); + stand_title(I18N[1242]); usercomplete(msg_uid, uid); if (uid[0] == '\0') return FULLUPDATE; @@ -639,7 +639,7 @@ m_forward(int ent, fileheader_t * fhdr, char *direct) snprintf(save_title, sizeof(save_title), "%.64s (fwd)", fhdr->title); move(1, 0); clrtobot(); - prints(SHM->i18nstr[cuser.language][1243], uid, save_title); + prints(I18N[1243], uid, save_title); switch (do_send(uid, save_title)) { case -1: @@ -649,7 +649,7 @@ m_forward(int ent, fileheader_t * fhdr, char *direct) outs(msg_cancel); break; case -3: - prints(SHM->i18nstr[cuser.language][1244], uid); + prints(I18N[1244], uid); break; } pressanykey(); @@ -678,8 +678,8 @@ read_new_mail(fileheader_t * fptr) return 0; clear(); move(10, 0); - prints(SHM->i18nstr[cuser.language][1245], fptr->owner, fptr->title); - getdata(11, 0, SHM->i18nstr[cuser.language][1246], genbuf, 3, DOECHO); + prints(I18N[1245], fptr->owner, fptr->title); + getdata(11, 0, I18N[1246], genbuf, 3, DOECHO); if (genbuf[0] == 'q') return QUIT; if (genbuf[0] == 'n') @@ -728,7 +728,7 @@ read_new_mail(fileheader_t * fptr) } if (delete_it) { clear(); - prints(SHM->i18nstr[cuser.language][1247], fptr->title); + prints(I18N[1247], fptr->title); getdata(1, 0, msg_sure_ny, genbuf, 2, LCECHO); if (genbuf[0] == 'y') { unlink(fname); @@ -750,7 +750,7 @@ m_new() curredit |= EDIT_MAIL; curredit &= ~EDIT_ITEM; if (apply_record(currmaildir, read_new_mail, sizeof(fileheader_t)) == -1) { - outs(SHM->i18nstr[cuser.language][1248]); + outs(I18N[1248]); pressanykey(); return -1; } @@ -759,7 +759,7 @@ m_new() while (delcnt--) delete_record(currmaildir, sizeof(fileheader_t), delmsgs[delcnt]); } - outs(mrd ? SHM->i18nstr[cuser.language][1249] : SHM->i18nstr[cuser.language][1250]); + outs(mrd ? I18N[1249] : I18N[1250]); pressanykey(); return -1; } @@ -769,13 +769,13 @@ mailtitle() { char buf[256]; - showtitle(SHM->i18nstr[cuser.language][1251], BBSName); - prints(SHM->i18nstr[cuser.language][1252], - HAS_PERM(PERM_NOOUTMAIL) ? SHM->i18nstr[cuser.language][1253] : SHM->i18nstr[cuser.language][1254]); + showtitle(I18N[1251], BBSName); + prints(I18N[1252], + HAS_PERM(PERM_NOOUTMAIL) ? I18N[1253] : I18N[1254]); buf[0] = 0; if (mailsumlimit) { snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][1255], mailsum, mailsumlimit, + I18N[1255], mailsum, mailsumlimit, mailkeep, mailmaxkeep); } prints("%-29s\033[m", buf); @@ -792,7 +792,7 @@ maildoent(int num, fileheader_t * ent) title = subject(mark = ent->title); if (title == mark) { color = '1'; - mark = SHM->i18nstr[cuser.language][1256]; + mark = I18N[1256]; } else { color = '3'; mark = "R:"; @@ -896,7 +896,7 @@ mail_reply(int ent, fileheader_t * fhdr, char *direct) FILE *fp; char genbuf[512]; - stand_title(SHM->i18nstr[cuser.language][1257]); + stand_title(I18N[1257]); /* 判斷是 boards 或 mail */ if (curredit & EDIT_MAIL) @@ -916,7 +916,7 @@ mail_reply(int ent, fileheader_t * fhdr, char *direct) if (!strcmp(t, str_author1) || !strcmp(t, str_author2)) strlcpy(uid, strtok(NULL, str_space), sizeof(uid)); else { - outs(SHM->i18nstr[cuser.language][1258]); + outs(I18N[1258]); pressanykey(); return FULLUPDATE; } @@ -925,7 +925,7 @@ mail_reply(int ent, fileheader_t * fhdr, char *direct) /* make the title */ do_reply_title(3, fhdr->title); - prints(SHM->i18nstr[cuser.language][1259], uid, save_title); + prints(I18N[1259], uid, save_title); /* edit, then send the mail */ ent = curredit; @@ -937,7 +937,7 @@ mail_reply(int ent, fileheader_t * fhdr, char *direct) outs(msg_cancel); break; case -3: - prints(SHM->i18nstr[cuser.language][1260], uid); + prints(I18N[1260], uid); break; } curredit = ent; @@ -952,7 +952,7 @@ mail_edit(int ent, fileheader_t * fhdr, char *direct) if (!HAS_PERM(PERM_SYSOP) && strcmp(cuser.userid, fhdr->owner) && - strcmp(SHM->i18nstr[cuser.language][1261], fhdr->owner)) + strcmp(I18N[1261], fhdr->owner)) return DONOTHING; setdirpath(genbuf, direct, fhdr->filename); @@ -1003,7 +1003,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, char *direct) move(2, 0); clrtoeol(); move(1, 0); - generalnamecomplete(SHM->i18nstr[cuser.language][1283], xboard, sizeof(xboard), + generalnamecomplete(I18N[1283], xboard, sizeof(xboard), SHM->Bnumber, completeboard_compar, completeboard_permission, @@ -1013,27 +1013,27 @@ mail_cross_post(int ent, fileheader_t * fhdr, char *direct) ent = 1; if (HAS_PERM(PERM_SYSOP) || !strcmp(fhdr->owner, cuser.userid)) { - getdata(2, 0, SHM->i18nstr[cuser.language][1284], + getdata(2, 0, I18N[1284], genbuf, 3, DOECHO); if (genbuf[0] != '2') { ent = 0; - getdata(2, 0, SHM->i18nstr[cuser.language][1285], inputbuf, 3, DOECHO); + getdata(2, 0, I18N[1285], inputbuf, 3, DOECHO); if (inputbuf[0] != 'n' && inputbuf[0] != 'N') author = 1; } } if (ent) - snprintf(xtitle, sizeof(xtitle), SHM->i18nstr[cuser.language][1286], fhdr->title); + snprintf(xtitle, sizeof(xtitle), I18N[1286], fhdr->title); else strlcpy(xtitle, fhdr->title, sizeof(xtitle)); - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][1287], xtitle); + snprintf(genbuf, sizeof(genbuf), I18N[1287], xtitle); getdata(2, 0, genbuf, genbuf2, sizeof(genbuf2), LCECHO); if (*genbuf2 == 'n') - if (getdata(2, 0, SHM->i18nstr[cuser.language][1288], genbuf, TTLEN, DOECHO)) + if (getdata(2, 0, I18N[1288], genbuf, TTLEN, DOECHO)) strlcpy(xtitle, genbuf, sizeof(xtitle)); - getdata(2, 0, SHM->i18nstr[cuser.language][1289], genbuf, 3, LCECHO); + getdata(2, 0, I18N[1289], genbuf, 3, LCECHO); if (genbuf[0] == 'l' || genbuf[0] == 's') { int currmode0 = currmode; @@ -1060,7 +1060,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, char *direct) write_header(xptr); currboard = save_currboard; - fprintf(xptr, SHM->i18nstr[cuser.language][1290], cuser.userid); + fprintf(xptr, I18N[1290], cuser.userid); b_suckinfile(xptr, fname); addsignature(xptr, 0); @@ -1076,7 +1076,7 @@ mail_cross_post(int ent, fileheader_t * fhdr, char *direct) if (!xfile.filemode) outgo_post(&xfile, xboard); cuser.numposts++; - outmsg(SHM->i18nstr[cuser.language][1291]); + outmsg(I18N[1291]); pressanykey(); currmode = currmode0; } @@ -1092,7 +1092,7 @@ mail_man() int stat0 = currstat; sethomeman(buf, cuser.userid); - snprintf(buf1, sizeof(buf1), SHM->i18nstr[cuser.language][1292], cuser.userid); + snprintf(buf1, sizeof(buf1), I18N[1292], cuser.userid); a_menu(buf1, buf, 1); currutmp->mode = mode0; currstat = stat0; @@ -1111,7 +1111,7 @@ mail_cite(int ent, fileheader_t * fhdr, char *direct) int bid; setuserfile(fpath, fhdr->filename); - strlcpy(title, SHM->i18nstr[cuser.language][1293], sizeof(title)); + strlcpy(title, I18N[1293], sizeof(title)); strncpy(title + 3, fhdr->title, TTLEN - 3); title[TTLEN] = '\0'; a_copyitem(fpath, title, 0, 1); @@ -1123,7 +1123,7 @@ mail_cite(int ent, fileheader_t * fhdr, char *direct) clrtoeol(); move(1, 0); - generalnamecomplete(SHM->i18nstr[cuser.language][1294], + generalnamecomplete(I18N[1294], buf, sizeof(buf), SHM->Bnumber, completeboard_compar, @@ -1154,7 +1154,7 @@ mail_save(int ent, fileheader_t * fhdr, char *direct) if (HAS_PERM(PERM_MAILLIMIT)) { setuserfile(fpath, fhdr->filename); - strlcpy(title, SHM->i18nstr[cuser.language][1295], sizeof(title)); + strlcpy(title, I18N[1295], sizeof(title)); strncpy(title + 3, fhdr->title, TTLEN - 3); title[TTLEN] = '\0'; a_copyitem(fpath, title, fhdr->owner, 1); @@ -1173,30 +1173,30 @@ mail_waterball(int ent, fileheader_t * fhdr, char *direct) char fname[500], genbuf[200]; FILE *fp; - if (!(strstr(fhdr->title, SHM->i18nstr[cuser.language][1296]) && strstr(fhdr->title, SHM->i18nstr[cuser.language][1297]))) { - vmsg(SHM->i18nstr[cuser.language][1298]); + if (!(strstr(fhdr->title, I18N[1296]) && strstr(fhdr->title, I18N[1297]))) { + vmsg(I18N[1298]); return 1; } if (!address[0]) strlcpy(address, cuser.email, sizeof(address)); move(b_lines - 8, 0); - outs(SHM->i18nstr[cuser.language][1299]); + outs(I18N[1299]); if (address[0]) { - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][1300], address); + snprintf(genbuf, sizeof(genbuf), I18N[1300], address); getdata(b_lines - 5, 0, genbuf, fname, 3, LCECHO); if (fname[0] == 'q') { - outmsg(SHM->i18nstr[cuser.language][1301]); + outmsg(I18N[1301]); return 1; } if (fname[0] == 'n') address[0] = '\0'; } if (!address[0]) { - getdata(b_lines - 5, 0, SHM->i18nstr[cuser.language][1302], fname, 60, DOECHO); + getdata(b_lines - 5, 0, I18N[1302], fname, 60, DOECHO); if (fname[0] && strchr(fname, '.')) { strlcpy(address, fname, sizeof(address)); } else { - vmsg(SHM->i18nstr[cuser.language][1303]); + vmsg(I18N[1303]); return 1; } } @@ -1204,17 +1204,17 @@ mail_waterball(int ent, fileheader_t * fhdr, char *direct) return -2; if( strstr(address, ".bbs") && HAS_PERM(PERM_NOOUTMAIL) ){ move(b_lines - 4, 0); - outs(SHM->i18nstr[cuser.language][1304]); - vmsg(SHM->i18nstr[cuser.language][1305]); + outs(I18N[1304]); + vmsg(I18N[1305]); return FULLUPDATE; } //snprintf(fname, sizeof(fname), "%d\n", cmode); move(b_lines - 4, 0); - outs(SHM->i18nstr[cuser.language][1306]); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1307], fname, 3, LCECHO); + outs(I18N[1306]); + getdata(b_lines - 1, 0, I18N[1307], fname, 3, LCECHO); if (fname[0] == 'Q' || fname[0] == 'q') { - outmsg(SHM->i18nstr[cuser.language][1308]); + outmsg(I18N[1308]); return 1; } cmode = (fname[0] != '0' && fname[0] != '1') ? 1 : fname[0] - '0'; @@ -1231,7 +1231,7 @@ mail_waterball(int ent, fileheader_t * fhdr, char *direct) assert(fp); fprintf(fp, "%s\n%s\n%d\n", cuser.userid, address, cmode); fclose(fp); - vmsg(SHM->i18nstr[cuser.language][1309]); + vmsg(I18N[1309]); return FULLUPDATE; } #endif @@ -1340,7 +1340,7 @@ m_read() currutmp->mailalert = load_mailalert(cuser.userid); return 0; } else { - outs(SHM->i18nstr[cuser.language][1310]); + outs(I18N[1310]); return XEASY; } } @@ -1416,7 +1416,7 @@ bbs_sendmail(char *fpath, char *title, char *receiver) cuser.userid, str_mail_address, cuser.username, cuser.userid, str_mail_address); - fprintf(fout,"To: %s\nSubject: %s\nMime-Version: 1.0\r\nContent-Type: text/plain; charset=\"big5\"\r\nContent-Transfer-Encoding: 8bit\r\nX-Disclaimer: " BBSNAME SHM->i18nstr[cuser.language][1311], + fprintf(fout,"To: %s\nSubject: %s\nMime-Version: 1.0\r\nContent-Type: text/plain; charset=\"big5\"\r\nContent-Transfer-Encoding: 8bit\r\nX-Disclaimer: " BBSNAME I18N[1311], receiver, title); while (fgets(genbuf, sizeof(genbuf), fin)) { @@ -1493,16 +1493,16 @@ doforward(char *direct, fileheader_t * fh, int mode) strlcpy(address, cuser.email, sizeof(address)); if( mode == 'U' ){ - vmsg(SHM->i18nstr[cuser.language][1312]); + vmsg(I18N[1312]); } if (address[0]) { snprintf(genbuf, sizeof(genbuf), - SHM->i18nstr[cuser.language][1313], address); + I18N[1313], address); getdata(b_lines, 0, genbuf, fname, 3, LCECHO); if (fname[0] == 'q') { - outmsg(SHM->i18nstr[cuser.language][1314]); + outmsg(I18N[1314]); return 1; } if (fname[0] == 'n') @@ -1510,7 +1510,7 @@ doforward(char *direct, fileheader_t * fh, int mode) } if (!address[0]) { do { - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1315], fname, 60, DOECHO); + getdata(b_lines - 1, 0, I18N[1315], fname, 60, DOECHO); if (fname[0]) { if (strchr(fname, '.')) strlcpy(address, fname, sizeof(address)); @@ -1518,7 +1518,7 @@ doforward(char *direct, fileheader_t * fh, int mode) snprintf(address, sizeof(address), "%s.bbs@%s", fname, MYHOSTNAME); } else { - vmsg(SHM->i18nstr[cuser.language][1316]); + vmsg(I18N[1316]); return 1; } } while (mode == 'Z' && strstr(address, MYHOSTNAME)); @@ -1621,7 +1621,7 @@ mail_justify(userec_t muser) stampfile(buf1, &mhdr); unlink(buf1); strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner)); - strncpy(mhdr.title, SHM->i18nstr[cuser.language][1318], TTLEN); + strncpy(mhdr.title, I18N[1318], TTLEN); mhdr.filemode = 0; if (valid_ident(muser.email) && !invalidaddr(muser.email)) { diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 1cb7942f..720f876e 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -156,7 +156,7 @@ u_exit(char *mode) setutmpbid(0); if (!(HAS_PERM(PERM_SYSOP) && HAS_PERM(PERM_SYSOPHIDE)) && !currutmp->invisible) - do_aloha(SHM->i18nstr[cuser.language][1319]); + do_aloha(I18N[1319]); purge_utmp(currutmp); if ((cuser.uflag != enter_uflag) || (currmode & MODE_DIRTY) || diff) { @@ -215,10 +215,10 @@ talk_request(int sig) move(0, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][1321], + prints(I18N[1321], SHM->uinfo[currutmp->destuip].userid, my_ctime(&now,timebuf,sizeof(timebuf)), - (currutmp->sig == 2) ? SHM->i18nstr[cuser.language][1322] - : SHM->i18nstr[cuser.language][1323]); + (currutmp->sig == 2) ? I18N[1322] + : I18N[1323]); refresh(); } else { unsigned char mode0 = currutmp->mode; @@ -241,7 +241,7 @@ void show_call_in(int save, int which) { char buf[200]; - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][1324], + snprintf(buf, sizeof(buf), I18N[1324], currutmp->msgs[which].userid, currutmp->msgs[which].last_call_in); move(b_lines, 0); clrtoeol(); @@ -438,7 +438,7 @@ multi_user_check() if (!pid /* || (kill(pid, 0) == -1) */ ) return; /* stale entry in utmp file */ - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1325], + getdata(b_lines - 1, 0, I18N[1325], genbuf, 3, LCECHO); if (genbuf[0] != 'n') { @@ -452,7 +452,7 @@ multi_user_check() } else { /* allow multiple guest user */ if (search_ulistn(usernum, 100) != NULL) { - vmsg(SHM->i18nstr[cuser.language][1326]); + vmsg(I18N[1326]); exit(1); } } @@ -530,7 +530,7 @@ login_query() move(19, 0); prints("current pid: %d ", getpid()); #endif - getdata(20, 0, SHM->i18nstr[cuser.language][1327], + getdata(20, 0, I18N[1327], uid, sizeof(uid), DOECHO); #ifdef CONVERT /* switch to gb mode if uid end with '.' */ @@ -553,7 +553,7 @@ login_query() mkuserdir(cuser.userid); break; #else - outs(SHM->i18nstr[cuser.language][1328]); + outs(I18N[1328]); continue; #endif } else if (uid[0] == '\0'){ @@ -777,7 +777,7 @@ setup_utmp(int mode) } inline static void welcome_msg(void) { - prints(SHM->i18nstr[cuser.language][1329], + prints(I18N[1329], ++cuser.numlogins, cuser.lasthost, Cdate(&(cuser.lastlogin))); pressanykey(); } @@ -787,8 +787,8 @@ inline static void check_bad_login(void) { setuserfile(genbuf, str_badlogin); if (more(genbuf, NA) != -1) { move(b_lines - 3, 0); - prints(SHM->i18nstr[cuser.language][1330]); - if (getans(SHM->i18nstr[cuser.language][1331]) != 'n') + prints(I18N[1330]); + if (getans(I18N[1331]) != 'n') unlink(genbuf); } } @@ -816,23 +816,23 @@ static void init_guest_info(void) { int i; char *nick[13] = { - SHM->i18nstr[cuser.language][1332], SHM->i18nstr[cuser.language][1333], SHM->i18nstr[cuser.language][1334], SHM->i18nstr[cuser.language][1335], SHM->i18nstr[cuser.language][1336], - SHM->i18nstr[cuser.language][1337], SHM->i18nstr[cuser.language][1338], SHM->i18nstr[cuser.language][1339], SHM->i18nstr[cuser.language][1340], SHM->i18nstr[cuser.language][1341], - SHM->i18nstr[cuser.language][1342], SHM->i18nstr[cuser.language][1343], SHM->i18nstr[cuser.language][1344] + I18N[1332], I18N[1333], I18N[1334], I18N[1335], I18N[1336], + I18N[1337], I18N[1338], I18N[1339], I18N[1340], I18N[1341], + I18N[1342], I18N[1343], I18N[1344] }; char *name[13] = { - SHM->i18nstr[cuser.language][1345], SHM->i18nstr[cuser.language][1346], SHM->i18nstr[cuser.language][1347], SHM->i18nstr[cuser.language][1348], SHM->i18nstr[cuser.language][1349], - SHM->i18nstr[cuser.language][1350], SHM->i18nstr[cuser.language][1351], "AIR Jordon", SHM->i18nstr[cuser.language][1352], SHM->i18nstr[cuser.language][1353], - SHM->i18nstr[cuser.language][1354], SHM->i18nstr[cuser.language][1355], SHM->i18nstr[cuser.language][1356] + I18N[1345], I18N[1346], I18N[1347], I18N[1348], I18N[1349], + I18N[1350], I18N[1351], "AIR Jordon", I18N[1352], I18N[1353], + I18N[1354], I18N[1355], I18N[1356] }; char *addr[13] = { - SHM->i18nstr[cuser.language][1357], SHM->i18nstr[cuser.language][1358], SHM->i18nstr[cuser.language][1359], SHM->i18nstr[cuser.language][1360], SHM->i18nstr[cuser.language][1361], - SHM->i18nstr[cuser.language][1362], SHM->i18nstr[cuser.language][1363], "NIKE", SHM->i18nstr[cuser.language][1364], SHM->i18nstr[cuser.language][1365], - SHM->i18nstr[cuser.language][1366], SHM->i18nstr[cuser.language][1367], SHM->i18nstr[cuser.language][1368] + I18N[1357], I18N[1358], I18N[1359], I18N[1360], I18N[1361], + I18N[1362], I18N[1363], "NIKE", I18N[1364], I18N[1365], + I18N[1366], I18N[1367], I18N[1368] }; i = login_start_time % 13; snprintf(cuser.username, sizeof(cuser.username), - SHM->i18nstr[cuser.language][1369], nick[(int)i]); + I18N[1369], nick[(int)i]); strlcpy(currutmp->username, cuser.username, sizeof(currutmp->username)); strlcpy(cuser.realname, name[(int)i], sizeof(cuser.realname)); @@ -845,11 +845,11 @@ static void init_guest_info(void) inline static void foreign_warning(void){ if ((cuser.uflag2 & FOREIGN) && !(cuser.uflag2 & LIVERIGHT)){ if (login_start_time - cuser.firstlogin > (FOREIGN_REG_DAY - 5) * 24 * 3600){ - mail_muser(cuser, SHM->i18nstr[cuser.language][1370], "etc/foreign_expired_warn"); + mail_muser(cuser, I18N[1370], "etc/foreign_expired_warn"); } else if (login_start_time - cuser.firstlogin > FOREIGN_REG_DAY * 24 * 3600){ cuser.userlevel &= ~(PERM_LOGINOK | PERM_POST); - vmsg(SHM->i18nstr[cuser.language][1371]); + vmsg(I18N[1371]); } } } @@ -894,7 +894,7 @@ user_login() resolve_fcache(); resolve_boards(); memset(&water[0], 0, sizeof(water_t) * 6); - strlcpy(water[0].userid, SHM->i18nstr[cuser.language][1372], sizeof(water[0].userid)); + strlcpy(water[0].userid, I18N[1372], sizeof(water[0].userid)); if(getenv("SSH_CLIENT") != NULL){ char frombuf[50]; @@ -919,7 +919,7 @@ user_login() if (!(HAS_PERM(PERM_SYSOP) && HAS_PERM(PERM_SYSOPHIDE)) && !currutmp->invisible) - do_aloha(SHM->i18nstr[cuser.language][1373]); + do_aloha(I18N[1373]); if(SHM->loginmsg.pid) { @@ -1048,7 +1048,7 @@ start_client() showansi = 0; signal(SIGALRM, SIG_IGN); - domenu(MMENU, SHM->i18nstr[cuser.language][1374], (currutmp->mailalert ? 'M' : 'C'), cmdlist); + domenu(MMENU, I18N[1374], (currutmp->mailalert ? 'M' : 'C'), cmdlist); } /* FSA (finite state automata) for telnet protocol */ @@ -1438,7 +1438,7 @@ check_ban_and_load(int fd) write(fd, INSCREEN, sizeof(INSCREEN)); #else #define BANNER \ -SHM->i18nstr[cuser.language][1375] BBSNAME SHM->i18nstr[cuser.language][1376] MYHOSTNAME SHM->i18nstr[cuser.language][1377] MYIP ") \r\n" +I18N[1375] BBSNAME I18N[1376] MYHOSTNAME I18N[1377] MYIP ") \r\n" write(fd, BANNER, sizeof(BANNER)); #endif @@ -1463,9 +1463,9 @@ SHM->i18nstr[cuser.language][1375] BBSNAME SHM->i18nstr[cuser.language][1376] MY } if(overload == 1) - write(fd, SHM->i18nstr[cuser.language][1378], 22); + write(fd, I18N[1378], 22); else if(overload == 2) - write(fd, SHM->i18nstr[cuser.language][1379], 28); + write(fd, I18N[1379], 28); else if (banned && (fp = fopen(BBSHOME "/" BAN_FILE, "r"))) { char buf[256]; while (fgets(buf, sizeof(buf), fp)) diff --git a/mbbsd/menu.c b/mbbsd/menu.c index 0317a340..23c14428 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -31,12 +31,12 @@ showtitle(char *title, char *mid) } #else else if (currutmp->mailalert) { - snprintf(buf1, sizeof(buf1), "%s"TITLE_COLOR, SHM->i18nstr[cuser.language][1380]); + snprintf(buf1, sizeof(buf1), "%s"TITLE_COLOR, I18N[1380]); mid = buf1; spc = 22; } else if (HAS_PERM(PERM_SYSOP) && (nreg = dashs(fn_register) / 163) > 10) { snprintf(numreg, sizeof(numreg), - SHM->i18nstr[cuser.language][1381], + I18N[1381], nreg, (int)dashs("register.new.tmp") / 163, TITLE_COLOR); mid = numreg; spc = 22; @@ -50,10 +50,10 @@ showtitle(char *title, char *mid) buf[spc] = '\0'; clear(); - prints(SHM->i18nstr[cuser.language][1382], TITLE_COLOR, + prints(I18N[1382], TITLE_COLOR, title, buf, mid, buf, " " + pad, - 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]); + currmode & MODE_SELECT ? I18N[1383] : currmode & MODE_ETC ? I18N[1384] : + currmode & MODE_DIGEST ? I18N[1385] : I18N[1386]); if (strcmp(currboard, lastboard)) { /* change board */ if (currboard[0] != 0 && @@ -68,7 +68,7 @@ showtitle(char *title, char *mid) prints("\033[32m%s", currboard); else prints("%s", currboard); - prints(SHM->i18nstr[cuser.language][1387], currmode & MODE_SELECT ? 6 : + prints(I18N[1387], currmode & MODE_SELECT ? 6 : currmode & MODE_ETC ? 5 : currmode & MODE_DIGEST ? 2 : 7); } @@ -83,15 +83,15 @@ show_status(void) int i; struct tm *ptime = localtime(&now); char mystatus[160]; - 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]}; + char *myweek = I18N[1388]; + const char *msgs[] = {I18N[1389], I18N[1390], I18N[1391], I18N[1392], I18N[1393]}; i = ptime->tm_wday << 1; snprintf(mystatus, sizeof(mystatus), - SHM->i18nstr[cuser.language][1394], + I18N[1394], ptime->tm_mon + 1, ptime->tm_mday, myweek[i], myweek[i + 1], ptime->tm_hour, ptime->tm_min, currutmp->birth ? - SHM->i18nstr[cuser.language][1395] : SHM->today_is, + I18N[1395] : SHM->today_is, SHM->UTMPnumber, cuser.userid, msgs[currutmp->pager]); outmsg(mystatus); } @@ -155,8 +155,8 @@ show_menu(commands_t * p) move(menu_row, 0); while (p[n].desc > 0 && p[n].desc < MAX_STRING) { if (HAS_PERM(p[n].level)) { - s = SHM->i18nstr[cuser.language][p[n].desc]; - snprintf(buf, sizeof(buf), s + 2, SHM->i18nstr[cuser.language][1396 + cuser.proverb % 4]); + s = I18N[p[n].desc]; + snprintf(buf, sizeof(buf), s + 2, I18N[1396 + cuser.proverb % 4]); prints("%*s (\033[1;36m%c\033[0m)%s\n", menu_column, "", s[1], buf); } @@ -261,15 +261,15 @@ domenu(int cmdmode, char *cmdtitle, int cmd, commands_t cmdtable[]) refscreen = YEA; if (err != -1) - cmd = SHM->i18nstr[cuser.language][cmdtable[lastcmdptr].desc][0]; + cmd = I18N[cmdtable[lastcmdptr].desc][0]; else - cmd = SHM->i18nstr[cuser.language][cmdtable[lastcmdptr].desc][1]; - cmd0[cmdmode] = SHM->i18nstr[cuser.language][cmdtable[lastcmdptr].desc][0]; + cmd = I18N[cmdtable[lastcmdptr].desc][1]; + cmd0[cmdmode] = I18N[cmdtable[lastcmdptr].desc][0]; } if (cmd >= 'a' && cmd <= 'z') cmd &= ~0x20; while (++i <= total) - if (SHM->i18nstr[cuser.language][cmdtable[i].desc][1] == cmd) + if (I18N[cmdtable[i].desc][1] == cmd) break; } @@ -428,7 +428,7 @@ static commands_t moneylist[] = { }; static int p_money() { - domenu(PSALE, SHM->i18nstr[cuser.language][1467], '0', moneylist); + domenu(PSALE, I18N[1467], '0', moneylist); return 0; }; @@ -443,7 +443,7 @@ static commands_t jceelist[] = { }; static int m_jcee() { - domenu(JCEE, SHM->i18nstr[cuser.language][1473], '0', jceelist); + domenu(JCEE, I18N[1473], '0', jceelist); return 0; } #endif @@ -480,7 +480,7 @@ static commands_t chesslist[] = { }; static int chessroom() { - domenu(CHC, SHM->i18nstr[cuser.language][1486], '1', chesslist); + domenu(CHC, I18N[1486], '1', chesslist); return 0; } @@ -501,7 +501,7 @@ static commands_t plist[] = { }; static int playground() { - domenu(AMUSE, SHM->i18nstr[cuser.language][1495],'1',plist); + domenu(AMUSE, I18N[1495],'1',plist); return 0; } @@ -513,7 +513,7 @@ static commands_t slist[] = { }; static int forsearch() { - domenu(SREG, SHM->i18nstr[cuser.language][1499], '1', slist); + domenu(SREG, I18N[1499], '1', slist); return 0; } @@ -521,43 +521,43 @@ static int forsearch() { int admin() { - domenu(ADMIN, SHM->i18nstr[cuser.language][1500], 'X', adminlist); + domenu(ADMIN, I18N[1500], 'X', adminlist); return 0; } int Mail() { - domenu(MAIL, SHM->i18nstr[cuser.language][1501], 'R', maillist); + domenu(MAIL, I18N[1501], 'R', maillist); return 0; } int Talk() { - domenu(TMENU, SHM->i18nstr[cuser.language][1502], 'U', talklist); + domenu(TMENU, I18N[1502], 'U', talklist); return 0; } int User() { - domenu(UMENU, SHM->i18nstr[cuser.language][1503], 'A', userlist); + domenu(UMENU, I18N[1503], 'A', userlist); return 0; } int Xyz() { - domenu(XMENU, SHM->i18nstr[cuser.language][1504], 'M', xyzlist); + domenu(XMENU, I18N[1504], 'M', xyzlist); return 0; } int Play_Play() { - domenu(PMENU, SHM->i18nstr[cuser.language][1505], 'A', playlist); + domenu(PMENU, I18N[1505], 'A', playlist); return 0; } int Name_Menu() { - domenu(NMENU, SHM->i18nstr[cuser.language][1506], 'O', namelist); + domenu(NMENU, I18N[1506], 'O', namelist); return 0; } diff --git a/mbbsd/more.c b/mbbsd/more.c index 55df9f12..cba16af7 100644 --- a/mbbsd/more.c +++ b/mbbsd/more.c @@ -114,7 +114,7 @@ more_readln(int fd, unsigned char *buf) int more(char *fpath, int promptend) { - char *head[4] = {SHM->i18nstr[cuser.language][1528], SHM->i18nstr[cuser.language][1529], SHM->i18nstr[cuser.language][1530], SHM->i18nstr[cuser.language][1531]}; + char *head[4] = {I18N[1528], I18N[1529], I18N[1530], I18N[1531]}; char *ptr, *word = NULL, buf[ANSILINELEN + 1]; struct stat st; @@ -207,7 +207,7 @@ more(char *fpath, int promptend) /* ※處理引用者 & 引言 */ if ((buf[1] == ' ') && (buf[0] == ':' || buf[0] == '>')) word = "\033[36m"; - else if (!strncmp(buf, SHM->i18nstr[cuser.language][1532], 2) || !strncmp(buf, "==>", 3)) + else if (!strncmp(buf, I18N[1532], 2) || !strncmp(buf, "==>", 3)) word = "\033[32m"; if (word) @@ -298,13 +298,13 @@ more(char *fpath, int promptend) } else color = 2; - prints(SHM->i18nstr[cuser.language][1533], + prints(I18N[1533], printcolor[(int)color], pageno, (int)((viewed * 100) / fsize), "\033[31;47m", - SHM->i18nstr[cuser.language][1534], - SHM->i18nstr[cuser.language][1535]); + I18N[1534], + I18N[1535]); while (line == b_lines || (line > 0 && viewed == fsize)) { @@ -328,11 +328,11 @@ more(char *fpath, int promptend) char ans[4] = "n"; *search_str = search_char0; - getdata_buf(b_lines - 1, 0, SHM->i18nstr[cuser.language][1536], search_str, + getdata_buf(b_lines - 1, 0, I18N[1536], search_str, 40, DOECHO); if (*search_str) { searching = 1; - if (getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1537], + if (getdata(b_lines - 1, 0, I18N[1537], ans, sizeof(ans), LCECHO) && *ans == 'y') fptr = strstr; else @@ -460,7 +460,7 @@ more(char *fpath, int promptend) break; case Ctrl('T'): - getdata(b_lines - 2, 0, SHM->i18nstr[cuser.language][1538], + getdata(b_lines - 2, 0, I18N[1538], buf, 4, LCECHO); if (buf[0] == 'y') { setuserfile(buf, ask_tmpbuf(b_lines - 1)); diff --git a/mbbsd/name.c b/mbbsd/name.c index 30ae4473..d8f804fa 100644 --- a/mbbsd/name.c +++ b/mbbsd/name.c @@ -294,7 +294,7 @@ namecomplete(char *prompt, char *data) len = MaxLen(morelist, p_lines); move(2, 0); clrtobot(); - printdash(SHM->i18nstr[cuser.language][1539]); + printdash(I18N[1539]); while (len + col < 80) { int i; @@ -418,7 +418,7 @@ usercomplete(char *prompt, char *data) len = UserMaxLen((arrptr) cwlist, cwnum, morenum, p_lines); move(2, 0); clrtobot(); - printdash(SHM->i18nstr[cuser.language][1540]); + printdash(I18N[1540]); while (len + col < 79) { int i; @@ -591,7 +591,7 @@ generalnamecomplete(char *prompt, char *data, int len, size_t nmemb, clearbot = YEA; move(2, 0); clrtobot(); - printdash(SHM->i18nstr[cuser.language][1541]); + printdash(I18N[1541]); col = 0; while (len + col < 79) { diff --git a/mbbsd/othello.c b/mbbsd/othello.c index 9e922b7e..80f63787 100644 --- a/mbbsd/othello.c +++ b/mbbsd/othello.c @@ -10,9 +10,9 @@ #define STARTX 3 #define STARTY 20 #define NONE_CHESS " " -#define WHITE_CHESS SHM->i18nstr[cuser.language][1542] -#define BLACK_CHESS SHM->i18nstr[cuser.language][1543] -#define HINT_CHESS SHM->i18nstr[cuser.language][1544] +#define WHITE_CHESS I18N[1542] +#define BLACK_CHESS I18N[1543] +#define HINT_CHESS I18N[1544] #define NONE 0 #define HINT 1 #define BLACK 2 @@ -79,43 +79,43 @@ printboard() int i; move(STARTX, STARTY); - prints(SHM->i18nstr[cuser.language][1545]); + prints(I18N[1545]); for (i = 0; i < 7; i++) { move(STARTX + 1 + i * 2, STARTY); - prints(SHM->i18nstr[cuser.language][1546]); + prints(I18N[1546]); move(STARTX + 2 + i * 2, STARTY); - prints(SHM->i18nstr[cuser.language][1547]); + prints(I18N[1547]); } move(STARTX + 1 + i * 2, STARTY); - prints(SHM->i18nstr[cuser.language][1548]); + prints(I18N[1548]); move(STARTX + 2 + i * 2, STARTY); - prints(SHM->i18nstr[cuser.language][1549]); + prints(I18N[1549]); print_chess(4, 4, WHITE); print_chess(5, 5, WHITE); print_chess(4, 5, BLACK); print_chess(5, 4, BLACK); move(3, 56); - prints(SHM->i18nstr[cuser.language][1550], cuser.userid); + prints(I18N[1550], cuser.userid); move(3, 72); prints(": 02"); move(4, 56); - prints(SHM->i18nstr[cuser.language][1551]); + prints(I18N[1551]); move(6, 56); - prints(SHM->i18nstr[cuser.language][1552]); + prints(I18N[1552]); move(7, 56); - prints(SHM->i18nstr[cuser.language][1553]); + prints(I18N[1553]); move(8, 56); - prints(SHM->i18nstr[cuser.language][1554]); + prints(I18N[1554]); move(9, 56); - prints(SHM->i18nstr[cuser.language][1555]); + prints(I18N[1555]); move(10, 56); - prints(SHM->i18nstr[cuser.language][1556]); + prints(I18N[1556]); move(11, 56); - prints(SHM->i18nstr[cuser.language][1557]); + prints(I18N[1557]); move(12, 56); - prints(SHM->i18nstr[cuser.language][1558]); + prints(I18N[1558]); move(13, 56); - prints(SHM->i18nstr[cuser.language][1559]); + prints(I18N[1559]); } static int @@ -219,7 +219,7 @@ static void end_of_game(int quit) { FILE *fp, *fp1; - char *opponent[] = {"", "CD-65", "", SHM->i18nstr[cuser.language][1560], SHM->i18nstr[cuser.language][1561], "", SHM->i18nstr[cuser.language][1562], SHM->i18nstr[cuser.language][1563]}; + char *opponent[] = {"", "CD-65", "", I18N[1560], I18N[1561], "", I18N[1562], I18N[1563]}; move(STARTX - 1, 30); prints(" "); @@ -239,36 +239,36 @@ end_of_game(int quit) fclose(fp); return; } - fprintf(fp, SHM->i18nstr[cuser.language][1564], opponent[think], cuser.userid); + fprintf(fp, I18N[1564], opponent[think], cuser.userid); if (fp) fclose(fp); return; } if (number[0] > number[1]) { - prints(SHM->i18nstr[cuser.language][1565], number[0] - number[1]); + prints(I18N[1565], number[0] - number[1]); if (think == 6 && number[0] - number[1] >= 50) demoney(200); if (think == 7 && number[0] - number[1] >= 40) demoney(200); if (fp) - fprintf(fp, SHM->i18nstr[cuser.language][1566], + fprintf(fp, I18N[1566], opponent[think], cuser.userid, number[0], number[1], number[0] - number[1]); } else if (number[1] > number[0]) { - prints(SHM->i18nstr[cuser.language][1567], number[1] - number[0]); + prints(I18N[1567], number[1] - number[0]); if (fp) { - fprintf(fp, SHM->i18nstr[cuser.language][1568], opponent[think]); + fprintf(fp, I18N[1568], opponent[think]); if (number[1] - number[0] > 20) - fprintf(fp, SHM->i18nstr[cuser.language][1569], number[1], + fprintf(fp, I18N[1569], number[1], number[0], cuser.userid, number[1] - number[0]); else - fprintf(fp, SHM->i18nstr[cuser.language][1570], number[1], + fprintf(fp, I18N[1570], number[1], number[0], cuser.userid, number[1] - number[0]); } } else { - prints(SHM->i18nstr[cuser.language][1571]); + prints(I18N[1571]); if (fp) - fprintf(fp, SHM->i18nstr[cuser.language][1572], + fprintf(fp, I18N[1572], opponent[think], cuser.userid, number[1], number[0]); } if (fp) @@ -347,7 +347,7 @@ player(char color) pass++; if (pass == 1) { move(23, 34); - prints(SHM->i18nstr[cuser.language][1573]); + prints(I18N[1573]); igetch(); move(28, 23); prints(" "); @@ -365,9 +365,9 @@ init() int i, j, i1, j1; CHESS_TYPE[0] = " "; - CHESS_TYPE[1] = SHM->i18nstr[cuser.language][1544]; - CHESS_TYPE[2] = SHM->i18nstr[cuser.language][1543]; - CHESS_TYPE[3] = SHM->i18nstr[cuser.language][1542]; + CHESS_TYPE[1] = I18N[1544]; + CHESS_TYPE[2] = I18N[1543]; + CHESS_TYPE[3] = I18N[1542]; nowx = 4; nowy = 4; @@ -403,7 +403,7 @@ report() move(3, 72); prints(": %02d", number[0]); move(4, 60); - prints(SHM->i18nstr[cuser.language][1574], number[1]); + prints(I18N[1574], number[1]); } static int @@ -482,7 +482,7 @@ Computer(int thinkstep, int table) nowy = maxj; } else { move(23, 30); - prints(SHM->i18nstr[cuser.language][1575]); + prints(I18N[1575]); pass++; if (pass == 2) { move(23, 24); @@ -503,13 +503,13 @@ choose() char thinkstep[2]; move(2, 0); - prints(SHM->i18nstr[cuser.language][1576]); + prints(I18N[1576]); move(5, 0); prints("(1) CD-65\n"); /* 想 1 步 */ - prints(SHM->i18nstr[cuser.language][1577]); /* 想 3 步 */ - prints(SHM->i18nstr[cuser.language][1578]); /* 想 4 步 */ + prints(I18N[1577]); /* 想 3 步 */ + prints(I18N[1578]); /* 想 4 步 */ do { - getdata(4, 0, SHM->i18nstr[cuser.language][1579], + getdata(4, 0, I18N[1579], thinkstep, sizeof(thinkstep), LCECHO); } while (thinkstep[0] < '1' || thinkstep[0] > '3'); clear(); @@ -536,12 +536,12 @@ othello_main() clear(); init(); think = choose(); - showtitle(SHM->i18nstr[cuser.language][1580], BBSName); + showtitle(I18N[1580], BBSName); printboard(); which_table = rand() % NR_TABLE; while (true) { move(STARTX - 1, 30); - prints(SHM->i18nstr[cuser.language][1581]); + prints(I18N[1581]); if (!player(BLACK)) break; report(); @@ -551,7 +551,7 @@ othello_main() break; } move(STARTX - 1, 30); - prints(SHM->i18nstr[cuser.language][1582]); + prints(I18N[1582]); refresh(); if (!Computer(think, which_table)) break; diff --git a/mbbsd/record.c b/mbbsd/record.c index c8393f6f..383569c0 100644 --- a/mbbsd/record.c +++ b/mbbsd/record.c @@ -379,7 +379,7 @@ safe_article_delete(int ent, fileheader_t *fhdr, char *direct) { fileheader_t newfhdr; memcpy(&newfhdr, fhdr, sizeof(fileheader_t)); - sprintf(newfhdr.title, "(本文已被刪除)"); + sprintf(newfhdr.title, I18N[1854]); strcpy(newfhdr.filename, ".deleted"); strcpy(newfhdr.owner, "-"); substitute_record(direct, &newfhdr, sizeof(newfhdr), ent); @@ -408,7 +408,7 @@ safe_article_delete_range(char *direct, int from, int to) strlcpy(ptr, newfhdr.filename, sizeof(newfhdr.filename)); unlink(fn); - sprintf(newfhdr.title, "(本文已被刪除)"); + sprintf(newfhdr.title, I18N[1855]); strcpy(newfhdr.filename, ".deleted"); strcpy(newfhdr.owner, "-"); // because off_t is unsigned, we could NOT seek backward. diff --git a/mbbsd/register.c b/mbbsd/register.c index 1f967652..8a3c62cb 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -159,7 +159,7 @@ getnewuserid() close(fd); log_usies("CLEAN", "dated users"); - fprintf(stdout, SHM->i18nstr[cuser.language][1856]); + fprintf(stdout, I18N[1856]); if ((fd = open(fn_passwd, O_RDWR | O_CREAT, 0600)) == -1) return -1; @@ -175,7 +175,7 @@ getnewuserid() i = searchnewuser(1); if ((i <= 0) || (i > MAX_USERS)) { passwd_unlock(); - vmsg(SHM->i18nstr[cuser.language][1857]); + vmsg(I18N[1857]); safe_sleep(2); exit(1); } @@ -197,15 +197,15 @@ new_register() #ifdef HAVE_USERAGREEMENT more(HAVE_USERAGREEMENT, YEA); while( 1 ){ - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1858], + getdata(b_lines - 1, 0, I18N[1858], passbuf, 4, LCECHO); if( passbuf[0] == 'y' ) break; if( passbuf[0] == 'n' ){ - vmsg(SHM->i18nstr[cuser.language][1859]); + vmsg(I18N[1859]); exit(1); } - vmsg(SHM->i18nstr[cuser.language][1860]); + vmsg(I18N[1860]); } #endif memset(&newuser, 0, sizeof(newuser)); @@ -213,20 +213,20 @@ new_register() try = 0; while (1) { if (++try >= 6) { - vmsg(SHM->i18nstr[cuser.language][1861]); + vmsg(I18N[1861]); exit(1); } getdata(17, 0, msg_uid, newuser.userid, sizeof(newuser.userid), DOECHO); if (bad_user_id(newuser.userid)) - outs(SHM->i18nstr[cuser.language][1862]); + outs(I18N[1862]); else if ((id = getuser(newuser.userid)) && (id = check_and_expire_account(id, &xuser)) >= 0) { if (id == 999999) - outs(SHM->i18nstr[cuser.language][1863]); + outs(I18N[1863]); else { - prints(SHM->i18nstr[cuser.language][1864], id / (60 * 24)); + prints(I18N[1864], id / (60 * 24)); } } else break; @@ -235,19 +235,19 @@ new_register() try = 0; while (1) { if (++try >= 6) { - vmsg(SHM->i18nstr[cuser.language][1865]); + vmsg(I18N[1865]); exit(1); } - if ((getdata(19, 0, SHM->i18nstr[cuser.language][1866], passbuf, + if ((getdata(19, 0, I18N[1866], passbuf, sizeof(passbuf), NOECHO) < 3) || !strcmp(passbuf, newuser.userid)) { - outs(SHM->i18nstr[cuser.language][1867]); + outs(I18N[1867]); continue; } strncpy(newuser.passwd, passbuf, PASSLEN); - getdata(20, 0, SHM->i18nstr[cuser.language][1868], passbuf, sizeof(passbuf), NOECHO); + getdata(20, 0, I18N[1868], passbuf, sizeof(passbuf), NOECHO); if (strncmp(passbuf, newuser.passwd, PASSLEN)) { - outs(SHM->i18nstr[cuser.language][1869]); + outs(I18N[1869]); continue; } passbuf[8] = '\0'; @@ -262,18 +262,18 @@ new_register() newuser.pager = 1; allocid = getnewuserid(); if (allocid > MAX_USERS || allocid <= 0) { - fprintf(stderr, SHM->i18nstr[cuser.language][1870]); + fprintf(stderr, I18N[1870]); exit(1); } if (passwd_update(allocid, &newuser) == -1) { - fprintf(stderr, SHM->i18nstr[cuser.language][1871]); + fprintf(stderr, I18N[1871]); exit(1); } setuserid(allocid, newuser.userid); if( (uid = initcuser(newuser.userid)) ) setumoney(uid, 0); else{ - fprintf(stderr, SHM->i18nstr[cuser.language][1872]); + fprintf(stderr, I18N[1872]); exit(1); } } @@ -294,10 +294,10 @@ check_register() if (currutmp->mailalert) m_read(); - stand_title(SHM->i18nstr[cuser.language][1873]); + stand_title(I18N[1873]); while (strlen(cuser.username) < 2) - getdata(2, 0, SHM->i18nstr[cuser.language][1874], cuser.username, + getdata(2, 0, I18N[1874], cuser.username, sizeof(cuser.username), DOECHO); for (ptr = cuser.username; *ptr; ptr++) { @@ -305,11 +305,11 @@ check_register() *ptr = ' '; } while (strlen(cuser.realname) < 4) - getdata(4, 0, SHM->i18nstr[cuser.language][1875], cuser.realname, + getdata(4, 0, I18N[1875], cuser.realname, sizeof(cuser.realname), DOECHO); while (strlen(cuser.address) < 8) - getdata(6, 0, SHM->i18nstr[cuser.language][1876], cuser.address, + getdata(6, 0, I18N[1876], cuser.address, sizeof(cuser.address), DOECHO); @@ -329,7 +329,7 @@ check_register() /* 回覆過身份認證信函,或曾經 E-mail post 過 */ clear(); move(9, 3); - prints(SHM->i18nstr[cuser.language][1877]); + prints(I18N[1877]); u_register(); #ifdef NEWUSER_LIMIT diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 17e58333..98b8fa8b 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -331,19 +331,19 @@ gettime(int line, time_t dt, char*head) move(line, 0); prints("%s",head); i=strlen(head); do { - getdata_buf(line, i, SHM->i18nstr[cuser.language][1878], yn, 5, LCECHO); + getdata_buf(line, i, I18N[1878], yn, 5, LCECHO); } while ((endtime.tm_year = atoi(yn) - 1900) < 0 || endtime.tm_year > 200); snprintf(yn, sizeof(yn), "%d", ptime->tm_mon + 1); do { - getdata_buf(line, i+15, SHM->i18nstr[cuser.language][1879], yn, 3, LCECHO); + getdata_buf(line, i+15, I18N[1879], yn, 3, LCECHO); } while ((endtime.tm_mon = atoi(yn) - 1) < 0 || endtime.tm_mon > 11); snprintf(yn, sizeof(yn), "%d", ptime->tm_mday); do { - getdata_buf(line, i+24, SHM->i18nstr[cuser.language][1880], yn, 3, LCECHO); + getdata_buf(line, i+24, I18N[1880], yn, 3, LCECHO); } while ((endtime.tm_mday = atoi(yn)) < 1 || endtime.tm_mday > 31); snprintf(yn, sizeof(yn), "%d", ptime->tm_hour); do { - getdata_buf(line, i+33, SHM->i18nstr[cuser.language][1881], yn, 3, LCECHO); + getdata_buf(line, i+33, I18N[1881], yn, 3, LCECHO); } while ((endtime.tm_hour = atoi(yn)) < 0 || endtime.tm_hour > 23); return mktime(&endtime); } @@ -388,7 +388,7 @@ capture_screen() FILE *fp; int i; - getdata(b_lines - 2, 0, SHM->i18nstr[cuser.language][1882], + getdata(b_lines - 2, 0, I18N[1882], fname, 4, LCECHO); if (fname[0] != 'y') return; @@ -412,7 +412,7 @@ vmsg_lines(const int lines, const char msg[]) if (msg) outs((char *)msg); else - outs(SHM->i18nstr[cuser.language][1883]); + outs(I18N[1883]); do { if( (ch = igetch()) == Ctrl('T') ) capture_screen(); @@ -479,7 +479,7 @@ search_num(int ch, int max) int x, y; char genbuf[10]; - outmsg(SHM->i18nstr[cuser.language][1886]); + outmsg(I18N[1886]); outc(ch); genbuf[0] = ch; getyx(&y, &x); @@ -528,7 +528,7 @@ void stand_title(char *title) { clear(); - prints(SHM->i18nstr[cuser.language][1887], title); + prints(I18N[1887], title); } void @@ -622,11 +622,11 @@ show_help(int *index) clear(); while (*index > 0 && *index < MAX_STRING) { - str = SHM->i18nstr[cuser.language][*index]; + str = I18N[*index]; if (*str == '\0') - prints(SHM->i18nstr[cuser.language][1888], str + 1); + prints(I18N[1888], str + 1); else if (*str == '\01') - prints(SHM->i18nstr[cuser.language][1889], str + 1); + prints(I18N[1889], str + 1); else prints(" %s\n", str); index++; diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index dfc3065f..f6b30551 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -17,8 +17,8 @@ post_msg(char *bname, char *title, char *msg, char *author) if (!fp) return -1; - fprintf(fp, SHM->i18nstr[cuser.language][2551], author, bname, title); - fprintf(fp, SHM->i18nstr[cuser.language][2552], ctime(&now)); + fprintf(fp, I18N[2551], author, bname, title); + fprintf(fp, I18N[2552], ctime(&now)); /* 文章的內容 */ fprintf(fp, "%s", msg); @@ -67,13 +67,13 @@ post_change_perm(int oldperm, int newperm, char *sysopid, char *userid) if (!(fp = fopen(genbuf, "w"))) return; - fprintf(fp, SHM->i18nstr[cuser.language][2553], ctime(&now)); + fprintf(fp, I18N[2553], ctime(&now)); for (i = 5; i < NUMPERMS; i++) { if (((oldperm >> i) & 1) != ((newperm >> i) & 1)) { - fprintf(fp, SHM->i18nstr[cuser.language][2554], + fprintf(fp, I18N[2554], sysopid, - (((oldperm >> i) & 1) ? SHM->i18nstr[cuser.language][2555] : SHM->i18nstr[cuser.language][2556]), - userid, SHM->i18nstr[cuser.language][str_permid[i]]); + (((oldperm >> i) & 1) ? I18N[2555] : I18N[2556]), + userid, I18N[str_permid[i]]); flag++; } } @@ -81,16 +81,16 @@ post_change_perm(int oldperm, int newperm, char *sysopid, char *userid) if (flag) { clrtobot(); clear(); - while (!getdata_str(5, 0, SHM->i18nstr[cuser.language][2557], - reason, sizeof(reason), DOECHO, SHM->i18nstr[cuser.language][2558])); - fprintf(fp, SHM->i18nstr[cuser.language][2559], + while (!getdata_str(5, 0, I18N[2557], + reason, sizeof(reason), DOECHO, I18N[2558])); + fprintf(fp, I18N[2559], cuser.userid, reason); fclose(fp); snprintf(fhdr.title, sizeof(fhdr.title), - SHM->i18nstr[cuser.language][2560], + I18N[2560], cuser.userid, userid); - strlcpy(fhdr.owner, SHM->i18nstr[cuser.language][2561], sizeof(fhdr.owner)); + strlcpy(fhdr.owner, I18N[2561], sizeof(fhdr.owner)); append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr)); } else fclose(fp); @@ -124,12 +124,12 @@ post_violatelaw(char *crime, char *police, char *reason, char *result) stampfile(genbuf, &fhdr); if (!(fp = fopen(genbuf, "w"))) return; - fprintf(fp, SHM->i18nstr[cuser.language][2562], + fprintf(fp, I18N[2562], crime, ctime(&now), police, crime, reason, result); fclose(fp); snprintf(fhdr.title, sizeof(fhdr.title), - SHM->i18nstr[cuser.language][2563], crime); - strlcpy(fhdr.owner, SHM->i18nstr[cuser.language][2564], sizeof(fhdr.owner)); + I18N[2563], crime); + strlcpy(fhdr.owner, I18N[2564], sizeof(fhdr.owner)); append_record("boards/V/ViolateLaw/.DIR", &fhdr, sizeof(fhdr)); @@ -139,11 +139,11 @@ void post_newboard(char *bgroup, char *bname, char *bms) { char genbuf[256], title[128]; - snprintf(title, sizeof(title), SHM->i18nstr[cuser.language][2565], bname); + snprintf(title, sizeof(title), I18N[2565], bname); snprintf(genbuf, sizeof(genbuf), - SHM->i18nstr[cuser.language][2566], + I18N[2566], cuser.userid, bname, bgroup, bms); - post_msg("Record", title, genbuf, SHM->i18nstr[cuser.language][2567]); + post_msg("Record", title, genbuf, I18N[2567]); } void @@ -158,15 +158,15 @@ give_money_post(char *userid, int money) stampfile(genbuf, &fhdr); if (!(fp = fopen(genbuf, "w"))) return; - fprintf(fp, SHM->i18nstr[cuser.language][2568], cuser.userid, ctime(&now)); + fprintf(fp, I18N[2568], cuser.userid, ctime(&now)); clrtobot(); clear(); - fprintf(fp, SHM->i18nstr[cuser.language][2569], + fprintf(fp, I18N[2569], cuser.userid, userid, money); fclose(fp); - snprintf(fhdr.title, sizeof(fhdr.title), SHM->i18nstr[cuser.language][2570], + snprintf(fhdr.title, sizeof(fhdr.title), I18N[2570], cuser.userid); - strlcpy(fhdr.owner, SHM->i18nstr[cuser.language][2571], sizeof(fhdr.owner)); + strlcpy(fhdr.owner, I18N[2571], sizeof(fhdr.owner)); append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr)); } diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 973835b4..30ac4246 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -3,10 +3,10 @@ #define QCAST int (*)(const void *, const void *) -//#define sig_des [(a)] (SHM->i18nstr[cuser.language][1896 + (a)]) -#define sig_des(a) (SHM->i18nstr[cuser.language][1896 + (a)]) +//#define sig_des [(a)] (I18N[1896 + (a)]) +#define sig_des(a) (I18N[1896 + (a)]) /*static char *sig_des[] = { - SHM->i18nstr[cuser.language][1896], SHM->i18nstr[cuser.language][1897], "", SHM->i18nstr[cuser.language][1898], SHM->i18nstr[cuser.language][1899], SHM->i18nstr[cuser.language][1900] + I18N[1896], I18N[1897], "", I18N[1898], I18N[1899], I18N[1900] };*/ #define MAX_SHOW_MODE 4 @@ -77,7 +77,7 @@ char * modestring(userinfo_t * uentp, int simple) { static char modestr[40]; - char *notonline = SHM->i18nstr[cuser.language][1901]; + char *notonline = I18N[1901]; register int mode = uentp->mode; register char *word; int fri_stat; @@ -85,9 +85,9 @@ modestring(userinfo_t * uentp, int simple) /* for debugging */ if (mode >= MAX_MODES) { syslog(LOG_WARNING, "what!? mode = %d", mode); - word = SHM->i18nstr[cuser.language][ModeTypeTable[mode % MAX_MODES]]; + word = I18N[ModeTypeTable[mode % MAX_MODES]]; } else - word = SHM->i18nstr[cuser.language][ModeTypeTable[mode]]; + word = I18N[ModeTypeTable[mode]]; fri_stat = friend_stat(currutmp, uentp); if (!(HAS_PERM(PERM_SYSOP) || HAS_PERM(PERM_SEECLOAK)) && ((uentp->invisible || (fri_stat & HRM)) && @@ -95,18 +95,18 @@ modestring(userinfo_t * uentp, int simple) return notonline; else if (mode == EDITING) { snprintf(modestr, sizeof(modestr), "E:%s", - SHM->i18nstr[cuser.language][ModeTypeTable[uentp->destuid < EDITING ? uentp->destuid : + I18N[ModeTypeTable[uentp->destuid < EDITING ? uentp->destuid : EDITING]]); word = modestr; } else if (!mode && *uentp->chatid == 1) { if (!simple) snprintf(modestr, sizeof(modestr), - SHM->i18nstr[cuser.language][1902], getuserid(uentp->destuid)); + I18N[1902], getuserid(uentp->destuid)); else - snprintf(modestr, sizeof(modestr), SHM->i18nstr[cuser.language][1903]); + snprintf(modestr, sizeof(modestr), I18N[1903]); } else if (!mode && *uentp->chatid == 3) - snprintf(modestr, sizeof(modestr), SHM->i18nstr[cuser.language][1904]); + snprintf(modestr, sizeof(modestr), I18N[1904]); else if ( #ifdef NOKILLWATERBALL uentp->msgcount > 0 @@ -116,15 +116,15 @@ modestring(userinfo_t * uentp, int simple) ) if (uentp->msgcount < 10) { char *cnum[10] = - {"", SHM->i18nstr[cuser.language][1905], SHM->i18nstr[cuser.language][1906], SHM->i18nstr[cuser.language][1907], SHM->i18nstr[cuser.language][1908], SHM->i18nstr[cuser.language][1909], SHM->i18nstr[cuser.language][1910], SHM->i18nstr[cuser.language][1911], - SHM->i18nstr[cuser.language][1912], SHM->i18nstr[cuser.language][1913]}; + {"", I18N[1905], I18N[1906], I18N[1907], I18N[1908], I18N[1909], I18N[1910], I18N[1911], + I18N[1912], I18N[1913]}; snprintf(modestr, sizeof(modestr), - SHM->i18nstr[cuser.language][1914], cnum[(int)(uentp->msgcount)]); + I18N[1914], cnum[(int)(uentp->msgcount)]); } else - snprintf(modestr, sizeof(modestr), SHM->i18nstr[cuser.language][1915]); + snprintf(modestr, sizeof(modestr), I18N[1915]); else if (!mode) return (uentp->destuid == 6) ? uentp->chatid : - SHM->i18nstr[cuser.language][1890 + ((0 <= uentp->destuid && uentp->destuid < 6) ? + I18N[1890 + ((0 <= uentp->destuid && uentp->destuid < 6) ? uentp->destuid : 0)]; else if (simple) return word; @@ -132,24 +132,24 @@ modestring(userinfo_t * uentp, int simple) snprintf(modestr, sizeof(modestr), "%s (%s)", word, uentp->chatid); else if (mode == TALK) { if (!isvisible_uid(uentp->destuid)) /* Leeym 對方(紫色)隱形 */ - snprintf(modestr, sizeof(modestr), "%s", SHM->i18nstr[cuser.language][1916]); + snprintf(modestr, sizeof(modestr), "%s", I18N[1916]); /* Leeym * 大家自己發揮吧! */ else snprintf(modestr, sizeof(modestr), "%s %s", word, getuserid(uentp->destuid)); } else if (mode == M_FIVE) { if (!isvisible_uid(uentp->destuid)) - snprintf(modestr, sizeof(modestr), "%s", SHM->i18nstr[cuser.language][1917]); + snprintf(modestr, sizeof(modestr), "%s", I18N[1917]); else snprintf(modestr, sizeof(modestr), "%s %s", word, getuserid(uentp->destuid)); } else if (mode == CHESSWATCHING) { - snprintf(modestr, sizeof(modestr), SHM->i18nstr[cuser.language][1918]); + snprintf(modestr, sizeof(modestr), I18N[1918]); } else if (mode == CHC) { if (isvisible_uid(uentp->destuid)) - snprintf(modestr, sizeof(modestr), "%s", SHM->i18nstr[cuser.language][1919]); + snprintf(modestr, sizeof(modestr), "%s", I18N[1919]); else snprintf(modestr, sizeof(modestr), - SHM->i18nstr[cuser.language][1920], getuserid(uentp->destuid)); + I18N[1920], getuserid(uentp->destuid)); } else if (mode != PAGE && mode != TQUERY) return word; else @@ -322,7 +322,7 @@ my_kick(userinfo_t * uentp) log_usies("KICK ", genbuf); if ((uentp->pid <= 0 || kill(uentp->pid, SIGHUP) == -1) && (errno == ESRCH)) purge_utmp(uentp); - outs(SHM->i18nstr[cuser.language][1921]); + outs(I18N[1921]); } else outs(msg_cancel); pressanykey(); @@ -336,12 +336,12 @@ chicken_query(char *userid) time_diff(&(xuser.mychicken)); if (!isdeadth(&(xuser.mychicken))) { show_chicken_data(&(xuser.mychicken), NULL); - prints(SHM->i18nstr[cuser.language][1922], userid); + prints(I18N[1922], userid); } } else { move(1, 0); clrtobot(); - prints(SHM->i18nstr[cuser.language][1923], userid); + prints(I18N[1923], userid); } pressanykey(); } @@ -355,8 +355,8 @@ my_query(char *uident) unsigned long int j; userinfo_t *uentp; const char *money[10] = - {SHM->i18nstr[cuser.language][1924], SHM->i18nstr[cuser.language][1925], SHM->i18nstr[cuser.language][1926], SHM->i18nstr[cuser.language][1927], SHM->i18nstr[cuser.language][1928], - SHM->i18nstr[cuser.language][1929], SHM->i18nstr[cuser.language][1930], SHM->i18nstr[cuser.language][1931], SHM->i18nstr[cuser.language][1932], SHM->i18nstr[cuser.language][1933]}; + {I18N[1924], I18N[1925], I18N[1926], I18N[1927], I18N[1928], + I18N[1929], I18N[1930], I18N[1931], I18N[1932], I18N[1933]}; const char *sex[8] = {MSG_BIG_BOY, MSG_BIG_GIRL, MSG_LITTLE_BOY, MSG_LITTLE_GIRL, @@ -376,7 +376,7 @@ my_query(char *uident) j = muser.money; for (i = 0; i < 10 && j > 10; i++) j /= 10; - prints(SHM->i18nstr[cuser.language][1934], + prints(I18N[1934], muser.userid, muser.username, 26 - strlen(muser.userid) - strlen(muser.username), "", @@ -385,33 +385,33 @@ my_query(char *uident) prints(" ($%d)", muser.money); prints("\n"); - prints(SHM->i18nstr[cuser.language][1935], muser.numlogins); + prints(I18N[1935], muser.numlogins); move(2, 40); #ifdef ASSESS - prints(SHM->i18nstr[cuser.language][1936], muser.numposts, muser.goodpost, muser.badpost); + prints(I18N[1936], muser.numposts, muser.goodpost, muser.badpost); #else - prints(SHM->i18nstr[cuser.language][1937], muser.numposts); + prints(I18N[1937], muser.numposts); #endif - prints(SHM->i18nstr[cuser.language][1938], + prints(I18N[1938], (uentp && isvisible_stat(currutmp, uentp, fri_stat)) ? - modestring(uentp, 0) : SHM->i18nstr[cuser.language][1939]); + modestring(uentp, 0) : I18N[1939]); outs(((uentp && uentp->mailalert) || load_mailalert(muser.userid)) - ? SHM->i18nstr[cuser.language][1940] : - SHM->i18nstr[cuser.language][1941]); - prints(SHM->i18nstr[cuser.language][1942], + ? I18N[1940] : + I18N[1941]); + prints(I18N[1942], Cdate(&muser.lastlogin), - (muser.lasthost[0] ? muser.lasthost : SHM->i18nstr[cuser.language][1943])); - prints(SHM->i18nstr[cuser.language][1944], + (muser.lasthost[0] ? muser.lasthost : I18N[1943])); + prints(I18N[1944], muser.five_win, muser.five_lose, muser.five_tie, muser.chc_win, muser.chc_lose, muser.chc_tie); #ifdef ASSESS - prints(SHM->i18nstr[cuser.language][1945], muser.goodsale, muser.badsale); + prints(I18N[1945], muser.goodsale, muser.badsale); move(6, 40); #endif if ((uentp && ((fri_stat & HFM) || strcmp(muser.userid,cuser.userid) == 0) && !uentp->invisible)) - prints(SHM->i18nstr[cuser.language][1946], sex[muser.sex % 8]); + prints(I18N[1946], sex[muser.sex % 8]); showplans(uident); pressanykey(); @@ -439,11 +439,11 @@ water_scr(water_t * tw, int which, char type) prints(" "); move(16 + i, 4); if (tw->msg[(tw->top - i + 4) % 5].last_call_in[0] != 0) - prints(SHM->i18nstr[cuser.language][1947], + prints(I18N[1947], colors[i], tw->msg[(tw->top - i + 4) % 5].last_call_in); else - prints(SHM->i18nstr[cuser.language][1948]); + prints(I18N[1948]); } move(21, 4); @@ -455,14 +455,14 @@ water_scr(water_t * tw, int which, char type) move(0, 0); prints(" "); move(0, 0); - prints(SHM->i18nstr[cuser.language][1949], tw->userid); + prints(I18N[1949], tw->userid); clrtoeol(); move(0, strlen(tw->userid) + 6); } else { move(8 + which, 28); prints("123456789012345678901234567890"); move(8 + which, 28); - prints(SHM->i18nstr[cuser.language][1950], + prints(I18N[1950], tw->uin ? ' ' : 'x', tw->userid); } @@ -488,7 +488,7 @@ my_write2(void) //init screen move(7, 28); - prints(SHM->i18nstr[cuser.language][1951]); + prints(I18N[1951]); for (i = 0; i < 5; ++i) if (swater[i] == NULL || swater[i]->pid == 0) break; @@ -500,9 +500,9 @@ my_write2(void) water_scr(swater[i], i, 0); } move(15, 4); - prints(SHM->i18nstr[cuser.language][1952]); + prints(I18N[1952]); move(22, 4); - prints(SHM->i18nstr[cuser.language][1953]); + prints(I18N[1953]); water_scr(swater[0], 0, 1); refresh(); @@ -547,7 +547,7 @@ my_write2(void) move(0, 0); prints("\033[m"); clrtoeol(); - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][1954], tw->userid); + snprintf(genbuf, sizeof(genbuf), I18N[1954], tw->userid); if (!oldgetdata(0, 0, genbuf, msg, 80 - strlen(tw->userid) - 6, DOECHO)) break; @@ -588,7 +588,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) strlcpy(destid, id, sizeof(destid)); if (!uin && !(flag == 0 && water_which->count > 0)) { - vmsg(SHM->i18nstr[cuser.language][1955]); + vmsg(I18N[1955]); watermode = -1; return 0; } @@ -602,7 +602,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) /* 一般水球 */ watermode = 0; if (!(len = getdata(0, 0, prompt, msg, 56, DOECHO))) { - outmsg(SHM->i18nstr[cuser.language][1956]); + outmsg(I18N[1956]); clrtoeol(); refresh(); currutmp->chatid[0] = c0; @@ -626,7 +626,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) strip_ansi(msg, msg, STRIP_ALL); if (uin && *uin->userid && (flag == 0 || flag == 4)) { - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][1957], uin->userid, msg); + snprintf(buf, sizeof(buf), I18N[1957], uin->userid, msg); getdata(0, 0, buf, genbuf, 3, LCECHO); if (genbuf[0] == 'n') { currutmp->chatid[0] = c0; @@ -638,7 +638,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) } watermode = -1; if (!uin || !*uin->userid || strcasecmp(destid, uin->userid)) { - vmsg(SHM->i18nstr[cuser.language][1959]); + vmsg(I18N[1959]); currutmp->chatid[0] = c0; currutmp->mode = mode0; currstat = currstat0; @@ -669,7 +669,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) uin->pager == 2 || (uin->pager == 4 && !(fri_stat & HFM)))) - outmsg(SHM->i18nstr[cuser.language][1960]); + outmsg(I18N[1960]); else { int write_pos = uin->msgcount; /* try to avoid race */ if ( write_pos < (MAX_MSGS - 1) ) { /* race here */ @@ -684,7 +684,7 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) sizeof(uin->msgs[write_pos].last_call_in)); uin->pager = pager0; } else if (flag != 2) - outmsg(SHM->i18nstr[cuser.language][1961]); + outmsg(I18N[1961]); if (uin->msgcount >= 1 && #ifdef NOKILLWATERBALL @@ -693,11 +693,11 @@ my_write(pid_t pid, char *prompt, char *id, int flag, userinfo_t * puin) (uin->pid <= 0 || kill(uin->pid, SIGUSR2) == -1) #endif && flag != 2) - outmsg(SHM->i18nstr[cuser.language][1962]); + outmsg(I18N[1962]); else if (uin->msgcount == 1 && flag != 2) - outmsg(SHM->i18nstr[cuser.language][1963]); + outmsg(I18N[1963]); else if (uin->msgcount > 1 && uin->msgcount < MAX_MSGS && flag != 2) - outmsg(SHM->i18nstr[cuser.language][1964]); + outmsg(I18N[1964]); } clrtoeol(); @@ -738,10 +738,10 @@ t_display_new(void) if (water[0].count && watermode > 0) { move(1, 0); - outs(SHM->i18nstr[cuser.language][1965]); + outs(I18N[1965]); outs(WATERMODE(WATER_ORIG) ? - SHM->i18nstr[cuser.language][1966] : - SHM->i18nstr[cuser.language][1967]); + I18N[1966] : + I18N[1967]); if (WATERMODE(WATER_NEW)) { move(2, 0); clrtoeol(); @@ -762,7 +762,7 @@ t_display_new(void) } else prints(" "); else - prints(SHM->i18nstr[cuser.language][1968], + prints(I18N[1968], water_which == &water[0] ? "\033[1;33;47m " : " " ); @@ -795,7 +795,7 @@ t_display_new(void) i++; } move(i + off, 0); - outs(SHM->i18nstr[cuser.language][1969]); + outs(I18N[1969]); if (WATERMODE(WATER_NEW)) while (i++ <= water[0].count) { move(i + off, 0); @@ -816,8 +816,8 @@ t_display(void) setuserfile(genbuf, fn_writelog); if (more(genbuf, YEA) != -1) { move(b_lines - 4, 0); - outs(SHM->i18nstr[cuser.language][1970]); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1971], + outs(I18N[1970]); + getdata(b_lines - 1, 0, I18N[1971], ans, sizeof(ans), LCECHO); if (*ans == 'm') { fileheader_t mymail; @@ -827,8 +827,8 @@ t_display(void) stampfile(buf, &mymail); mymail.filemode = FILE_READ ; - strlcpy(mymail.owner, SHM->i18nstr[cuser.language][1972], sizeof(mymail.owner)); - strlcpy(mymail.title, SHM->i18nstr[cuser.language][1973], sizeof(mymail.title)); + strlcpy(mymail.owner, I18N[1972], sizeof(mymail.owner)); + strlcpy(mymail.title, I18N[1973], sizeof(mymail.title)); sethomedir(title, cuser.userid); Rename(genbuf, buf); append_record(title, &mymail, sizeof(mymail)); @@ -1008,7 +1008,7 @@ do_talk(int fd) setutmpmode(TALK); ch = 58 - strlen(save_page_requestor); - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][1974], cuser.userid, cuser.username); + snprintf(genbuf, sizeof(genbuf), I18N[1974], cuser.userid, cuser.username); i = ch - strlen(genbuf); if (i >= 0) i = (i >> 1) + 1; @@ -1020,7 +1020,7 @@ do_talk(int fd) data[i] = '\0'; snprintf(mid_line, sizeof(mid_line), - SHM->i18nstr[cuser.language][1975], data, genbuf, save_page_requestor, data); + I18N[1975], data, genbuf, save_page_requestor, data); memset(&mywin, 0, sizeof(mywin)); memset(&itswin, 0, sizeof(itswin)); @@ -1051,7 +1051,7 @@ do_talk(int fd) break; move(b_lines, 0); clrtoeol(); - outs(SHM->i18nstr[cuser.language][1976]); + outs(I18N[1976]); im_leaving = 1; continue; } @@ -1092,13 +1092,13 @@ do_talk(int fd) char ans[4]; int i; - fprintf(flog, SHM->i18nstr[cuser.language][1977], + fprintf(flog, I18N[1977], Cdatelite(&now)); for (i = 0; i < scr_lns; i++) fprintf(flog, "%.*s\n", big_picture[i].len, big_picture[i].data); fclose(flog); more(fpath, NA); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][1978], + getdata(b_lines - 1, 0, I18N[1978], ans, sizeof(ans), LCECHO); if (*ans == 'm') { fileheader_t mymail; @@ -1107,9 +1107,9 @@ do_talk(int fd) sethomepath(genbuf, cuser.userid); stampfile(genbuf, &mymail); mymail.filemode = FILE_READ ; - strlcpy(mymail.owner, SHM->i18nstr[cuser.language][1979], sizeof(mymail.owner)); + strlcpy(mymail.owner, I18N[1979], sizeof(mymail.owner)); snprintf(mymail.title, sizeof(mymail.title), - SHM->i18nstr[cuser.language][1980], + I18N[1980], getuserid(currutmp->destuid)); sethomedir(title, cuser.userid); Rename(fpath, genbuf); @@ -1158,7 +1158,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){ if (pid > 0) kill(pid, SIGUSR1); clear(); - prints(SHM->i18nstr[cuser.language][1981], uin->userid); + prints(I18N[1981], uin->userid); listen(sock, 1); add_io(sock, timeout); @@ -1170,7 +1170,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){ if (!ch && uin->chatid[0] == 1 && uin->destuip == currutmp - &SHM->uinfo[0]) { bell(); - outmsg(SHM->i18nstr[cuser.language][1982]); + outmsg(I18N[1982]); refresh(); } else if (ch == EDITING || ch == TALK || ch == CHATING || ch == PAGE || ch == MAILALL || ch == MONITOR || @@ -1180,7 +1180,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){ add_io(0, 0); close(sock); currutmp->sockactive = currutmp->destuid = 0; - vmsg(SHM->i18nstr[cuser.language][1983]); + vmsg(I18N[1983]); unlockutmpmode(); return -1; } else { @@ -1188,7 +1188,7 @@ int make_connection_to_somebody(userinfo_t *uin, int timeout){ add_io(sock, 20); /* added for linux... achen */ #endif move(0, 0); - outs(SHM->i18nstr[cuser.language][1984]); + outs(I18N[1984]); bell(); uin->destuip = currutmp - &SHM->uinfo[0]; @@ -1239,30 +1239,30 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) kill(uin->pid, SIGUSR1); sock = make_connection_to_somebody(uin, 20); if (sock < 0) - vmsg(SHM->i18nstr[cuser.language][1985]); + vmsg(I18N[1985]); else { strlcpy(currutmp->mateid, uin->userid, sizeof(currutmp->mateid)); chc(sock, CHC_WATCH); } } else - outs(SHM->i18nstr[cuser.language][1986]); + outs(I18N[1986]); } else if (!HAS_PERM(PERM_SYSOP) && (((fri_stat & HRM) && !(fri_stat & HFM)) || ((!uin->pager) && !(fri_stat & HFM)))) { - outs(SHM->i18nstr[cuser.language][1987]); + outs(I18N[1987]); } else if (!HAS_PERM(PERM_SYSOP) && (((fri_stat & HRM) && !(fri_stat & HFM)) || uin->pager == 2)) { - outs(SHM->i18nstr[cuser.language][1988]); + outs(I18N[1988]); } else if (!HAS_PERM(PERM_SYSOP) && !(fri_stat & HFM) && uin->pager == 4) { - outs(SHM->i18nstr[cuser.language][1989]); + outs(I18N[1989]); } else if (!(pid = uin->pid) /* || (kill(pid, 0) == -1) */ ) { //resetutmpent(); outs(msg_usr_left); } else { showplans(uin->userid); - getdata(2, 0, SHM->i18nstr[cuser.language][1990], genbuf, 4, LCECHO); + getdata(2, 0, I18N[1990], genbuf, 4, LCECHO); switch (*genbuf) { case 'y': case 't': @@ -1287,8 +1287,8 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) if (!cuser.mychicken.name[0] || !xuser.mychicken.name[0]) error = 2; if (error) { - vmsg(error == 2 ? SHM->i18nstr[cuser.language][1991] : - SHM->i18nstr[cuser.language][1992]); + vmsg(error == 2 ? I18N[1991] : + I18N[1992]); return; } uin->sig = SIG_PK; @@ -1338,41 +1338,41 @@ my_talk(userinfo_t * uin, int fri_stat, char defact) } } else { move(9, 9); - outs(SHM->i18nstr[cuser.language][1993]); + outs(I18N[1993]); switch (c) { case 'a': - outs(SHM->i18nstr[cuser.language][1994]); + outs(I18N[1994]); break; case 'b': - prints(SHM->i18nstr[cuser.language][1995], sig_des(uin->sig)); + prints(I18N[1995], sig_des(uin->sig)); break; case 'd': - outs(SHM->i18nstr[cuser.language][1996]); + outs(I18N[1996]); break; case 'c': - outs(SHM->i18nstr[cuser.language][1997]); + outs(I18N[1997]); break; case 'e': - outs(SHM->i18nstr[cuser.language][1998]); + outs(I18N[1998]); break; case 'f': { char msgbuf[60]; read(msgsock, msgbuf, 60); - prints(SHM->i18nstr[cuser.language][1999], sig_des(uin->sig)); + prints(I18N[1999], sig_des(uin->sig)); move(10, 18); outs(msgbuf); } break; case '1': - prints(SHM->i18nstr[cuser.language][2000], sig_des(uin->sig)); + prints(I18N[2000], sig_des(uin->sig)); break; case '2': - prints(SHM->i18nstr[cuser.language][2001], sig_des(uin->sig)); + prints(I18N[2001], sig_des(uin->sig)); break; default: - prints(SHM->i18nstr[cuser.language][2002], sig_des(uin->sig)); + prints(I18N[2002], sig_des(uin->sig)); } close(msgsock); } @@ -1394,17 +1394,17 @@ t_showhelp() { clear(); - outs(SHM->i18nstr[cuser.language][2003]); + outs(I18N[2003]); if (HAS_PERM(PERM_PAGE)) { - outs(SHM->i18nstr[cuser.language][2004]); + outs(I18N[2004]); } if (HAS_PERM(PERM_SYSOP)) { - outs(SHM->i18nstr[cuser.language][2005]); - outs(SHM->i18nstr[cuser.language][2006]); - outs(SHM->i18nstr[cuser.language][2007]); + outs(I18N[2005]); + outs(I18N[2006]); + outs(I18N[2007]); #if defined(SHOWBOARD) && defined(DEBUG) - outs(SHM->i18nstr[cuser.language][2008]); + outs(I18N[2008]); #endif } pressanykey(); @@ -1693,10 +1693,10 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, int show_pid, int myfriend, int friendme, int bfriend, int badfriend) { char *msg_pickup_way[PICKUP_WAYS] = { - SHM->i18nstr[cuser.language][2009], SHM->i18nstr[cuser.language][2010], SHM->i18nstr[cuser.language][2011], SHM->i18nstr[cuser.language][2012], SHM->i18nstr[cuser.language][2013], SHM->i18nstr[cuser.language][2014], SHM->i18nstr[cuser.language][2015] + I18N[2009], I18N[2010], I18N[2011], I18N[2012], I18N[2013], I18N[2014], I18N[2015] }; char *MODE_STRING[MAX_SHOW_MODE] = { - SHM->i18nstr[cuser.language][2016], SHM->i18nstr[cuser.language][2017], SHM->i18nstr[cuser.language][2018], SHM->i18nstr[cuser.language][2019] + I18N[2016], I18N[2017], I18N[2018], I18N[2019] }; char pagerchar[5] = "* -Wf"; @@ -1709,21 +1709,21 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, #endif if (drawall) { - showtitle((cuser.uflag & FRIEND_FLAG) ? SHM->i18nstr[cuser.language][2020] : SHM->i18nstr[cuser.language][2021], + showtitle((cuser.uflag & FRIEND_FLAG) ? I18N[2020] : I18N[2021], BBSName); - prints(SHM->i18nstr[cuser.language][2022], + prints(I18N[2022], show_uid ? "UID" : "No.", (HAS_PERM(PERM_SEECLOAK) || HAS_PERM(PERM_SYSOP)) ? 'C' : ' ', - SHM->i18nstr[cuser.language][2023], + I18N[2023], MODE_STRING[show_mode], - show_board ? "Board" : SHM->i18nstr[cuser.language][2024], - show_pid ? " PID" : SHM->i18nstr[cuser.language][2025] + show_board ? "Board" : I18N[2024], + show_pid ? " PID" : I18N[2025] ); move(b_lines, 0); - outs(SHM->i18nstr[cuser.language][2026]); + outs(I18N[2026]); } move(1, 0); - prints(SHM->i18nstr[cuser.language][2027], + prints(I18N[2027], msg_pickup_way[pickup_way], SHM->UTMPnumber, myfriend, friendme, currutmp->brc_id ? (bfriend + 1) : 0, badfriend); @@ -1738,7 +1738,7 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, continue; } if (!uentp->pid) { - prints(SHM->i18nstr[cuser.language][2028], ch); + prints(I18N[2028], ch); continue; } if (PERM_HIDE(uentp)) @@ -1765,9 +1765,9 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, #endif if ((uentp->userlevel & PERM_VIOLATELAW)) - memcpy(mind, SHM->i18nstr[cuser.language][2029], 4); + memcpy(mind, I18N[2029], 4); else if (uentp->birth) - memcpy(mind, SHM->i18nstr[cuser.language][2030], 4); + memcpy(mind, I18N[2030], 4); else memcpy(mind, uentp->mind, 4); mind[4] = 0; @@ -1822,7 +1822,7 @@ call_in(userinfo_t * uentp, int fri_stat) { if (iswritable_stat(uentp, fri_stat)) { char genbuf[60]; - snprintf(genbuf, sizeof(genbuf), SHM->i18nstr[cuser.language][2031], uentp->userid); + snprintf(genbuf, sizeof(genbuf), I18N[2031], uentp->userid); my_write(uentp->pid, genbuf, uentp->userid, 0, NULL); return 1; } @@ -1933,7 +1933,7 @@ userlist(void) if (HAS_PERM(PERM_SYSOP)) { char buf[100]; snprintf(buf, sizeof(buf), - SHM->i18nstr[cuser.language][2032], currutmp->userid); + I18N[2032], currutmp->userid); if (!getdata(1, 0, buf, currutmp->userid, sizeof(buf), DOECHO)) strlcpy(currutmp->userid, cuser.userid, sizeof(currutmp->userid)); @@ -1945,7 +1945,7 @@ userlist(void) if (HAS_PERM(PERM_SYSOP)) { char buf[100]; - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][2033], currutmp->from); + snprintf(buf, sizeof(buf), I18N[2033], currutmp->from); if (!getdata(1, 0, buf, currutmp->from, sizeof(currutmp->from), DOECHO)) strncpy(currutmp->from, buf, 23); @@ -2124,14 +2124,14 @@ userlist(void) char genbuf[60]; char ans[4]; - if (!getdata(0, 0, SHM->i18nstr[cuser.language][2034], genbuf, sizeof(genbuf), DOECHO)) + if (!getdata(0, 0, I18N[2034], genbuf, sizeof(genbuf), DOECHO)) break; - if (getdata(0, 0, SHM->i18nstr[cuser.language][2035], + if (getdata(0, 0, I18N[2035], ans, sizeof(ans), LCECHO) && *ans == 'n') break; if (!(cuser.uflag & FRIEND_FLAG) && HAS_PERM(PERM_SYSOP)) { - getdata(1, 0, SHM->i18nstr[cuser.language][2036], + getdata(1, 0, I18N[2036], ans, sizeof(ans), LCECHO); if( *ans != 'y' && *ans != 'Y' ){ vmsg("abort"); @@ -2180,7 +2180,7 @@ userlist(void) int id; userec_t muser; strlcpy(currauthor, uentp->userid, sizeof(currauthor)); - stand_title(SHM->i18nstr[cuser.language][2037]); + stand_title(I18N[2037]); move(1, 0); if ((id = getuser(uentp->userid)) > 0) { memcpy(&muser, &xuser, sizeof(muser)); @@ -2193,12 +2193,12 @@ userlist(void) case 'i':{ char mindbuf[5]; - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2038], + getdata(b_lines - 1, 0, I18N[2038], mindbuf, sizeof(mindbuf), DOECHO); - if (strcmp(mindbuf, SHM->i18nstr[cuser.language][2039]) == 0) - vmsg(SHM->i18nstr[cuser.language][2040]); - else if (strcmp(mindbuf, SHM->i18nstr[cuser.language][2041]) == 0) - vmsg(SHM->i18nstr[cuser.language][2042]); + if (strcmp(mindbuf, I18N[2039]) == 0) + vmsg(I18N[2040]); + else if (strcmp(mindbuf, I18N[2041]) == 0) + vmsg(I18N[2042]); else memcpy(currutmp->mind, mindbuf, 4); } @@ -2232,7 +2232,7 @@ userlist(void) break; case 'a': if (HAS_PERM(PERM_LOGINOK) && !(fri_stat & IFH)) { - if (getans(SHM->i18nstr[cuser.language][2043]) == 'y') { + if (getans(I18N[2043]) == 'y') { friend_add(uentp->userid, FRIEND_OVERRIDE,uentp->username); friend_load(FRIEND_OVERRIDE); } @@ -2242,7 +2242,7 @@ userlist(void) case 'd': if (HAS_PERM(PERM_LOGINOK) && (fri_stat & IFH)) { - if (getans(SHM->i18nstr[cuser.language][2044]) == 'y') { + if (getans(I18N[2044]) == 'y') { friend_delete(uentp->userid, FRIEND_OVERRIDE); friend_load(FRIEND_OVERRIDE); } @@ -2269,15 +2269,15 @@ userlist(void) strcmp(uentp->userid, cuser.userid) != 0) { char genbuf[10]; move(b_lines - 2, 0); - prints(SHM->i18nstr[cuser.language][2045], uentp->userid); - if (getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2046], + prints(I18N[2045], uentp->userid); + if (getdata(b_lines - 1, 0, I18N[2046], genbuf, 7, LCECHO)) { clrtoeol(); if ((ch = atoi(genbuf)) <= 0 || ch <= give_tax(ch)){ redrawall = redraw = 1; break; } - sprintf(genbuf, SHM->i18nstr[cuser.language][2047], uentp->userid, ch); + sprintf(genbuf, I18N[2047], uentp->userid, ch); if (getans(genbuf) != 'y'){ redrawall = redraw = 1; break; @@ -2285,18 +2285,18 @@ userlist(void) reload_money(); if (ch > cuser.money) { - outs(SHM->i18nstr[cuser.language][2048]); + outs(I18N[2048]); } else { deumoney(uentp->uid, ch - give_tax(ch)); - log_file(FN_MONEY, 1, SHM->i18nstr[cuser.language][2050], + log_file(FN_MONEY, 1, I18N[2050], cuser.userid,uentp->userid, ch,ctime(&currutmp->lastact)); mail_redenvelop(cuser.userid, uentp->userid, ch - give_tax(ch), 'Y'); - vmsg(SHM->i18nstr[cuser.language][2049],demoney(-ch)); + vmsg(I18N[2049],demoney(-ch)); } } else { clrtoeol(); - vmsg(SHM->i18nstr[cuser.language][2051]); + vmsg(I18N[2051]); } redrawall = redraw = 1; } @@ -2304,8 +2304,8 @@ userlist(void) case 'm': if (HAS_PERM(PERM_BASIC)) { - stand_title(SHM->i18nstr[cuser.language][2052]); - prints(SHM->i18nstr[cuser.language][2053], uentp->userid); + stand_title(I18N[2052]); + prints(I18N[2053], uentp->userid); my_send(uentp->userid); setutmpmode(LUSERS); redrawall = redraw = 1; @@ -2348,12 +2348,12 @@ userlist(void) case Ctrl('W'): if (HAS_PERM(PERM_LOGINOK)) { int tmp; - char *wm[3] = {SHM->i18nstr[cuser.language][2054], SHM->i18nstr[cuser.language][2055], SHM->i18nstr[cuser.language][2056]}; + char *wm[3] = {I18N[2054], I18N[2055], I18N[2056]}; tmp = cuser.uflag2 & WATER_MASK; cuser.uflag2 -= tmp; tmp = (tmp + 1) % 3; cuser.uflag2 |= tmp; - vmsg(SHM->i18nstr[cuser.language][2057], wm[tmp]); + vmsg(I18N[2057], wm[tmp]); redrawall = redraw = 1; } break; @@ -2367,7 +2367,7 @@ userlist(void) break; case 'N': - oldgetdata(1, 0, SHM->i18nstr[cuser.language][2058], + oldgetdata(1, 0, I18N[2058], cuser.username, sizeof(cuser.username), DOECHO); strcpy(currutmp->username, cuser.username); redrawall = redraw = 1; @@ -2420,7 +2420,7 @@ t_idle(void) char passbuf[PASSLEN]; setutmpmode(IDLE); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2059], genbuf, 3, DOECHO); + getdata(b_lines - 1, 0, I18N[2059], genbuf, 3, DOECHO); if (genbuf[0] == 'q' || genbuf[0] == 'Q') { currutmp->mode = mode0; currstat = stat0; @@ -2432,14 +2432,14 @@ t_idle(void) if (currutmp->destuid == 6) if (!cuser.userlevel || - !getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2060], + !getdata(b_lines - 1, 0, I18N[2060], currutmp->chatid, sizeof(currutmp->chatid), DOECHO)) currutmp->destuid = 0; do { move(b_lines - 2, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][2061], (currutmp->destuid != 6) ? - SHM->i18nstr[cuser.language][1890 + currutmp->destuid] : currutmp->chatid); + prints(I18N[2061], (currutmp->destuid != 6) ? + I18N[1890 + currutmp->destuid] : currutmp->chatid); refresh(); getdata(b_lines - 1, 0, MSG_PASSWD, passbuf, sizeof(passbuf), NOECHO); passbuf[8] = '\0'; @@ -2459,7 +2459,7 @@ t_qchicken(void) { char uident[STRLEN]; - stand_title(SHM->i18nstr[cuser.language][2062]); + stand_title(I18N[2062]); usercomplete(msg_uid, uident); if (uident[0]) chicken_query(uident); @@ -2471,7 +2471,7 @@ t_query(void) { char uident[STRLEN]; - stand_title(SHM->i18nstr[cuser.language][2063]); + stand_title(I18N[2063]); usercomplete(msg_uid, uident); if (uident[0]) my_query(uident); @@ -2489,7 +2489,7 @@ t_talk() * if (count_ulist() <= 1){ outs("目前線上只有您一人,快邀請朋友來光臨【" * BBSNAME "】吧!"); return XEASY; } */ - stand_title(SHM->i18nstr[cuser.language][2064]); + stand_title(I18N[2064]); generalnamecomplete(msg_uid, uident, sizeof(uident), SHM->UTMPnumber, completeutmp_compar, @@ -2507,9 +2507,9 @@ t_talk() /* multi-login check */ unum = 1; while ((ucount = count_logins(tuid, 0)) > 1) { - outs(SHM->i18nstr[cuser.language][2065]); + outs(I18N[2065]); count_logins(tuid, 1); - getdata(1, 33, SHM->i18nstr[cuser.language][2066], genbuf, 4, DOECHO); + getdata(1, 33, I18N[2066], genbuf, 4, DOECHO); unum = atoi(genbuf); if (unum == 0) return 0; @@ -2535,7 +2535,7 @@ reply_connection_request(userinfo_t *uip) if (uip->mode != PAGE) { snprintf(genbuf, sizeof(genbuf), - SHM->i18nstr[cuser.language][2067], page_requestor); + I18N[2067], page_requestor); getdata(0, 0, genbuf, buf, sizeof(buf), LCECHO); return -1; } @@ -2575,25 +2575,25 @@ talkreply(void) clear(); prints("\n\n"); - prints(SHM->i18nstr[cuser.language][2068], sig_des(sig)); - prints(SHM->i18nstr[cuser.language][2069], + prints(I18N[2068], sig_des(sig)); + prints(I18N[2069], sig_des(sig), sig_des(sig)); - prints(SHM->i18nstr[cuser.language][2070]); - prints(SHM->i18nstr[cuser.language][2071]); - prints(SHM->i18nstr[cuser.language][2072], sig_des(sig), sig_des(sig)); + prints(I18N[2070]); + prints(I18N[2071]); + prints(I18N[2072], sig_des(sig), sig_des(sig)); getuser(uip->userid); currutmp->msgs[0].pid = uip->pid; strlcpy(currutmp->msgs[0].userid, uip->userid, sizeof(currutmp->msgs[0].userid)); - strlcpy(currutmp->msgs[0].last_call_in, SHM->i18nstr[cuser.language][2073], + strlcpy(currutmp->msgs[0].last_call_in, I18N[2073], sizeof(currutmp->msgs[0].last_call_in)); - prints(SHM->i18nstr[cuser.language][2074], + prints(I18N[2074], uip->from, xuser.numlogins, xuser.numposts); showplans(uip->userid); show_call_in(0, 0); snprintf(genbuf, sizeof(genbuf), - SHM->i18nstr[cuser.language][2075], + I18N[2075], page_requestor, sig_des(sig)); getdata(0, 0, genbuf, buf, sizeof(buf), LCECHO); a = reply_connection_request(uip); @@ -2602,8 +2602,8 @@ talkreply(void) buf[0] = 'n'; write(a, buf, 1); if (buf[0] == 'f' || buf[0] == 'F') { - if (!getdata(b_lines, 0, SHM->i18nstr[cuser.language][2076], genbuf, 60, DOECHO)) - strlcpy(genbuf, SHM->i18nstr[cuser.language][2077], sizeof(genbuf)); + if (!getdata(b_lines, 0, I18N[2076], genbuf, 60, DOECHO)) + strlcpy(genbuf, I18N[2077], sizeof(genbuf)); write(a, genbuf, 60); } diff --git a/mbbsd/topsong.c b/mbbsd/topsong.c index 7f0e6ddf..a3681a0f 100644 --- a/mbbsd/topsong.c +++ b/mbbsd/topsong.c @@ -68,7 +68,7 @@ sortsong() } qsort(songs, MAX_SONGS, sizeof(songcmp_t), (QCAST) count_cmp); fprintf(fo, - SHM->i18nstr[cuser.language][2078], totalcount); + I18N[2078], totalcount); for (n = 0; n < 100 && songs[n].name[0]; n++) { fprintf(fo, " %5d. %-38.38s %4ld \033[32m[%.2f]\033[m\n", n + 1, songs[n].name, songs[n].count, diff --git a/mbbsd/user.c b/mbbsd/user.c index 577da96f..92c4a08a 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -28,12 +28,12 @@ u_loginview() move(4, 0); for (i = 0; i < NUMVIEWFILE; i++) prints(" %c. %-20s %-15s \n", 'A' + i, - SHM->i18nstr[cuser.language][loginview_file[i].string_index] - , ((pbits >> i) & 1 ? SHM->i18nstr[cuser.language][2079] : - SHM->i18nstr[cuser.language][2080])); + I18N[loginview_file[i].string_index] + , ((pbits >> i) & 1 ? I18N[2079] : + I18N[2080])); clrtobot(); - while ((i = getkey(SHM->i18nstr[cuser.language][2081]))!='\r') { + while ((i = getkey(I18N[2081]))!='\r') { i = i - 'a'; if (i >= NUMVIEWFILE || i < 0) @@ -41,7 +41,7 @@ u_loginview() else { pbits ^= (1 << i); move(i + 4, 28); - prints((pbits >> i) & 1 ? SHM->i18nstr[cuser.language][2082] : SHM->i18nstr[cuser.language][2083]); + prints((pbits >> i) & 1 ? I18N[2082] : I18N[2083]); } } @@ -60,13 +60,13 @@ user_display(userec_t * u, int real) clrtobot(); prints( - SHM->i18nstr[cuser.language][2084]); - prints(SHM->i18nstr[cuser.language][2085], + I18N[2084]); + prints(I18N[2085], u->userid, u->username, u->realname, #ifdef FOREIGN_REG - u->uflag2 & FOREIGN ? SHM->i18nstr[cuser.language][2087] : "", + u->uflag2 & FOREIGN ? I18N[2087] : "", u->uflag2 & FOREIGN ? - (u->uflag2 & LIVERIGHT) ? SHM->i18nstr[cuser.language][2088] : SHM->i18nstr[cuser.language][2089] + (u->uflag2 & LIVERIGHT) ? I18N[2088] : I18N[2089] : "", #else "","", @@ -75,14 +75,14 @@ user_display(userec_t * u, int real) sex[u->sex % 8], u->money); sethomedir(genbuf, u->userid); - prints(SHM->i18nstr[cuser.language][2090], + prints(I18N[2090], get_num_records(genbuf, sizeof(fileheader_t)), u->exmailbox, u->mobile, u->month, u->day, u->year % 100, u->mychicken.name); - prints(SHM->i18nstr[cuser.language][2091], ctime(&u->firstlogin)); - prints(SHM->i18nstr[cuser.language][2092], ctime(&u->lastlogin)); - prints(SHM->i18nstr[cuser.language][2093], ctime(&u->lastsong)); - prints(SHM->i18nstr[cuser.language][2094], + prints(I18N[2091], ctime(&u->firstlogin)); + prints(I18N[2092], ctime(&u->lastlogin)); + prints(I18N[2093], ctime(&u->lastsong)); + prints(I18N[2094], u->numlogins, u->numposts); if (real) { @@ -90,11 +90,11 @@ user_display(userec_t * u, int real) for (diff = 0; diff < 32; diff++) if (!(u->userlevel & (1 << diff))) genbuf[diff] = '-'; - prints(SHM->i18nstr[cuser.language][2095], + prints(I18N[2095], u->justify, genbuf); } else { diff = (now - login_start_time) / 60; - prints(SHM->i18nstr[cuser.language][2096], + prints(I18N[2096], diff / 60, diff % 60); } @@ -103,7 +103,7 @@ user_display(userec_t * u, int real) int i; boardheader_t *bhdr; - outs(SHM->i18nstr[cuser.language][2097]); + outs(I18N[2097]); for (i = 0, bhdr = bcache; i < numboards; i++, bhdr++) { if (is_uBM(bhdr->BM, u->userid)) { @@ -113,15 +113,15 @@ user_display(userec_t * u, int real) } outc('\n'); } - outs(SHM->i18nstr[cuser.language][2098]); + outs(I18N[2098]); outs((u->userlevel & PERM_LOGINOK) ? - SHM->i18nstr[cuser.language][2099] : - SHM->i18nstr[cuser.language][2100]); + I18N[2099] : + I18N[2100]); #ifdef NEWUSER_LIMIT if ((u->lastlogin - u->firstlogin < 3 * 86400) && !HAS_PERM(PERM_POST)) - outs(SHM->i18nstr[cuser.language][2101]); + outs(I18N[2101]); #endif } @@ -135,11 +135,11 @@ mail_violatelaw(char *crime, char *police, char *reason, char *result) stampfile(genbuf, &fhdr); if (!(fp = fopen(genbuf, "w"))) return; - fprintf(fp, SHM->i18nstr[cuser.language][2102], + fprintf(fp, I18N[2102], ctime(&now), police, crime, reason, result); fclose(fp); - strcpy(fhdr.title, SHM->i18nstr[cuser.language][2103]); - strcpy(fhdr.owner, SHM->i18nstr[cuser.language][2104]); + strcpy(fhdr.title, I18N[2103]); + strcpy(fhdr.owner, I18N[2104]); snprintf(genbuf, 200, "home/%c/%s/.DIR", crime[0], crime); append_record(genbuf, &fhdr, sizeof(fhdr)); } @@ -152,26 +152,26 @@ violate_law(userec_t * u, int unum) move(1, 0); clrtobot(); move(2, 0); - prints(SHM->i18nstr[cuser.language][2105]); - prints(SHM->i18nstr[cuser.language][2106]); - getdata(5, 0, SHM->i18nstr[cuser.language][2107], ans, 3, DOECHO); + prints(I18N[2105]); + prints(I18N[2106]); + getdata(5, 0, I18N[2107], ans, 3, DOECHO); switch (ans[0]) { case '1': strcpy(reason, "Cross-post"); break; case '2': - strcpy(reason, SHM->i18nstr[cuser.language][2108]); + strcpy(reason, I18N[2108]); break; case '3': - strcpy(reason, SHM->i18nstr[cuser.language][2109]); + strcpy(reason, I18N[2109]); break; case '4': - while (!getdata(7, 0, SHM->i18nstr[cuser.language][2110], reason, 50, DOECHO)); - strcat(reason, SHM->i18nstr[cuser.language][2111]); + while (!getdata(7, 0, I18N[2110], reason, 50, DOECHO)); + strcat(reason, I18N[2111]); break; case '8': case '9': - while (!getdata(6, 0, SHM->i18nstr[cuser.language][2112], reason, 50, DOECHO)); + while (!getdata(6, 0, I18N[2112], reason, 50, DOECHO)); break; default: return; @@ -184,15 +184,15 @@ violate_law(userec_t * u, int unum) snprintf(src, sizeof(src), "home/%c/%s", u->userid[0], u->userid); snprintf(dst, sizeof(dst), "tmp/%s", u->userid); Rename(src, dst); - post_violatelaw(u->userid, cuser.userid, reason, SHM->i18nstr[cuser.language][2113]); + post_violatelaw(u->userid, cuser.userid, reason, I18N[2113]); kill_user(unum); } else { u->userlevel |= PERM_VIOLATELAW; u->vl_count++; passwd_update(unum, u); - post_violatelaw(u->userid, cuser.userid, reason, SHM->i18nstr[cuser.language][2114]); - mail_violatelaw(u->userid, cuser.userid, reason, SHM->i18nstr[cuser.language][2115]); + post_violatelaw(u->userid, cuser.userid, reason, I18N[2114]); + mail_violatelaw(u->userid, cuser.userid, reason, I18N[2115]); } pressanykey(); } @@ -201,29 +201,29 @@ static void Customize(void) { char done = 0, mindbuf[5]; - showtitle(SHM->i18nstr[cuser.language][2119], SHM->i18nstr[cuser.language][2120]); + showtitle(I18N[2119], I18N[2120]); memcpy(mindbuf, &currutmp->mind, 4); mindbuf[4] = 0; while( !done ){ move(2, 0); - prints(SHM->i18nstr[cuser.language][2121]); + prints(I18N[2121]); move(4, 0); - prints("%-30s%10s\n", SHM->i18nstr[cuser.language][2122], - SHM->i18nstr[cuser.language][2116 + (cuser.uflag2 & WATER_MASK)]); - prints("%-30s%10s\n", SHM->i18nstr[cuser.language][2123], - ((cuser.userlevel & PERM_NOOUTMAIL) ? SHM->i18nstr[cuser.language][2124] : SHM->i18nstr[cuser.language][2125])); - prints("%-30s%10s\n", SHM->i18nstr[cuser.language][2126], - ((cuser.uflag2 & FAVNEW_FLAG) ? SHM->i18nstr[cuser.language][2127] : SHM->i18nstr[cuser.language][2128])); - prints("%-30s%10s\n", SHM->i18nstr[cuser.language][2129], mindbuf); - prints("%-30s%10s\n", SHM->i18nstr[cuser.language][2130], - ((cuser.uflag2 & FAVNOHILIGHT) ? SHM->i18nstr[cuser.language][2131] : SHM->i18nstr[cuser.language][2132])); - switch(getkey(SHM->i18nstr[cuser.language][2133])){ + prints("%-30s%10s\n", I18N[2122], + I18N[2116 + (cuser.uflag2 & WATER_MASK)]); + prints("%-30s%10s\n", I18N[2123], + ((cuser.userlevel & PERM_NOOUTMAIL) ? I18N[2124] : I18N[2125])); + prints("%-30s%10s\n", I18N[2126], + ((cuser.uflag2 & FAVNEW_FLAG) ? I18N[2127] : I18N[2128])); + prints("%-30s%10s\n", I18N[2129], mindbuf); + prints("%-30s%10s\n", I18N[2130], + ((cuser.uflag2 & FAVNOHILIGHT) ? I18N[2131] : I18N[2132])); + switch(getkey(I18N[2133])){ case 'a':{ int currentset = cuser.uflag2 & WATER_MASK; currentset = (currentset + 1) % 3; cuser.uflag2 &= ~WATER_MASK; cuser.uflag2 |= currentset; - vmsg(SHM->i18nstr[cuser.language][2134]); + vmsg(I18N[2134]); } break; case 'b': @@ -235,12 +235,12 @@ static void Customize(void) subscribe_newfav(); break; case 'd':{ - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2135], + getdata(b_lines - 1, 0, I18N[2135], mindbuf, sizeof(mindbuf), DOECHO); - if (strcmp(mindbuf, SHM->i18nstr[cuser.language][2136]) == 0) - vmsg(SHM->i18nstr[cuser.language][2137]); - else if (strcmp(mindbuf, SHM->i18nstr[cuser.language][2138]) == 0) - vmsg(SHM->i18nstr[cuser.language][2139]); + if (strcmp(mindbuf, I18N[2136]) == 0) + vmsg(I18N[2137]); + else if (strcmp(mindbuf, I18N[2138]) == 0) + vmsg(I18N[2139]); else memcpy(currutmp->mind, mindbuf, 4); } @@ -274,8 +274,8 @@ uinfo_query(userec_t * u, int real, int unum) memcpy(&x, u, sizeof(userec_t)); ans = getans(real ? - SHM->i18nstr[cuser.language][2140] : - SHM->i18nstr[cuser.language][2141]); + I18N[2140] : + I18N[2141]); if (ans > '2' && ans != 'C' && ans != 'c' && !real) ans = '0'; @@ -296,32 +296,32 @@ uinfo_query(userec_t * u, int real, int unum) return; case '1': move(0, 0); - outs(SHM->i18nstr[cuser.language][2142]); + outs(I18N[2142]); - getdata_buf(i++, 0, SHM->i18nstr[cuser.language][2143], x.username, + getdata_buf(i++, 0, I18N[2143], x.username, sizeof(x.username), DOECHO); if (real) { - getdata_buf(i++, 0, SHM->i18nstr[cuser.language][2144], + getdata_buf(i++, 0, I18N[2144], x.realname, sizeof(x.realname), DOECHO); #ifdef FOREIGN_REG - getdata_buf(i++, 0, cuser.uflag2 & FOREIGN ? SHM->i18nstr[cuser.language][2145] : SHM->i18nstr[cuser.language][2146], x.ident, sizeof(x.ident), DOECHO); + getdata_buf(i++, 0, cuser.uflag2 & FOREIGN ? I18N[2145] : I18N[2146], x.ident, sizeof(x.ident), DOECHO); #else - getdata_buf(i++, 0, SHM->i18nstr[cuser.language][2147], x.ident, sizeof(x.ident), DOECHO); + getdata_buf(i++, 0, I18N[2147], x.ident, sizeof(x.ident), DOECHO); #endif - getdata_buf(i++, 0, SHM->i18nstr[cuser.language][2148], + getdata_buf(i++, 0, I18N[2148], x.address, sizeof(x.address), DOECHO); } snprintf(buf, sizeof(buf), "%010d", x.mobile); - getdata_buf(i++, 0, SHM->i18nstr[cuser.language][2149], buf, 11, LCECHO); + getdata_buf(i++, 0, I18N[2149], buf, 11, LCECHO); x.mobile = atoi(buf); - getdata_str(i++, 0, SHM->i18nstr[cuser.language][2150], buf, 50, DOECHO, + getdata_str(i++, 0, I18N[2150], buf, 50, DOECHO, x.email); if (strcmp(buf, x.email) && strchr(buf, '@')) { strlcpy(x.email, buf, sizeof(x.email)); mail_changed = 1 - real; } snprintf(genbuf, sizeof(genbuf), "%i", (u->sex + 1) % 8); - getdata_str(i++, 0, SHM->i18nstr[cuser.language][2151], + getdata_str(i++, 0, I18N[2151], buf, 3, DOECHO, genbuf); if (buf[0] >= '1' && buf[0] <= '8') x.sex = (buf[0] - '1') % 8; @@ -333,7 +333,7 @@ uinfo_query(userec_t * u, int real, int unum) snprintf(genbuf, sizeof(genbuf), "%02i/%02i/%02i", u->month, u->day, u->year % 100); - len = getdata_str(i, 0, SHM->i18nstr[cuser.language][2152], buf, 9, + len = getdata_str(i, 0, I18N[2152], buf, 9, DOECHO, genbuf); if (len && len != 8) continue; @@ -357,7 +357,7 @@ uinfo_query(userec_t * u, int real, int unum) int l; if (HAS_PERM(PERM_BBSADM)) { snprintf(genbuf, sizeof(genbuf), "%d", x.money); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2153], buf, 10, DOECHO, genbuf)) + if (getdata_str(i++, 0, I18N[2153], buf, 10, DOECHO, genbuf)) if ((l = atol(buf)) != 0) { if (l != x.money) { money_change = 1; @@ -367,40 +367,40 @@ uinfo_query(userec_t * u, int real, int unum) } } snprintf(genbuf, sizeof(genbuf), "%d", x.exmailbox); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2154], buf, 6, + if (getdata_str(i++, 0, I18N[2154], buf, 6, DOECHO, genbuf)) if ((l = atol(buf)) != 0) x.exmailbox = (int)l; - getdata_buf(i++, 0, SHM->i18nstr[cuser.language][2155], x.justify, + getdata_buf(i++, 0, I18N[2155], x.justify, sizeof(x.justify), DOECHO); - getdata_buf(i++, 0, SHM->i18nstr[cuser.language][2156], + getdata_buf(i++, 0, I18N[2156], x.lasthost, sizeof(x.lasthost), DOECHO); snprintf(genbuf, sizeof(genbuf), "%d", x.numlogins); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2157], buf, 10, DOECHO, genbuf)) + if (getdata_str(i++, 0, I18N[2157], buf, 10, DOECHO, genbuf)) if ((fail = atoi(buf)) >= 0) x.numlogins = fail; snprintf(genbuf, sizeof(genbuf), "%d", u->numposts); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2158], buf, 10, DOECHO, genbuf)) + if (getdata_str(i++, 0, I18N[2158], buf, 10, DOECHO, genbuf)) if ((fail = atoi(buf)) >= 0) x.numposts = fail; snprintf(genbuf, sizeof(genbuf), "%d", u->goodpost); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2159], buf, 10, DOECHO, genbuf)) + if (getdata_str(i++, 0, I18N[2159], buf, 10, DOECHO, genbuf)) if ((fail = atoi(buf)) >= 0) x.goodpost = fail; snprintf(genbuf, sizeof(genbuf), "%d", u->badpost); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2160], buf, 10, DOECHO, genbuf)) + if (getdata_str(i++, 0, I18N[2160], buf, 10, DOECHO, genbuf)) if ((fail = atoi(buf)) >= 0) x.badpost = fail; snprintf(genbuf, sizeof(genbuf), "%d", u->vl_count); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2161], buf, 10, DOECHO, genbuf)) + if (getdata_str(i++, 0, I18N[2161], buf, 10, DOECHO, genbuf)) if ((fail = atoi(buf)) >= 0) x.vl_count = fail; snprintf(genbuf, sizeof(genbuf), "%d/%d/%d", u->five_win, u->five_lose, u->five_tie); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2162], buf, 16, DOECHO, + if (getdata_str(i++, 0, I18N[2162], buf, 16, DOECHO, genbuf)) while (1) { p = strtok(buf, "/\r\n"); @@ -419,7 +419,7 @@ uinfo_query(userec_t * u, int real, int unum) } snprintf(genbuf, sizeof(genbuf), "%d/%d/%d", u->chc_win, u->chc_lose, u->chc_tie); - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2163], buf, 16, DOECHO, + if (getdata_str(i++, 0, I18N[2163], buf, 16, DOECHO, genbuf)) while (1) { p = strtok(buf, "/\r\n"); @@ -437,7 +437,7 @@ uinfo_query(userec_t * u, int real, int unum) break; } #ifdef FOREIGN_REG - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2164], buf, 2, DOECHO, x.uflag2 & FOREIGN ? "2" : "1")) + if (getdata_str(i++, 0, I18N[2164], buf, 2, DOECHO, x.uflag2 & FOREIGN ? "2" : "1")) if ((fail = atoi(buf)) > 0){ if (fail == 2){ x.uflag2 |= FOREIGN; @@ -446,7 +446,7 @@ uinfo_query(userec_t * u, int real, int unum) x.uflag2 &= ~FOREIGN; } if (x.uflag2 & FOREIGN) - if (getdata_str(i++, 0, SHM->i18nstr[cuser.language][2165], buf, 2, DOECHO, x.uflag2 & LIVERIGHT ? "1" : "2")){ + if (getdata_str(i++, 0, I18N[2165], buf, 2, DOECHO, x.uflag2 & LIVERIGHT ? "1" : "2")){ if ((fail = atoi(buf)) > 0){ if (fail == 1){ x.uflag2 |= LIVERIGHT; @@ -466,29 +466,29 @@ uinfo_query(userec_t * u, int real, int unum) case '2': i = 19; if (!real) { - if (!getdata(i++, 0, SHM->i18nstr[cuser.language][2166], buf, PASSLEN, NOECHO) || + if (!getdata(i++, 0, I18N[2166], buf, PASSLEN, NOECHO) || !checkpasswd(u->passwd, buf)) { - outs(SHM->i18nstr[cuser.language][2167]); + outs(I18N[2167]); fail++; break; } } else { char witness[3][32]; for (i = 0; i < 3; i++) { - if (!getdata(19 + i, 0, SHM->i18nstr[cuser.language][2168], + if (!getdata(19 + i, 0, I18N[2168], witness[i], sizeof(witness[i]), DOECHO)) { - outs(SHM->i18nstr[cuser.language][2169]); + outs(I18N[2169]); fail++; break; } else if (!(uid = getuser(witness[i]))) { - outs(SHM->i18nstr[cuser.language][2170]); + outs(I18N[2170]); fail++; break; } else { userec_t atuser; passwd_query(uid, &atuser); if (now - atuser.firstlogin < 6 * 30 * 24 * 60 * 60) { - outs(SHM->i18nstr[cuser.language][2171]); + outs(I18N[2171]); i--; } } @@ -499,16 +499,16 @@ uinfo_query(userec_t * u, int real, int unum) i = 20; } - if (!getdata(i++, 0, SHM->i18nstr[cuser.language][2172], buf, PASSLEN, NOECHO)) { - outs(SHM->i18nstr[cuser.language][2173]); + if (!getdata(i++, 0, I18N[2172], buf, PASSLEN, NOECHO)) { + outs(I18N[2173]); fail++; break; } strncpy(genbuf, buf, PASSLEN); - getdata(i++, 0, SHM->i18nstr[cuser.language][2174], buf, PASSLEN, NOECHO); + getdata(i++, 0, I18N[2174], buf, PASSLEN, NOECHO); if (strncmp(buf, genbuf, PASSLEN)) { - outs(SHM->i18nstr[cuser.language][2175]); + outs(I18N[2175]); fail++; break; } @@ -534,10 +534,10 @@ uinfo_query(userec_t * u, int real, int unum) break; case '5': - if (getdata_str(b_lines - 3, 0, SHM->i18nstr[cuser.language][2176], genbuf, IDLEN + 1, + if (getdata_str(b_lines - 3, 0, I18N[2176], genbuf, IDLEN + 1, DOECHO, x.userid)) { if (searchuser(genbuf)) { - outs(SHM->i18nstr[cuser.language][2177]); + outs(I18N[2177]); fail++; } else strlcpy(x.userid, genbuf, sizeof(x.userid)); @@ -547,7 +547,7 @@ uinfo_query(userec_t * u, int real, int unum) if (x.mychicken.name[0]) x.mychicken.name[0] = 0; else - strlcpy(x.mychicken.name, SHM->i18nstr[cuser.language][2178], sizeof(x.mychicken.name)); + strlcpy(x.mychicken.name, I18N[2178], sizeof(x.mychicken.name)); break; default: return; @@ -594,21 +594,21 @@ uinfo_query(userec_t * u, int real, int unum) if (!(fp = fopen(genbuf, "w"))) return; - fprintf(fp, SHM->i18nstr[cuser.language][2179], + fprintf(fp, I18N[2179], ctime(&now), cuser.userid, x.userid, money, x.money); clrtobot(); clear(); - while (!getdata(5, 0, SHM->i18nstr[cuser.language][2180], + while (!getdata(5, 0, I18N[2180], reason, sizeof(reason), DOECHO)); - fprintf(fp, SHM->i18nstr[cuser.language][2181], + fprintf(fp, I18N[2181], cuser.userid, reason); fclose(fp); snprintf(fhdr.title, sizeof(fhdr.title), - SHM->i18nstr[cuser.language][2182], cuser.userid, + I18N[2182], cuser.userid, x.userid); - strlcpy(fhdr.owner, SHM->i18nstr[cuser.language][2183], sizeof(fhdr.owner)); + strlcpy(fhdr.owner, I18N[2183], sizeof(fhdr.owner)); append_record("boards/S/Security/.DIR", &fhdr, sizeof(fhdr)); } } @@ -652,7 +652,7 @@ u_switchproverb() FILE *fp = fopen(buf, "a"); assert(fp); - fprintf(fp, SHM->i18nstr[cuser.language][2184]); + fprintf(fp, I18N[2184]); fclose(fp); } passwd_update(usernum, &cuser); @@ -668,7 +668,7 @@ u_editproverb() setuserfile(buf, fn_proverb); move(1, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][2185]); + outs(I18N[2185]); pressanykey(); vedit(buf, NA, NULL); return 0; @@ -681,7 +681,7 @@ showplans(char *uid) sethomefile(genbuf, uid, fn_plans); if (!show_file(genbuf, 7, MAX_QUERYLINES, ONLY_COLOR)) - prints(SHM->i18nstr[cuser.language][2186], uid); + prints(I18N[2186], uid); } int @@ -700,7 +700,7 @@ showsignature(char *fname, int *j) for (ch = '1'; ch <= '9'; ch++) { fname[*j] = ch; if ((fp = fopen(fname, "r"))) { - prints(SHM->i18nstr[cuser.language][2187], ch); + prints(I18N[2187], ch); for (i = 0; i < MAX_SIGLINES && fgets(buf, sizeof(buf), fp); i++) outs(buf); num++; @@ -720,7 +720,7 @@ u_editsig() showsignature(genbuf, &j); - getdata(0, 0, SHM->i18nstr[cuser.language][2188], + getdata(0, 0, I18N[2188], ans, sizeof(ans), LCECHO); aborted = 0; @@ -730,7 +730,7 @@ u_editsig() aborted = 2; if (aborted) { - if (!getdata(1, 0, SHM->i18nstr[cuser.language][2189], ans, sizeof(ans), DOECHO)) + if (!getdata(1, 0, I18N[2189], ans, sizeof(ans), DOECHO)) ans[0] = '1'; if (ans[0] >= '1' && ans[0] <= '9') { genbuf[j] = ans[0]; @@ -741,7 +741,7 @@ u_editsig() setutmpmode(EDITSIG); aborted = vedit(genbuf, NA, NULL); if (aborted != -1) - outs(SHM->i18nstr[cuser.language][2190]); + outs(I18N[2190]); } } pressanykey(); @@ -754,7 +754,7 @@ u_editplan() { char genbuf[200]; - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2191], + getdata(b_lines - 1, 0, I18N[2191], genbuf, 3, LCECHO); if (genbuf[0] == 'e') { @@ -764,13 +764,13 @@ u_editplan() setuserfile(genbuf, fn_plans); aborted = vedit(genbuf, NA, NULL); if (aborted != -1) - outs(SHM->i18nstr[cuser.language][2192]); + outs(I18N[2192]); pressanykey(); return 0; } else if (genbuf[0] == 'd') { setuserfile(genbuf, fn_plans); unlink(genbuf); - outmsg(SHM->i18nstr[cuser.language][2193]); + outmsg(I18N[2193]); } return 0; } @@ -780,7 +780,7 @@ u_editcalendar() { char genbuf[200]; - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2194], + getdata(b_lines - 1, 0, I18N[2194], genbuf, 3, LCECHO); sethomefile(genbuf, cuser.userid, "calendar"); @@ -791,11 +791,11 @@ u_editcalendar() sethomefile(genbuf, cuser.userid, "calendar"); aborted = vedit(genbuf, NA, NULL); if (aborted != -1) - vmsg(SHM->i18nstr[cuser.language][2195]); + vmsg(I18N[2195]); return 0; } else if (genbuf[0] == 'd') { unlink(genbuf); - vmsg(SHM->i18nstr[cuser.language][2196]); + vmsg(I18N[2196]); } return 0; } @@ -808,12 +808,12 @@ getfield(int line, char *info, char *desc, char *buf, int len) char genbuf[200]; move(line, 2); - prints(SHM->i18nstr[cuser.language][2197], buf, info); - snprintf(prompt, sizeof(prompt), SHM->i18nstr[cuser.language][2198], desc); + prints(I18N[2197], buf, info); + snprintf(prompt, sizeof(prompt), I18N[2198], desc); if (getdata_str(line + 1, 2, prompt, genbuf, len, DOECHO, buf)) strcpy(buf, genbuf); move(line, 2); - prints(SHM->i18nstr[cuser.language][2199], desc, buf); + prints(I18N[2199], desc, buf); clrtoeol(); } @@ -916,47 +916,47 @@ toregister(char *email, char *genbuf, char *phone, char *career, fclose(fn); } clear(); - stand_title(SHM->i18nstr[cuser.language][2200]); + stand_title(I18N[2200]); if (cuser.userlevel & PERM_NOREGCODE){ strcpy(email, "x"); goto REGFORM2; } move(2, 0); - outs(SHM->i18nstr[cuser.language][2201]); + outs(I18N[2201]); #ifdef HAVEMOBILE - outs(SHM->i18nstr[cuser.language][2202]); + outs(I18N[2202]); #endif while (1) { email[0] = 0; - getfield(15, SHM->i18nstr[cuser.language][2203], "E-Mail Address", email, 50); + getfield(15, I18N[2203], "E-Mail Address", email, 50); if (strcmp(email, "x") == 0 || strcmp(email, "X") == 0) break; #ifdef HAVEMOBILE else if (strcmp(email, "m") == 0 || strcmp(email, "M") == 0) { if (isvalidmobile(mobile)) { char yn[3]; - getdata(16, 0, SHM->i18nstr[cuser.language][2204], + getdata(16, 0, I18N[2204], yn, sizeof(yn), LCECHO); if (yn[0] == 'Y' || yn[0] == 'y') break; } else { move(17, 0); - prints(SHM->i18nstr[cuser.language][2205]); + prints(I18N[2205]); } } #endif else if (isvalidemail(email)) { char yn[3]; - getdata(16, 0, SHM->i18nstr[cuser.language][2206], + getdata(16, 0, I18N[2206], yn, sizeof(yn), LCECHO); if (yn[0] == 'Y' || yn[0] == 'y') break; } else { move(17, 0); - prints(SHM->i18nstr[cuser.language][2207]); + prints(I18N[2207]); } } strncpy(cuser.email, email, sizeof(cuser.email)); @@ -990,7 +990,7 @@ toregister(char *email, char *genbuf, char *phone, char *career, sethomefile(buf, cuser.userid, "justify"); } snprintf(buf, sizeof(buf), "%s%s%s%s", - SHM->i18nstr[cuser.language][2208], BBSNAME, SHM->i18nstr[cuser.language][2209], getregcode(genbuf)); + I18N[2208], BBSNAME, I18N[2209], getregcode(genbuf)); strlcpy(tmp, cuser.userid, sizeof(tmp)); strlcpy(cuser.userid, "SYSOP", sizeof(cuser.userid)); #ifdef HAVEMOBILE @@ -1000,7 +1000,7 @@ toregister(char *email, char *genbuf, char *phone, char *career, #endif bsmtp("etc/registermail", buf, email, 0); strlcpy(cuser.userid, tmp, sizeof(cuser.userid)); - outs(SHM->i18nstr[cuser.language][2210]); + outs(I18N[2210]); pressanykey(); return; } @@ -1011,12 +1011,12 @@ static int HaveRejectStr(char *s, char **rej) { int i; char *ptr, *rejectstr[] = - {SHM->i18nstr[cuser.language][2211], SHM->i18nstr[cuser.language][2212], SHM->i18nstr[cuser.language][2213], SHM->i18nstr[cuser.language][2214], SHM->i18nstr[cuser.language][2215], SHM->i18nstr[cuser.language][2216], SHM->i18nstr[cuser.language][2217], "..", "xx", - SHM->i18nstr[cuser.language][2218], SHM->i18nstr[cuser.language][2219], SHM->i18nstr[cuser.language][2220], SHM->i18nstr[cuser.language][2221], SHM->i18nstr[cuser.language][2222], - SHM->i18nstr[cuser.language][2223], SHM->i18nstr[cuser.language][2224], SHM->i18nstr[cuser.language][2225], SHM->i18nstr[cuser.language][2226], SHM->i18nstr[cuser.language][2227], SHM->i18nstr[cuser.language][2228], SHM->i18nstr[cuser.language][2229], SHM->i18nstr[cuser.language][2230], SHM->i18nstr[cuser.language][2231], SHM->i18nstr[cuser.language][2232], SHM->i18nstr[cuser.language][2233], - SHM->i18nstr[cuser.language][2234], SHM->i18nstr[cuser.language][2235], SHM->i18nstr[cuser.language][2236], SHM->i18nstr[cuser.language][2237],/*"ㄔ",*/ SHM->i18nstr[cuser.language][2238], SHM->i18nstr[cuser.language][2239], SHM->i18nstr[cuser.language][2240], SHM->i18nstr[cuser.language][2241], SHM->i18nstr[cuser.language][2242], - SHM->i18nstr[cuser.language][2243], SHM->i18nstr[cuser.language][2244], SHM->i18nstr[cuser.language][2245], SHM->i18nstr[cuser.language][2246], SHM->i18nstr[cuser.language][2247], SHM->i18nstr[cuser.language][2248], SHM->i18nstr[cuser.language][2249], SHM->i18nstr[cuser.language][2250], SHM->i18nstr[cuser.language][2251], SHM->i18nstr[cuser.language][2252], SHM->i18nstr[cuser.language][2253], - SHM->i18nstr[cuser.language][2254], SHM->i18nstr[cuser.language][2255], SHM->i18nstr[cuser.language][2256], SHM->i18nstr[cuser.language][2257], SHM->i18nstr[cuser.language][2258], NULL}; + {I18N[2211], I18N[2212], I18N[2213], I18N[2214], I18N[2215], I18N[2216], I18N[2217], "..", "xx", + I18N[2218], I18N[2219], I18N[2220], I18N[2221], I18N[2222], + I18N[2223], I18N[2224], I18N[2225], I18N[2226], I18N[2227], I18N[2228], I18N[2229], I18N[2230], I18N[2231], I18N[2232], I18N[2233], + I18N[2234], I18N[2235], I18N[2236], I18N[2237],/*"ㄔ",*/ I18N[2238], I18N[2239], I18N[2240], I18N[2241], I18N[2242], + I18N[2243], I18N[2244], I18N[2245], I18N[2246], I18N[2247], I18N[2248], I18N[2249], I18N[2250], I18N[2251], I18N[2252], I18N[2253], + I18N[2254], I18N[2255], I18N[2256], I18N[2257], I18N[2258], NULL}; if( rej != NULL ) for( i = 0 ; rej[i] != NULL ; ++i ) @@ -1027,8 +1027,8 @@ static int HaveRejectStr(char *s, char **rej) if( strstr(s, rejectstr[i]) ) return 1; - if( (ptr = strstr(s, SHM->i18nstr[cuser.language][2259])) != NULL ){ - if( ptr != s && strncmp(ptr - 1, SHM->i18nstr[cuser.language][2260], 4) == 0 ) + if( (ptr = strstr(s, I18N[2259])) != NULL ){ + if( ptr != s && strncmp(ptr - 1, I18N[2260], 4) == 0 ) return 0; return 1; } @@ -1042,20 +1042,20 @@ static char *isvalidname(char *rname) return NULL; #else char *rejectstr[] = - {SHM->i18nstr[cuser.language][2261], SHM->i18nstr[cuser.language][2262], SHM->i18nstr[cuser.language][2263], SHM->i18nstr[cuser.language][2264], SHM->i18nstr[cuser.language][2265], SHM->i18nstr[cuser.language][2266], SHM->i18nstr[cuser.language][2267], SHM->i18nstr[cuser.language][2268], SHM->i18nstr[cuser.language][2269], - SHM->i18nstr[cuser.language][2270], SHM->i18nstr[cuser.language][2271], SHM->i18nstr[cuser.language][2272], SHM->i18nstr[cuser.language][2273], SHM->i18nstr[cuser.language][2274], SHM->i18nstr[cuser.language][2275], SHM->i18nstr[cuser.language][2276], SHM->i18nstr[cuser.language][2277], - SHM->i18nstr[cuser.language][2278], SHM->i18nstr[cuser.language][2279], SHM->i18nstr[cuser.language][2280], SHM->i18nstr[cuser.language][2281], SHM->i18nstr[cuser.language][2282], SHM->i18nstr[cuser.language][2283], SHM->i18nstr[cuser.language][2284], SHM->i18nstr[cuser.language][2285], - SHM->i18nstr[cuser.language][2286], SHM->i18nstr[cuser.language][2287], SHM->i18nstr[cuser.language][2288], SHM->i18nstr[cuser.language][2289], SHM->i18nstr[cuser.language][2290], SHM->i18nstr[cuser.language][2291], + {I18N[2261], I18N[2262], I18N[2263], I18N[2264], I18N[2265], I18N[2266], I18N[2267], I18N[2268], I18N[2269], + I18N[2270], I18N[2271], I18N[2272], I18N[2273], I18N[2274], I18N[2275], I18N[2276], I18N[2277], + I18N[2278], I18N[2279], I18N[2280], I18N[2281], I18N[2282], I18N[2283], I18N[2284], I18N[2285], + I18N[2286], I18N[2287], I18N[2288], I18N[2289], I18N[2290], I18N[2291], NULL}; if( removespace(rname) && rname[0] < 0 && strlen(rname) >= 4 && !HaveRejectStr(rname, rejectstr) && - strncmp(rname, SHM->i18nstr[cuser.language][2292], 2) != 0 && //起頭是「小」 - strncmp(rname, SHM->i18nstr[cuser.language][2293], 4) != 0 && //起頭是「我是」 - !(strlen(rname) == 4 && strncmp(&rname[2], SHM->i18nstr[cuser.language][2294], 2) == 0) && + strncmp(rname, I18N[2292], 2) != 0 && //起頭是「小」 + strncmp(rname, I18N[2293], 4) != 0 && //起頭是「我是」 + !(strlen(rname) == 4 && strncmp(&rname[2], I18N[2294], 2) == 0) && !(strlen(rname) >= 4 && strncmp(&rname[0], &rname[2], 2) == 0)) return NULL; - return SHM->i18nstr[cuser.language][2295]; + return I18N[2295]; #endif } @@ -1065,14 +1065,14 @@ static char *isvalidcareer(char *career) #ifndef FOREIGN_REG char *rejectstr[] = {NULL}; if (!(removespace(career) && career[0] < 0 && strlen(career) >= 6) || - strcmp(career, SHM->i18nstr[cuser.language][2296]) == 0 || HaveRejectStr(career, rejectstr) ) - return SHM->i18nstr[cuser.language][2297]; - if (strcmp(&career[strlen(career) - 2], SHM->i18nstr[cuser.language][2298]) == 0 || - strcmp(&career[strlen(career) - 4], SHM->i18nstr[cuser.language][2299]) == 0 || - strcmp(career, SHM->i18nstr[cuser.language][2300]) == 0) - return SHM->i18nstr[cuser.language][2301]; - if (strcmp(career, SHM->i18nstr[cuser.language][2302]) == 0) - return SHM->i18nstr[cuser.language][2303]; + strcmp(career, I18N[2296]) == 0 || HaveRejectStr(career, rejectstr) ) + return I18N[2297]; + if (strcmp(&career[strlen(career) - 2], I18N[2298]) == 0 || + strcmp(&career[strlen(career) - 4], I18N[2299]) == 0 || + strcmp(career, I18N[2300]) == 0) + return I18N[2301]; + if (strcmp(career, I18N[2302]) == 0) + return I18N[2303]; #endif return NULL; } @@ -1081,23 +1081,23 @@ static char *isvalidaddr(char *addr) { #ifndef FOREIGN_REG char *rejectstr[] = - {SHM->i18nstr[cuser.language][2304], SHM->i18nstr[cuser.language][2305], SHM->i18nstr[cuser.language][2306], NULL}; + {I18N[2304], I18N[2305], I18N[2306], NULL}; if (!removespace(addr) || addr[0] > 0 || strlen(addr) < 15) - return SHM->i18nstr[cuser.language][2307]; - if (strstr(addr, SHM->i18nstr[cuser.language][2308]) != NULL || strstr(addr, SHM->i18nstr[cuser.language][2309]) != NULL) - return SHM->i18nstr[cuser.language][2310]; - if ((strstr(addr, SHM->i18nstr[cuser.language][2311]) == NULL && strstr(addr, SHM->i18nstr[cuser.language][2312]) == NULL && - strstr(addr, SHM->i18nstr[cuser.language][2313]) == NULL && strstr(addr, SHM->i18nstr[cuser.language][2314]) == NULL) || + return I18N[2307]; + if (strstr(addr, I18N[2308]) != NULL || strstr(addr, I18N[2309]) != NULL) + return I18N[2310]; + if ((strstr(addr, I18N[2311]) == NULL && strstr(addr, I18N[2312]) == NULL && + strstr(addr, I18N[2313]) == NULL && strstr(addr, I18N[2314]) == NULL) || HaveRejectStr(addr, rejectstr) || - strcmp(&addr[strlen(addr) - 2], SHM->i18nstr[cuser.language][2315]) == 0 || - strcmp(&addr[strlen(addr) - 2], SHM->i18nstr[cuser.language][2316]) == 0 || - strcmp(&addr[strlen(addr) - 2], SHM->i18nstr[cuser.language][2317]) == 0 || - strcmp(&addr[strlen(addr) - 2], SHM->i18nstr[cuser.language][2318]) == 0 || - strcmp(&addr[strlen(addr) - 2], SHM->i18nstr[cuser.language][2319]) == 0 || - strcmp(&addr[strlen(addr) - 2], SHM->i18nstr[cuser.language][2320]) == 0 || - strcmp(&addr[strlen(addr) - 2], SHM->i18nstr[cuser.language][2321]) == 0 ) - return SHM->i18nstr[cuser.language][2322]; + strcmp(&addr[strlen(addr) - 2], I18N[2315]) == 0 || + strcmp(&addr[strlen(addr) - 2], I18N[2316]) == 0 || + strcmp(&addr[strlen(addr) - 2], I18N[2317]) == 0 || + strcmp(&addr[strlen(addr) - 2], I18N[2318]) == 0 || + strcmp(&addr[strlen(addr) - 2], I18N[2319]) == 0 || + strcmp(&addr[strlen(addr) - 2], I18N[2320]) == 0 || + strcmp(&addr[strlen(addr) - 2], I18N[2321]) == 0 ) + return I18N[2322]; #endif return NULL; } @@ -1107,12 +1107,12 @@ static char *isvalidphone(char *phone) int i; for( i = 0 ; phone[i] != 0 ; ++i ) if( !isdigit(phone[i]) ) - return SHM->i18nstr[cuser.language][2323]; + return I18N[2323]; if (!removespace(phone) || strlen(phone) < 9 || strstr(phone, "00000000") != NULL || strstr(phone, "22222222") != NULL ) { - return SHM->i18nstr[cuser.language][2324] ; + return I18N[2324] ; } return NULL; } @@ -1132,7 +1132,7 @@ u_register(void) FILE *fn; if (cuser.userlevel & PERM_LOGINOK) { - outs(SHM->i18nstr[cuser.language][2325]); + outs(I18N[2325]); return XEASY; } if ((fn = fopen(fn_register, "r"))) { @@ -1142,7 +1142,7 @@ u_register(void) if (strncmp(genbuf, "uid: ", 5) == 0 && strcmp(genbuf + 5, cuser.userid) == 0) { fclose(fn); - outs(SHM->i18nstr[cuser.language][2326]); + outs(I18N[2326]); return XEASY; } } @@ -1179,7 +1179,7 @@ u_register(void) } if (cuser.userlevel & PERM_NOREGCODE) { - vmsg(SHM->i18nstr[cuser.language][2327]); + vmsg(I18N[2327]); goto REGFORM; } @@ -1187,33 +1187,33 @@ u_register(void) strcmp(cuser.email, "x") != 0 && /* 上次手動認證失敗 */ strcmp(cuser.email, "X") != 0) { clear(); - stand_title(SHM->i18nstr[cuser.language][2328]); + stand_title(I18N[2328]); move(2, 0); - prints(SHM->i18nstr[cuser.language][2329], + prints(I18N[2329], cuser.userid, cuser.username); inregcode[0] = 0; do{ - getdata(10, 0, SHM->i18nstr[cuser.language][2330], inregcode, sizeof(inregcode), DOECHO); + getdata(10, 0, I18N[2330], inregcode, sizeof(inregcode), DOECHO); if( strcmp(inregcode, "x") == 0 || strcmp(inregcode, "X") == 0 || strlen(inregcode) == 13 ) break; if( strlen(inregcode) != 13 ) - vmsg(SHM->i18nstr[cuser.language][2331]); + vmsg(I18N[2331]); } while( 1 ); if (strcmp(inregcode, getregcode(regcode)) == 0) { int unum; if ((unum = getuser(cuser.userid)) == 0) { - vmsg(SHM->i18nstr[cuser.language][2332]); + vmsg(I18N[2332]); u_exit("getuser error"); exit(0); } - mail_muser(cuser, SHM->i18nstr[cuser.language][2333], "etc/registeredmail"); + mail_muser(cuser, I18N[2333], "etc/registeredmail"); if(cuser.uflag2 & FOREIGN) - mail_muser(cuser, SHM->i18nstr[cuser.language][2334], "etc/foreign_welcome"); + mail_muser(cuser, I18N[2334], "etc/foreign_welcome"); cuser.userlevel |= (PERM_LOGINOK | PERM_POST); - prints(SHM->i18nstr[cuser.language][2335]); + prints(I18N[2335]); sethomefile(genbuf, cuser.userid, "justify.wait"); unlink(genbuf); pressanykey(); @@ -1222,7 +1222,7 @@ u_register(void) return QUIT; } else if (strcmp(inregcode, "x") != 0 && strcmp(inregcode, "X") != 0) { - vmsg(SHM->i18nstr[cuser.language][2336]); + vmsg(I18N[2336]); } else { toregister(email, genbuf, phone, career, ident, rname, addr, mobile); @@ -1231,7 +1231,7 @@ u_register(void) } REGFORM: - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2337], + getdata(b_lines - 1, 0, I18N[2337], ans, 3, LCECHO); if (ans[0] != 'y') return FULLUPDATE; @@ -1241,12 +1241,12 @@ u_register(void) while (1) { clear(); move(1, 0); - prints(SHM->i18nstr[cuser.language][2338], + prints(I18N[2338], cuser.userid, cuser.username); #ifdef FOREIGN_REG fore[0] = 'y'; fore[1] = 0; - getfield(2, "Y/n", SHM->i18nstr[cuser.language][2339], fore, 2); + getfield(2, "Y/n", I18N[2339], fore, 2); if (fore[0] == 'n') fore[0] |= FOREIGN; else @@ -1254,43 +1254,43 @@ u_register(void) if (!fore[0]){ #endif while( 1 ){ - getfield(3, "D123456789", SHM->i18nstr[cuser.language][2340], ident, 11); + getfield(3, "D123456789", I18N[2340], ident, 11); if ('a' <= ident[0] && ident[0] <= 'z') ident[0] -= 32; if( ispersonalid(ident) ) break; - vmsg(SHM->i18nstr[cuser.language][2341]); + vmsg(I18N[2341]); } #ifdef FOREIGN_REG } else{ int i; while( 1 ){ - getfield(4, "0123456789",SHM->i18nstr[cuser.language][2342], ident, 11); + getfield(4, "0123456789",I18N[2342], ident, 11); move(6, 2); - prints(SHM->i18nstr[cuser.language][2343]); - getdata(7, 2, SHM->i18nstr[cuser.language][2344], ans, 3, LCECHO); + prints(I18N[2343]); + getdata(7, 2, I18N[2344], ans, 3, LCECHO); if (ans[0] == 'y' || ans[0] == 'Y') break; - vmsg(SHM->i18nstr[cuser.language][2345]); + vmsg(I18N[2345]); } for(i = 0; ans[i] != 0; i++) if ('a' <= ident[0] && ident[0] <= 'z') ident[0] -= 32; if( ispersonalid(ident) ){ fore[0] = 0; - vmsg(SHM->i18nstr[cuser.language][2346]); + vmsg(I18N[2346]); } } #endif while (1) { getfield(8, #ifdef FOREIGN_REG - SHM->i18nstr[cuser.language][2347], + I18N[2347], #else - SHM->i18nstr[cuser.language][2348], + I18N[2348], #endif - SHM->i18nstr[cuser.language][2349], rname, 20); + I18N[2349], rname, 20); if( (errcode = isvalidname(rname)) == NULL ) break; else @@ -1298,19 +1298,19 @@ u_register(void) } move(11, 0); - prints(SHM->i18nstr[cuser.language][2350] + prints(I18N[2350] ); while (1) { - getfield(9, SHM->i18nstr[cuser.language][2351], - SHM->i18nstr[cuser.language][2352], career, 40); + getfield(9, I18N[2351], + I18N[2352], career, 40); if( (errcode = isvalidcareer(career)) == NULL ) break; else vmsg(errcode); } while (1) { - getfield(11, SHM->i18nstr[cuser.language][2353], - SHM->i18nstr[cuser.language][2354], addr, 50); + getfield(11, I18N[2353], + I18N[2354], addr, 50); if( (errcode = isvalidaddr(addr)) == NULL #ifdef FOREIGN_REG && fore[0] == 0 @@ -1321,18 +1321,18 @@ u_register(void) vmsg(errcode); } while (1) { - getfield(13, SHM->i18nstr[cuser.language][2355], SHM->i18nstr[cuser.language][2356], phone, 11); + getfield(13, I18N[2355], I18N[2356], phone, 11); if( (errcode = isvalidphone(phone)) == NULL ) break; else vmsg(errcode); } - getfield(15, SHM->i18nstr[cuser.language][2357], - SHM->i18nstr[cuser.language][2358], mobile, 20); + getfield(15, I18N[2357], + I18N[2358], mobile, 20); while (1) { int len; - getfield(17, SHM->i18nstr[cuser.language][2359], SHM->i18nstr[cuser.language][2360], birthday, 9); + getfield(17, I18N[2359], I18N[2360], birthday, 9); len = strlen(birthday); if (!len) { snprintf(birthday, 9, "%02i/%02i/%02i", @@ -1345,18 +1345,18 @@ u_register(void) day = (birthday[3] - '0') * 10 + (birthday[4] - '0'); year = (birthday[6] - '0') * 10 + (birthday[7] - '0'); } else{ - vmsg(SHM->i18nstr[cuser.language][2361]); + vmsg(I18N[2361]); continue; } if (mon > 12 || mon < 1 || day > 31 || day < 1 || year > 90 || year < 40){ - vmsg(SHM->i18nstr[cuser.language][2362]); + vmsg(I18N[2362]); continue; } break; } - getfield(19, SHM->i18nstr[cuser.language][2363], SHM->i18nstr[cuser.language][2364], sex_is, 2); - getdata(20, 0, SHM->i18nstr[cuser.language][2365], + getfield(19, I18N[2363], I18N[2364], sex_is, 2); + getdata(20, 0, I18N[2365], ans, 3, LCECHO); if (ans[0] == 'q') return 0; @@ -1386,7 +1386,7 @@ u_register(void) clear(); move(9, 3); - prints(SHM->i18nstr[cuser.language][2366]); + prints(I18N[2366]); pressanykey(); cuser.userlevel |= PERM_POST; brc_initial_board("WhoAmI"); @@ -1410,9 +1410,9 @@ u_list_CB(int num, userec_t * uentp) if (uentp == NULL) { move(2, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][2367], - SHM->i18nstr[cuser.language][2368], - HAS_PERM(PERM_SEEULEVELS) ? SHM->i18nstr[cuser.language][2369] : ""); + prints(I18N[2367], + I18N[2368], + HAS_PERM(PERM_SEEULEVELS) ? I18N[2369] : ""); i = 3; return 0; } @@ -1423,7 +1423,7 @@ u_list_CB(int num, userec_t * uentp) return 0; if (i == b_lines) { - prints(SHM->i18nstr[cuser.language][2370], + prints(I18N[2370], usercounter, totalusers, usercounter * 100 / totalusers); i = igetch(); if (i == 'q' || i == 'Q') @@ -1477,7 +1477,7 @@ u_list() u_list_special = usercounter = 0; totalusers = SHM->number; if (HAS_PERM(PERM_SEEULEVELS)) { - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2371], + getdata(b_lines - 1, 0, I18N[2371], genbuf, 3, DOECHO); if (genbuf[0] != '2') u_list_special = PERM_BASIC | PERM_CHAT | PERM_PAGE | PERM_POST | PERM_LOGINOK | PERM_BM; @@ -1489,7 +1489,7 @@ u_list() } move(b_lines, 0); clrtoeol(); - prints(SHM->i18nstr[cuser.language][2372], usercounter, totalusers); + prints(I18N[2372], usercounter, totalusers); igetch(); return 0; } diff --git a/mbbsd/vice.c b/mbbsd/vice.c index e774479c..d1a3fb9e 100644 --- a/mbbsd/vice.c +++ b/mbbsd/vice.c @@ -1,4 +1,4 @@ -/* $Id: vice.c,v 1.9 2003/06/28 08:49:26 kcwu Exp $ */ +/* $Id$ */ #include "bbs.h" #define VICE_PLAY BBSHOME "/etc/vice/vice.play" @@ -106,7 +106,7 @@ vice_main() i = 0; move(10, 24); clrtoeol(); - prints("這一期的發票號碼"); + prints(SHM->i18nstr[cuser.language][2373]); while (fgets(serial, 15, fd)) { if ((ptr = strchr(serial, '\r'))) *ptr = 0; @@ -119,27 +119,27 @@ vice_main() j += 9; j %= 45; } - getdata(8, 0, "按'c'開始對獎了(或是任意鍵離開)): ", + getdata(8, 0, SHM->i18nstr[cuser.language][2374], ch, sizeof(ch), LCECHO); if (ch[0] != 'c' || lockutmpmode(VICE, LOCK_MULTI)) { fclose(fd); return 0; } - showtitle("發票對獎", BBSNAME); + showtitle(SHM->i18nstr[cuser.language][2375], BBSNAME); rewind(fd); while (fgets(serial, 15, fd)) { if ((ptr = strchr(serial, '\n'))) *ptr = 0; money = TABLE[check(tbingo, serial)]; total += money; - prints("%s 中了 %d\n", serial, money); + prints(SHM->i18nstr[cuser.language][2376], serial, money); } pressanykey(); if (total > 0) { ran_showmfile(VICE_WIN, MAX_WIN_PICTURE); move(22, 0); clrtoeol(); - prints("全部的發票中了 %d 塊錢\n", total); + prints(SHM->i18nstr[cuser.language][2377], total); demoney(total); } else ran_showmfile(VICE_LOST, MAX_LOST_PICTURE); diff --git a/mbbsd/vote.c b/mbbsd/vote.c index 86e9f41e..e342e2f8 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -162,8 +162,8 @@ vote_report(char *bname, char *fname, char *fpath) /* append record to .DIR */ memset(&header, 0, sizeof(fileheader_t)); - strlcpy(header.owner, SHM->i18nstr[cuser.language][2378], sizeof(header.owner)); - snprintf(header.title, sizeof(header.title), SHM->i18nstr[cuser.language][2379], bname); + strlcpy(header.owner, I18N[2378], sizeof(header.owner)); + snprintf(header.title, sizeof(header.title), I18N[2379], bname); { register struct tm *ptime = localtime(&dtime); @@ -261,10 +261,10 @@ b_result_one(boardheader_t * fh, int ind, int *total) if ((xfp = fopen(buf, "r"))) { fgets(inbuf, sizeof(inbuf), xfp); - fprintf(tfp, SHM->i18nstr[cuser.language][2380], msg_seperator, inbuf); + fprintf(tfp, I18N[2380], msg_seperator, inbuf); fclose(xfp); } - fprintf(tfp, SHM->i18nstr[cuser.language][2381], + fprintf(tfp, I18N[2381], msg_seperator, ctime(&closetime)); fh->vtime = now; @@ -276,13 +276,13 @@ b_result_one(boardheader_t * fh, int ind, int *total) if ((cfp = fopen(b_control, "r"))) { fgets(inbuf, sizeof(inbuf), cfp); fgets(inbuf, sizeof(inbuf), cfp); - fprintf(tfp, SHM->i18nstr[cuser.language][2382], + fprintf(tfp, I18N[2382], people_num, junk); - fprintf(tfp, SHM->i18nstr[cuser.language][2383]); + fprintf(tfp, I18N[2383]); for (junk = 0; junk < item_num; junk++) { fgets(inbuf, sizeof(inbuf), cfp); inbuf[(strlen(inbuf) - 1)] = '\0'; - fprintf(tfp, SHM->i18nstr[cuser.language][2384], inbuf + 3, counts[junk], + fprintf(tfp, I18N[2384], inbuf + 3, counts[junk], (float)(counts[junk] * 100) / (float)(people_num), (float)(counts[junk] * 100) / (float)(*total)); } @@ -291,12 +291,12 @@ b_result_one(boardheader_t * fh, int ind, int *total) unlink(b_control); free(counts); - fprintf(tfp, SHM->i18nstr[cuser.language][2385], msg_seperator); + fprintf(tfp, I18N[2385], msg_seperator); setbfile(buf, bname, STR_new_comments); b_suckinfile(tfp, buf); unlink(buf); - fprintf(tfp, SHM->i18nstr[cuser.language][2386], msg_seperator, *total); + fprintf(tfp, I18N[2386], msg_seperator, *total); fclose(tfp); setbfile(b_report, bname, "report"); @@ -437,7 +437,7 @@ vote_view(char *bname, int vote_index) if ((fp = fopen(buf, "r"))) { fgets(inbuf, sizeof(inbuf), fp); - prints(SHM->i18nstr[cuser.language][2387], inbuf); + prints(I18N[2387], inbuf); fclose(fp); } setbfile(buf, bname, STR_new_control); @@ -449,12 +449,12 @@ vote_view(char *bname, int vote_index) fscanf(fp, "%hd,%hd\n%lu\n", &item_num, &i, &closetime); counts = (int *)malloc(item_num * sizeof(int)); - prints(SHM->i18nstr[cuser.language][2388], atoi(inbuf), (num / sizeof(short)), + prints(I18N[2388], atoi(inbuf), (num / sizeof(short)), ctime(&closetime)); /* Thor: 開放 票數 預知 */ setbfile(buf, bname, STR_new_flags); - prints(SHM->i18nstr[cuser.language][2389], b_nonzeroNum(buf)); + prints(I18N[2389], b_nonzeroNum(buf)); setbfile(buf, bname, STR_new_ballots); #if 0 // backward compatible @@ -471,7 +471,7 @@ vote_view(char *bname, int vote_index) inbuf[(strlen(inbuf) - 1)] = '\0'; inbuf[30] = '\0'; /* truncate */ move(num % 15 + 6, num / 15 * 40); - prints(SHM->i18nstr[cuser.language][2390], inbuf, counts[i]); + prints(I18N[2390], inbuf, counts[i]); total += counts[i]; if (num == 29) { num = -1; @@ -485,8 +485,8 @@ vote_view(char *bname, int vote_index) pos = getbnum(bname); fhp = bcache + pos - 1; move(t_lines - 3, 0); - prints(SHM->i18nstr[cuser.language][2391], total); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2392], genbuf, + prints(I18N[2391], total); + getdata(b_lines - 1, 0, I18N[2392], genbuf, 4, LCECHO); if (genbuf[0] == 'a') { setbfile(buf, bname, STR_new_control); @@ -543,7 +543,7 @@ vote_view_all(char *bname) fgets(inbuf, sizeof(inbuf), xfp); fclose(xfp); } else - strlcpy(inbuf, SHM->i18nstr[cuser.language][2393], sizeof(inbuf)); + strlcpy(inbuf, I18N[2393], sizeof(inbuf)); prints("%s\n", inbuf); } for (i = 1; i < 20; i++) { @@ -562,14 +562,14 @@ vote_view_all(char *bname) fgets(inbuf, sizeof(inbuf), xfp); fclose(xfp); } else - strlcpy(inbuf, SHM->i18nstr[cuser.language][2394], sizeof(inbuf)); + strlcpy(inbuf, I18N[2394], sizeof(inbuf)); prints("%s\n", inbuf); } } if (x < 0) return FULLUPDATE; - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][2395], x); + snprintf(buf, sizeof(buf), I18N[2395], x); getdata(b_lines - 1, 0, buf, genbuf, 4, LCECHO); @@ -605,13 +605,13 @@ vote_maintain(char *bname) if ((pos = getbnum(bname)) <= 0) return 0; - stand_title(SHM->i18nstr[cuser.language][2396]); + stand_title(I18N[2396]); fhp = bcache + pos - 1; /* CharlieL */ if (fhp->bvote != 2 && fhp->bvote != 0) { getdata(b_lines - 1, 0, - SHM->i18nstr[cuser.language][2397], + I18N[2397], genbuf, 4, LCECHO); if (genbuf[0] == 'v') return vote_view_all(bname); @@ -698,22 +698,22 @@ vote_maintain(char *bname) } clear(); move(0, 0); - prints(SHM->i18nstr[cuser.language][2398], x); + prints(I18N[2398], x); setbfile(buf, bname, STR_new_title); - getdata(4, 0, SHM->i18nstr[cuser.language][2399], inbuf, 50, LCECHO); + getdata(4, 0, I18N[2399], inbuf, 50, LCECHO); if (inbuf[0] == '\0') - strlcpy(inbuf, SHM->i18nstr[cuser.language][2400], sizeof(inbuf)); + strlcpy(inbuf, I18N[2400], sizeof(inbuf)); fp = fopen(buf, "w"); assert(fp); fprintf(fp, "%s", inbuf); fclose(fp); - prints(SHM->i18nstr[cuser.language][2401]); + prints(I18N[2401]); pressanykey(); setbfile(buf, bname, STR_new_desc); aborted = vedit(buf, NA, NULL); if (aborted == -1) { - vmsg(SHM->i18nstr[cuser.language][2402]); + vmsg(I18N[2402]); return FULLUPDATE; } aborted = 0; @@ -721,13 +721,13 @@ vote_maintain(char *bname) unlink(buf); getdata(4, 0, - SHM->i18nstr[cuser.language][2403], + I18N[2403], inbuf, 2, LCECHO); setbfile(buf, bname, STR_new_limited); if (inbuf[0] == 'y') { fp = fopen(buf, "w"); assert(fp); - //fprintf(fp, SHM->i18nstr[cuser.language][2404]); + //fprintf(fp, I18N[2404]); fclose(fp); friend_edit(FRIEND_CANVOTE); } else { @@ -735,7 +735,7 @@ vote_maintain(char *bname) unlink(buf); } clear(); - getdata(0, 0, SHM->i18nstr[cuser.language][2405], inbuf, 4, DOECHO); + getdata(0, 0, I18N[2405], inbuf, 4, DOECHO); closetime = atoi(inbuf); if (closetime <= 0) @@ -749,7 +749,7 @@ vote_maintain(char *bname) assert(fp); fprintf(fp, "000,000\n%lu\n", closetime); - outs(SHM->i18nstr[cuser.language][2406]); + outs(I18N[2406]); num = 0; x = 0; /* x is the page number */ while (!aborted) { @@ -774,7 +774,7 @@ vote_maintain(char *bname) num = 0; } } - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][2407], x * 30 + num); + snprintf(buf, sizeof(buf), I18N[2407], x * 30 + num); getdata(t_lines - 3, 0, buf, inbuf, 3, DOECHO); @@ -799,7 +799,7 @@ vote_maintain(char *bname) if (substitute_record(fn_board, fhp, sizeof(*fhp), pos) == -1) outs(err_board_update); reset_board(pos); - outs(SHM->i18nstr[cuser.language][2408]); + outs(I18N[2408]); return FULLUPDATE; } @@ -872,22 +872,22 @@ user_vote_one(char *bname, int ind) setbfile(buf, bname, FN_CANVOTE); if (!belong(buf, cuser.userid)) { fclose(cfp); - vmsg(SHM->i18nstr[cuser.language][2409]); + vmsg(I18N[2409]); return FULLUPDATE; } else { - vmsg(SHM->i18nstr[cuser.language][2410]); + vmsg(I18N[2410]); more(buf, YEA); } } if (vote_flag(bname, ind, '\0')) { - vmsg(SHM->i18nstr[cuser.language][2411]); + vmsg(I18N[2411]); return FULLUPDATE; } setutmpmode(VOTING); setbfile(buf, bname, STR_new_desc); more(buf, YEA); - stand_title(SHM->i18nstr[cuser.language][2412]); + stand_title(I18N[2412]); if ((pos = getbnum(bname)) <= 0) return 0; @@ -903,7 +903,7 @@ user_vote_one(char *bname, int ind) memset(choices, 0, sizeof(choices)); max_page = (item_num - 1)/ 30 + 1; - prints(SHM->i18nstr[cuser.language][2413], + prints(I18N[2413], tickets, ctime(&closetime)); #define REDO_DRAW 1 @@ -938,14 +938,14 @@ user_vote_one(char *bname, int ind) vote[0] = vote[1] = '\0'; move(t_lines - 2, 0); - prints(SHM->i18nstr[cuser.language][2414], tickets - i); - getdata(t_lines - 4, 0, SHM->i18nstr[cuser.language][2415], vote, sizeof(vote), DOECHO); + prints(I18N[2414], tickets - i); + getdata(t_lines - 4, 0, I18N[2415], vote, sizeof(vote), DOECHO); *vote = toupper(*vote); #define CURRENT_CHOICE \ chosen[curr_page * 30 + vote[0] - 'A'] if (vote[0] == '0' || (!vote[0] && !i)) { - outs(SHM->i18nstr[cuser.language][2416]); + outs(I18N[2416]); break; } else if (vote[0] == '1' && i); else if (!vote[0]) @@ -987,11 +987,11 @@ user_vote_one(char *bname, int ind) } if (vote_flag(bname, ind, vote[0]) != 0) - prints(SHM->i18nstr[cuser.language][2417]); + prints(I18N[2417]); else { setbfile(buf, bname, STR_new_ballots); if ((fd = open(buf, O_WRONLY | O_CREAT | O_APPEND, 0600)) == 0) - outs(SHM->i18nstr[cuser.language][2418]); + outs(I18N[2418]); else { struct stat statb; char buf[3], mycomments[3][74], b_comments[80]; @@ -1008,18 +1008,18 @@ user_vote_one(char *bname, int ind) fstat(fd, &statb); close(fd); getdata(b_lines - 2, 0, - SHM->i18nstr[cuser.language][2419], + I18N[2419], buf, 3, DOECHO); if (buf[0] == 'Y' || buf[0] == 'y') { do { move(5, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][2420]); + outs(I18N[2420]); for (i = 0; (i < 3) && - getdata(7 + i, 0, SHM->i18nstr[cuser.language][2421], + getdata(7 + i, 0, I18N[2421], mycomments[i], sizeof(mycomments[i]), DOECHO); i++); - getdata(b_lines - 2, 0, SHM->i18nstr[cuser.language][2422], buf, 3, LCECHO); + getdata(b_lines - 2, 0, I18N[2422], buf, 3, LCECHO); } while (buf[0] == 'E' || buf[0] == 'e'); if (buf[0] == 'Q' || buf[0] == 'q') break; @@ -1027,7 +1027,7 @@ user_vote_one(char *bname, int ind) if (mycomments[0]) if ((fcm = fopen(b_comments, "a"))) { fprintf(fcm, - SHM->i18nstr[cuser.language][2423], + I18N[2423], cuser.userid); for (i = 0; i < 3; i++) fprintf(fcm, " %s\n", mycomments[i]); @@ -1036,7 +1036,7 @@ user_vote_one(char *bname, int ind) } } move(b_lines - 1, 0); - prints(SHM->i18nstr[cuser.language][2424]); + prints(I18N[2424]); } } break; @@ -1067,11 +1067,11 @@ user_vote(char *bname) clrtobot(); if (fhp->bvote == 2 || fhp->bvote == 0) { - vmsg(SHM->i18nstr[cuser.language][2425]); + vmsg(I18N[2425]); return FULLUPDATE; } if (!HAS_PERM(PERM_LOGINOK)) { - vmsg(SHM->i18nstr[cuser.language][2426]); + vmsg(I18N[2426]); return FULLUPDATE; } strlcpy(STR_new_control, STR_bv_control, sizeof(STR_new_control)); @@ -1088,7 +1088,7 @@ user_vote(char *bname) fgets(inbuf, sizeof(inbuf), xfp); fclose(xfp); } else - strlcpy(inbuf, SHM->i18nstr[cuser.language][2427], sizeof(inbuf)); + strlcpy(inbuf, I18N[2427], sizeof(inbuf)); prints("%s\n", inbuf); } for (i = 1; i < 20; i++) { @@ -1107,7 +1107,7 @@ user_vote(char *bname) fgets(inbuf, sizeof(inbuf), xfp); fclose(xfp); } else - strlcpy(inbuf, SHM->i18nstr[cuser.language][2428], sizeof(inbuf)); + strlcpy(inbuf, I18N[2428], sizeof(inbuf)); prints("%s\n", inbuf); } } @@ -1115,7 +1115,7 @@ user_vote(char *bname) if (x < 0) return FULLUPDATE; - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][2429], x); + snprintf(buf, sizeof(buf), I18N[2429], x); getdata(b_lines - 1, 0, buf, genbuf, 4, LCECHO); @@ -1145,7 +1145,7 @@ vote_results(char *bname) setbfile(buf, bname, STR_bv_results); if (more(buf, YEA) == -1) - vmsg(SHM->i18nstr[cuser.language][2430]); + vmsg(I18N[2430]); return FULLUPDATE; } diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index 3890df2a..d2d568c5 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -22,7 +22,7 @@ do_voteboardreply(fileheader_t * fhdr) clear(); if (!CheckPostPerm()) { move(5, 10); - prints("對不起,您目前無法在此發表文章!"); + prints(SHM->i18nstr[cuser.language][2457]); pressanykey(); return; } @@ -48,12 +48,12 @@ do_voteboardreply(fileheader_t * fhdr) } if (yes>3) prints(genbuf); - if (!strncmp(genbuf, "連署結束時間", 12)) { + if (!strncmp(genbuf, SHM->i18nstr[cuser.language][2458], 12)) { ptr = strchr(genbuf, '('); assert(ptr); sscanf(ptr + 1, "%ld", &endtime); if (endtime < now) { - prints("連署時間已過"); + prints(SHM->i18nstr[cuser.language][2459]); pressanykey(); fclose(fi); return; @@ -64,8 +64,8 @@ do_voteboardreply(fileheader_t * fhdr) strtok(genbuf+4," \n"); if (!strncmp(genbuf + 4, cuser.userid, IDLEN)) { move(5, 10); - prints("您已經連署過本篇了"); - getdata(17, 0, "要修改您之前的連署嗎?(Y/N) [N]", opnion, 3, LCECHO); + prints(SHM->i18nstr[cuser.language][2460]); + getdata(17, 0, SHM->i18nstr[cuser.language][2461], opnion, 3, LCECHO); if (opnion[0] != 'y') { fclose(fi); return; @@ -76,12 +76,12 @@ do_voteboardreply(fileheader_t * fhdr) } fclose(fi); do { - if (!getdata(19, 0, "請問您 (Y)支持 (N)反對 這個議題:", opnion, 3, LCECHO)) { + if (!getdata(19, 0, SHM->i18nstr[cuser.language][2462], opnion, 3, LCECHO)) { return; } } while (opnion[0] != 'y' && opnion[0] != 'n'); - sprintf(genbuf, "請問您與這個議題的關係或%s理由為何:", - opnion[0] == 'y' ? "支持" : "反對"); + sprintf(genbuf, SHM->i18nstr[cuser.language][2463], + opnion[0] == 'y' ? SHM->i18nstr[cuser.language][2464] : SHM->i18nstr[cuser.language][2465]); if (!getdata_buf(20, 0, genbuf, reason, 35, DOECHO)) { return; } @@ -107,7 +107,7 @@ do_voteboardreply(fileheader_t * fhdr) } if (!endtime) { now += 14 * 24 * 60 * 60; - fprintf(fo, "連署結束時間: (%ld)%s", now, ctime(&now)); + fprintf(fo, SHM->i18nstr[cuser.language][2466], now, ctime(&now)); now -= 14 * 24 * 60 * 60; } fprintf(fo, "%s", genbuf); @@ -120,7 +120,7 @@ do_voteboardreply(fileheader_t * fhdr) fprintf(fo, "%3d.%s", ++yes, genbuf + 4); } if (opnion[0] == 'y') - fprintf(fo, "%3d.%-15s%-34s 來源:%s\n", ++yes, cuser.userid, reason, cuser.lasthost); + fprintf(fo, SHM->i18nstr[cuser.language][2467], ++yes, cuser.userid, reason, cuser.lasthost); fprintf(fo, "%s", genbuf); for(no=0; fgets(genbuf, sizeof(genbuf), fi);) { @@ -131,11 +131,11 @@ do_voteboardreply(fileheader_t * fhdr) fprintf(fo, "%3d.%s", ++no, genbuf + 4); } if (opnion[0] == 'n') - fprintf(fo, "%3d.%-15s%-34s 來源:%s\n", ++no, cuser.userid, reason, cuser.lasthost); - fprintf(fo, "----------總計----------\n"); - fprintf(fo, "支持人數:%-9d反對人數:%-9d\n", yes, no); - fprintf(fo, "\n--\n※ 發信站 :" BBSNAME "(" MYHOSTNAME - ") \n◆ From: 連署文章\n"); + fprintf(fo, SHM->i18nstr[cuser.language][2468], ++no, cuser.userid, reason, cuser.lasthost); + fprintf(fo, SHM->i18nstr[cuser.language][2469]); + fprintf(fo, SHM->i18nstr[cuser.language][2470], yes, no); + fprintf(fo, "%s"BBSNAME"("MYHOSTNAME"%s", SHM->i18nstr[cuser.language][2471], + SHM->i18nstr[cuser.language][2472]); flock(fd, LOCK_UN); close(fd); @@ -159,176 +159,176 @@ do_voteboard(int type) clear(); if (!CheckPostPerm()) { move(5, 10); - prints("對不起,您目前無法在此發表文章!"); + prints(SHM->i18nstr[cuser.language][2473]); pressanykey(); return FULLUPDATE; } move(0, 0); clrtobot(); - prints("您正在使用 PTT 的連署系統\n"); - prints("本連署系統將詢問您一些問題,請小心回答才能開始連署\n"); - prints("任意提出連署案者,將被列入不受歡迎使用者喔\n"); + prints(SHM->i18nstr[cuser.language][2474]); + prints(SHM->i18nstr[cuser.language][2475]); + prints(SHM->i18nstr[cuser.language][2476]); move(4, 0); clrtobot(); - prints("(1)活動連署 (2)記名公投 "); + prints(SHM->i18nstr[cuser.language][2477]); if(type==0) - prints("(3)申請新板 (4)廢除舊板 (5)連署板主 \n(6)罷免板主 (7)連署小組長 (8)罷免小組長 (9)申請新群組\n"); + prints(SHM->i18nstr[cuser.language][2478]); do { - getdata(6, 0, "請輸入連署類別 [0:取消]:", topic, 3, DOECHO); + getdata(6, 0, SHM->i18nstr[cuser.language][2479], topic, 3, DOECHO); temp = atoi(topic); } while (temp < 0 || temp > 9 || (type && temp>2)); switch (temp) { case 0: return FULLUPDATE; case 1: - if (!getdata(7, 0, "請輸入活動主題:", topic, 30, DOECHO)) + if (!getdata(7, 0, SHM->i18nstr[cuser.language][2480], topic, 30, DOECHO)) return FULLUPDATE; - snprintf(title, sizeof(title), "%s %s", "[活動連署]", topic); + snprintf(title, sizeof(title), "%s %s", SHM->i18nstr[cuser.language][2481], topic); snprintf(genbuf, sizeof(genbuf), - "%s\n\n%s%s\n", "活動連署", "活動主題: ", topic); - strcat(genbuf, "\n活動內容: \n"); + "%s\n\n%s%s\n", SHM->i18nstr[cuser.language][2482], SHM->i18nstr[cuser.language][2483], topic); + strcat(genbuf, SHM->i18nstr[cuser.language][2484]); break; case 2: - if (!getdata(7, 0, "請輸入公投主題:", topic, 30, DOECHO)) + if (!getdata(7, 0, SHM->i18nstr[cuser.language][2485], topic, 30, DOECHO)) return FULLUPDATE; - snprintf(title, sizeof(title), "%s %s", "[記名公投]", topic); + snprintf(title, sizeof(title), "%s %s", SHM->i18nstr[cuser.language][2486], topic); snprintf(genbuf, sizeof(genbuf), - "%s\n\n%s%s\n", "記名公投", "公投主題: ", topic); - strcat(genbuf, "\n公投原因: \n"); + "%s\n\n%s%s\n", SHM->i18nstr[cuser.language][2487], SHM->i18nstr[cuser.language][2488], topic); + strcat(genbuf, SHM->i18nstr[cuser.language][2489]); break; case 3: do { - if (!getdata(7, 0, "請輸入看板英文名稱:", topic, IDLEN + 1, DOECHO)) + if (!getdata(7, 0, SHM->i18nstr[cuser.language][2490], topic, IDLEN + 1, DOECHO)) return FULLUPDATE; else if (invalid_brdname(topic)) - outs("不是正確的看板名稱"); + outs(SHM->i18nstr[cuser.language][2491]); else if (getbnum(topic) > 0) - outs("本名稱已經存在"); + outs(SHM->i18nstr[cuser.language][2492]); else break; } while (temp > 0); - snprintf(title, sizeof(title), "[申請新板] %s", topic); + snprintf(title, sizeof(title), SHM->i18nstr[cuser.language][2493], topic); snprintf(genbuf, sizeof(genbuf), - "%s\n\n%s%s\n%s", "申請新板", "英文名稱: ", topic, "中文名稱: "); + "%s\n\n%s%s\n%s", SHM->i18nstr[cuser.language][2494], SHM->i18nstr[cuser.language][2495], topic, SHM->i18nstr[cuser.language][2496]); - if (!getdata(8, 0, "請輸入看板中文名稱:", topic, 20, DOECHO)) + if (!getdata(8, 0, SHM->i18nstr[cuser.language][2497], topic, 20, DOECHO)) return FULLUPDATE; strcat(genbuf, topic); - strcat(genbuf, "\n看板類別: "); - if (!getdata(9, 0, "請輸入看板類別:", topic, 20, DOECHO)) + strcat(genbuf, SHM->i18nstr[cuser.language][2498]); + if (!getdata(9, 0, SHM->i18nstr[cuser.language][2499], topic, 20, DOECHO)) return FULLUPDATE; strcat(genbuf, topic); - strcat(genbuf, "\n板主名單: "); - getdata(10, 0, "請輸入板主名單:", topic, IDLEN * 3 + 3, DOECHO); + strcat(genbuf, SHM->i18nstr[cuser.language][2500]); + getdata(10, 0, SHM->i18nstr[cuser.language][2501], topic, IDLEN * 3 + 3, DOECHO); strcat(genbuf, topic); - strcat(genbuf, "\n申請原因: \n"); + strcat(genbuf, SHM->i18nstr[cuser.language][2502]); break; case 4: move(1,0); clrtobot(); - generalnamecomplete("請輸入看板英文名稱:", + generalnamecomplete(SHM->i18nstr[cuser.language][2503], topic, IDLEN+1, SHM->Bnumber, completeboard_compar, completeboard_permission, completeboard_getname); - snprintf(title, sizeof(title), "[廢除舊板] %s", topic); + snprintf(title, sizeof(title), SHM->i18nstr[cuser.language][2504], topic); snprintf(genbuf, sizeof(genbuf), - "%s\n\n%s%s\n", "廢除舊板", "英文名稱: ", topic); - strcat(genbuf, "\n廢除原因: \n"); + "%s\n\n%s%s\n", SHM->i18nstr[cuser.language][2505], SHM->i18nstr[cuser.language][2506], topic); + strcat(genbuf, SHM->i18nstr[cuser.language][2507]); break; case 5: move(1,0); clrtobot(); - generalnamecomplete("請輸入看板英文名稱:", + generalnamecomplete(SHM->i18nstr[cuser.language][2508], topic, IDLEN+1, SHM->Bnumber, completeboard_compar, completeboard_permission, completeboard_getname); - snprintf(title, sizeof(title), "[連署板主] %s", topic); - snprintf(genbuf, sizeof(genbuf), "%s\n\n%s%s\n%s%s", "連署板主", "英文名稱: ", topic, "申請 ID : ", cuser.userid); - strcat(genbuf, "\n申請政見: \n"); + snprintf(title, sizeof(title), SHM->i18nstr[cuser.language][2509], topic); + snprintf(genbuf, sizeof(genbuf), "%s\n\n%s%s\n%s%s", SHM->i18nstr[cuser.language][2510], SHM->i18nstr[cuser.language][2511], topic, SHM->i18nstr[cuser.language][2512], cuser.userid); + strcat(genbuf, SHM->i18nstr[cuser.language][2513]); break; case 6: move(1,0); clrtobot(); - generalnamecomplete("請輸入看板英文名稱:", + generalnamecomplete(SHM->i18nstr[cuser.language][2514], topic, IDLEN+1, SHM->Bnumber, completeboard_compar, completeboard_permission, completeboard_getname); - snprintf(title, sizeof(title), "[罷免板主] %s", topic); + snprintf(title, sizeof(title), SHM->i18nstr[cuser.language][2515], topic); snprintf(genbuf, sizeof(genbuf), - "%s\n\n%s%s\n%s", "罷免板主", "英文名稱: ", - topic, "板主 ID : "); + "%s\n\n%s%s\n%s", SHM->i18nstr[cuser.language][2516], SHM->i18nstr[cuser.language][2517], + topic, SHM->i18nstr[cuser.language][2518]); temp=getbnum(topic); do { - if (!getdata(7, 0, "請輸入板主ID:", topic, IDLEN + 1, DOECHO)) + if (!getdata(7, 0, SHM->i18nstr[cuser.language][2519], topic, IDLEN + 1, DOECHO)) return FULLUPDATE; }while (!userid_is_BM(topic, bcache[temp - 1].BM)); strcat(genbuf, topic); - strcat(genbuf, "\n罷免原因: \n"); + strcat(genbuf, SHM->i18nstr[cuser.language][2520]); break; case 7: - if (!getdata(7, 0, "請輸入小組中英文名稱:", topic, 30, DOECHO)) + if (!getdata(7, 0, SHM->i18nstr[cuser.language][2521], topic, 30, DOECHO)) return FULLUPDATE; - snprintf(title, sizeof(title), "[連署小組長] %s", topic); + snprintf(title, sizeof(title), SHM->i18nstr[cuser.language][2522], topic); snprintf(genbuf, sizeof(genbuf), - "%s\n\n%s%s\n%s%s", "連署小組長", "小組名稱: ", - topic, "申請 ID : ", cuser.userid); - strcat(genbuf, "\n申請政見: \n"); + "%s\n\n%s%s\n%s%s", SHM->i18nstr[cuser.language][2523], SHM->i18nstr[cuser.language][2524], + topic, SHM->i18nstr[cuser.language][2525], cuser.userid); + strcat(genbuf, SHM->i18nstr[cuser.language][2526]); break; case 8: - if (!getdata(7, 0, "請輸入小組中英文名稱:", topic, 30, DOECHO)) + if (!getdata(7, 0, SHM->i18nstr[cuser.language][2527], topic, 30, DOECHO)) return FULLUPDATE; - snprintf(title, sizeof(title), "[罷免小組長] %s", topic); + snprintf(title, sizeof(title), SHM->i18nstr[cuser.language][2528], topic); snprintf(genbuf, sizeof(genbuf), "%s\n\n%s%s\n%s", - "罷免小組長", "小組名稱: ", topic, "小組長 ID : "); - if (!getdata(8, 0, "請輸入小組長ID:", topic, IDLEN + 1, DOECHO)) + SHM->i18nstr[cuser.language][2529], SHM->i18nstr[cuser.language][2530], topic, SHM->i18nstr[cuser.language][2531]); + if (!getdata(8, 0, SHM->i18nstr[cuser.language][2532], topic, IDLEN + 1, DOECHO)) return FULLUPDATE; strcat(genbuf, topic); - strcat(genbuf, "\n罷免原因: \n"); + strcat(genbuf, SHM->i18nstr[cuser.language][2533]); break; case 9: - if (!getdata(7, 0, "請輸入群組中英文名稱:", topic, 30, DOECHO)) + if (!getdata(7, 0, SHM->i18nstr[cuser.language][2534], topic, 30, DOECHO)) return FULLUPDATE; - snprintf(title, sizeof(title), "[申請新群組] %s", topic); + snprintf(title, sizeof(title), SHM->i18nstr[cuser.language][2535], topic); snprintf(genbuf, sizeof(genbuf), "%s\n\n%s%s\n%s%s", - "申請群組", "群組名稱: ", topic, "申請 ID : ", cuser.userid); - strcat(genbuf, "\n申請政見: \n"); + SHM->i18nstr[cuser.language][2536], SHM->i18nstr[cuser.language][2537], topic, SHM->i18nstr[cuser.language][2538], cuser.userid); + strcat(genbuf, SHM->i18nstr[cuser.language][2539]); break; default: return FULLUPDATE; } - outs("請輸入簡介或政見(至多五行),要清楚填寫"); + outs(SHM->i18nstr[cuser.language][2540]); for (temp = 12; temp < 17; temp++) { - if (!getdata(temp, 0, ":", topic, 60, DOECHO)) + if (!getdata(temp, 0, SHM->i18nstr[cuser.language][2541], topic, 60, DOECHO)) break; strcat(genbuf, topic); strcat(genbuf, "\n"); } if (temp == 11) return FULLUPDATE; - strcat(genbuf, "連署結束時間: "); + strcat(genbuf, SHM->i18nstr[cuser.language][2542]); now += 14 * 24 * 60 * 60; snprintf(topic, sizeof(topic), "(%ld)", now); strcat(genbuf, topic); strcat(genbuf, ctime(&now)); now -= 14 * 24 * 60 * 60; - strcat(genbuf, "----------支持----------\n"); - strcat(genbuf, "----------反對----------\n"); - outs("開始連署嘍"); + strcat(genbuf, SHM->i18nstr[cuser.language][2543]); + strcat(genbuf, SHM->i18nstr[cuser.language][2544]); + outs(SHM->i18nstr[cuser.language][2545]); setbpath(fpath, currboard); stampfile(fpath, &votefile); if (!(fp = fopen(fpath, "w"))) { - outs("開檔失敗,請稍候重來一次"); + outs(SHM->i18nstr[cuser.language][2546]); return FULLUPDATE; } - fprintf(fp, "%s%s %s%s\n%s%s\n%s%s", "作者: ", cuser.userid, - "看板: ", currboard, - "標題: ", title, - "時間: ", ctime(&now)); + fprintf(fp, "%s%s %s%s\n%s%s\n%s%s", SHM->i18nstr[cuser.language][2547], cuser.userid, + SHM->i18nstr[cuser.language][2548], currboard, + SHM->i18nstr[cuser.language][2549], title, + SHM->i18nstr[cuser.language][2550], ctime(&now)); fprintf(fp, "%s\n", genbuf); fclose(fp); strlcpy(votefile.owner, cuser.userid, sizeof(votefile.owner)); diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c index 5324a3a2..785d33e4 100644 --- a/mbbsd/xyz.c +++ b/mbbsd/xyz.c @@ -7,7 +7,7 @@ int x_90() { - use_dict(SHM->i18nstr[cuser.language][2431], "etc/90"); + use_dict(I18N[2431], "etc/90"); return 0; } @@ -15,21 +15,21 @@ x_90() int x_89() { - use_dict(SHM->i18nstr[cuser.language][2432], "etc/89"); + use_dict(I18N[2432], "etc/89"); return 0; } /* Ptt88年度大學聯招查榜系統 */ int x_88() { - use_dict(SHM->i18nstr[cuser.language][2433], "etc/88"); + use_dict(I18N[2433], "etc/88"); return 0; } /* Ptt87年度大學聯招查榜系統 */ int x_87() { - use_dict(SHM->i18nstr[cuser.language][2434], "etc/87"); + use_dict(I18N[2434], "etc/87"); return 0; } @@ -37,7 +37,7 @@ x_87() int x_86() { - use_dict(SHM->i18nstr[cuser.language][2435], "etc/86"); + use_dict(I18N[2435], "etc/86"); return 0; } @@ -180,7 +180,7 @@ note() notedata_t myitem; if (cuser.money < 5) { - vmsg(SHM->i18nstr[cuser.language][2436]); + vmsg(I18N[2436]); return 0; } setutmpmode(EDNOTE); @@ -188,11 +188,11 @@ note() myitem.buf[0][0] = myitem.buf[1][0] = myitem.buf[2][0] = '\0'; move(12, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][2437]); - for (i = 0; (i < 3) && getdata(16 + i, 0, SHM->i18nstr[cuser.language][2438], myitem.buf[i], + outs(I18N[2437]); + for (i = 0; (i < 3) && getdata(16 + i, 0, I18N[2438], myitem.buf[i], sizeof(myitem.buf[i]) - 5, DOECHO) && *myitem.buf[i]; i++); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2439], + getdata(b_lines - 1, 0, I18N[2439], buf, 3, LCECHO); if (buf[0] == 'q' || (i == 0 && *buf != 'e')) @@ -226,33 +226,33 @@ note() if (total > MAX_NOTE) total = MAX_NOTE; } - fputs(SHM->i18nstr[cuser.language][2440], fp); + fputs(I18N[2440], fp); collect = 1; while (total) { - snprintf(buf, sizeof(buf), SHM->i18nstr[cuser.language][2441], + snprintf(buf, sizeof(buf), I18N[2441], myitem.userid, myitem.username); len = strlen(buf); for (i = len; i < 71; i++) strcat(buf, " "); - snprintf(buf2, sizeof(buf2), SHM->i18nstr[cuser.language][2442], + snprintf(buf2, sizeof(buf2), I18N[2442], Cdate(&(myitem.date))); strcat(buf, buf2); fputs(buf, fp); if (collect) fputs(buf, foo); for (i = 0; i < 3 && *myitem.buf[i]; i++) { - fprintf(fp, SHM->i18nstr[cuser.language][2443], + fprintf(fp, I18N[2443], myitem.buf[i]); if (collect) - fprintf(foo, SHM->i18nstr[cuser.language][2444], + fprintf(foo, I18N[2444], myitem.buf[i]); } - fputs(SHM->i18nstr[cuser.language][2445], fp); + fputs(I18N[2445], fp); if (collect) { - fputs(SHM->i18nstr[cuser.language][2446], foo); + fputs(I18N[2446], foo); fclose(foo); collect = 0; } @@ -261,7 +261,7 @@ note() if (--total) read(fd, (char *)&myitem, sizeof(myitem)); } - fputs(SHM->i18nstr[cuser.language][2447], fp); + fputs(I18N[2447], fp); fclose(fp); close(fd); close(fx); @@ -306,15 +306,15 @@ mail_sysop() move(12, 0); clrtobot(); - outs(SHM->i18nstr[cuser.language][2448]); - outs(SHM->i18nstr[cuser.language][2449]); - outs(SHM->i18nstr[cuser.language][2450]); + outs(I18N[2448]); + outs(I18N[2449]); + outs(I18N[2450]); for (i = 0; i < j; i++) prints("%15d. \033[1;%dm%-16s%s\033[0m\n", i + 1, 31 + i % 7, sysoplist[i].userid, sysoplist[i].duty); - prints(SHM->i18nstr[cuser.language][2451], "", 31 + j % 7); - getdata(b_lines - 1, 0, SHM->i18nstr[cuser.language][2452], + prints(I18N[2451], "", 31 + j % 7); + getdata(b_lines - 1, 0, I18N[2452], genbuf, 4, DOECHO); i = genbuf[0] - '0' - 1; if (i >= 0 && i < j) { @@ -349,7 +349,7 @@ Goodbye() char genbuf[100]; char genbuf1[100]; - snprintf(genbuf1, sizeof(genbuf1), "%s%s%s", SHM->i18nstr[cuser.language][2453], BBSNAME, SHM->i18nstr[cuser.language][2454]); + snprintf(genbuf1, sizeof(genbuf1), "%s%s%s", I18N[2453], BBSNAME, I18N[2454]); getdata(b_lines - 1, 0, genbuf1, genbuf, 3, LCECHO); @@ -359,7 +359,7 @@ Goodbye() movie(999); if (cuser.userlevel) { getdata(b_lines - 1, 0, - SHM->i18nstr[cuser.language][2455], + I18N[2455], genbuf, 3, LCECHO); if (genbuf[0] == 'm') mail_sysop(); @@ -368,7 +368,7 @@ Goodbye() } log_memoryusage(); clear(); - prints(SHM->i18nstr[cuser.language][2456], + prints(I18N[2456], cuser.userid, cuser.username, BBSName); user_display(&cuser, 0); pressanykey(); |