From f2aff865b7567237595a06c779a7005320360432 Mon Sep 17 00:00:00 2001 From: driAn Date: Thu, 13 Aug 2009 20:43:07 +0000 Subject: [PATCH] localized ui/user related strings git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4634 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/client.cpp | 48 ++++++++++++------------- source/src/clientgame.cpp | 40 ++++++++++----------- source/src/clients2c.cpp | 68 ++++++++++++++++++------------------ source/src/i18n.cpp | 11 ++++-- source/src/main.cpp | 2 +- source/src/md2.h | 2 +- source/src/menus.cpp | 4 +-- source/src/physics.cpp | 2 +- source/src/serverbrowser.cpp | 6 ++-- 9 files changed, 95 insertions(+), 88 deletions(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index ea3c7e22..c0a1abcd 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -17,14 +17,14 @@ int getclientnum() { return player1 ? player1->clientnum : -1; } bool multiplayer(bool msg) { // check not correct on listen server? - if(curpeer && msg) conoutf("operation not available in multiplayer"); + if(curpeer && msg) conoutf(_("operation not available in multiplayer")); return curpeer!=NULL; } bool allowedittoggle() { bool allow = !curpeer || gamemode==1; - if(!allow) conoutf("editing in multiplayer requires coopedit mode (1)"); + if(!allow) conoutf(_("editing in multiplayer requires coopedit mode (1)")); return allow; } @@ -67,7 +67,7 @@ void connectserv_(const char *servername, const char *serverport = NULL, const c if(watchingdemo) enddemoplayback(); if(connpeer) { - conoutf("aborting connection attempt"); + conoutf(_("aborting connection attempt")); abortconnect(); } @@ -82,10 +82,10 @@ void connectserv_(const char *servername, const char *serverport = NULL, const c if(servername) { addserver(servername, serverport, "0"); - conoutf("attempting to connect to %s%c%s", servername, address.port != CUBE_DEFAULT_SERVER_PORT ? ':' : 0, serverport); + conoutf(_("attempting to connect to %s%c%s"), servername, address.port != CUBE_DEFAULT_SERVER_PORT ? ':' : 0, serverport); if(!resolverwait(servername, &address)) { - conoutf("\f3could not resolve server %s", servername); + conoutf(_("\f3could not resolve server %s"), servername); clientpassword[0] = '\0'; connectrole = CR_DEFAULT; return; @@ -93,7 +93,7 @@ void connectserv_(const char *servername, const char *serverport = NULL, const c } else { - conoutf("attempting to connect over LAN"); + conoutf(_("attempting to connect over LAN")); address.host = ENET_HOST_BROADCAST; } @@ -109,7 +109,7 @@ void connectserv_(const char *servername, const char *serverport = NULL, const c } else { - conoutf("\f3could not connect to server"); + conoutf(_("\f3could not connect to server")); clientpassword[0] = '\0'; connectrole = CR_DEFAULT; } @@ -172,7 +172,7 @@ void disconnect(int onlyclean, int async) curpeer = NULL; discmillis = 0; connected = 0; - conoutf("disconnected"); + conoutf(_("disconnected")); cleanup = true; } @@ -202,16 +202,16 @@ void trydisconnect() { if(connpeer) { - conoutf("aborting connection attempt"); + conoutf(_("aborting connection attempt")); abortconnect(); return; } if(!curpeer) { - conoutf("not connected"); + conoutf(_("not connected")); return; } - conoutf("attempting to disconnect..."); + conoutf(_("attempting to disconnect...")); disconnect(0, !discmillis); } @@ -506,12 +506,12 @@ void gets2c() // get updates from the server if(!clienthost || (!curpeer && !connpeer)) return; if(connpeer && totalmillis/3000 > connmillis/3000) { - conoutf("attempting to connect..."); + conoutf(_("attempting to connect...")); connmillis = totalmillis; ++connattempts; if(connattempts > 3) { - conoutf("\f3could not connect to server"); + conoutf(_("\f3could not connect to server")); abortconnect(); return; } @@ -524,7 +524,7 @@ void gets2c() // get updates from the server curpeer = connpeer; connpeer = NULL; connected = 1; - conoutf("connected to server"); + conoutf(_("connected to server")); throttle(); if(editmode) toggleedit(true); break; @@ -534,7 +534,7 @@ void gets2c() // get updates from the server extern packetqueue pktlogger; pktlogger.queue(event.packet); - if(discmillis) conoutf("attempting to disconnect..."); + if(discmillis) conoutf(_("attempting to disconnect...")); else servertoclient(event.channelID, event.packet->data, (int)event.packet->dataLength); // destroyed in logger //enet_packet_destroy(event.packet); @@ -547,12 +547,12 @@ void gets2c() // get updates from the server if(event.data>=DISC_NUM) event.data = DISC_NONE; if(event.peer==connpeer) { - conoutf("\f3could not connect to server"); + conoutf(_("\f3could not connect to server")); abortconnect(); } else { - if(!discmillis || event.data) conoutf("\f3server network error, disconnecting (%s) ...", disc_reason(event.data)); + if(!discmillis || event.data) conoutf(_("\f3server network error, disconnecting (%s) ..."), disc_reason(event.data)); disconnect(); } return; @@ -574,7 +574,7 @@ bool securemapcheck(const char *map, bool msg) if(strstr(map, "maps/")==map || strstr(map, "maps\\")==map) map += strlen("maps/"); loopv(securemaps) if(!strcmp(securemaps[i], map)) { - if(msg) conoutf("\f3map %s is secured, you can not send, receive or overwrite it", map); + if(msg) conoutf(_("\f3map %s is secured, you can not send, receive or overwrite it"), map); return true; } return false; @@ -603,7 +603,7 @@ void sendmap(char *mapname) putint(p, revision); if(MAXMAPSENDSIZE - p.length() < mapsize + cfgsizegz || cfgsize > MAXCFGFILESIZE) { - conoutf("map %s is too large to send", mapname); + conoutf(_("map %s is too large to send"), mapname); delete[] mapdata; if(cfgsize) delete[] cfgdata; enet_packet_destroy(packet); @@ -619,12 +619,12 @@ void sendmap(char *mapname) enet_packet_resize(packet, p.length()); sendpackettoserv(2, packet); - conoutf("sending map %s to server...", mapname); + conoutf(_("sending map %s to server..."), mapname); } void getmap() { - conoutf("requesting map from server..."); + conoutf(_("requesting map from server...")); ENetPacket *packet = enet_packet_create(NULL, MAXTRANS, ENET_PACKET_FLAG_RELIABLE); ucharbuf p(packet->data, packet->dataLength); putint(p, SV_RECVMAP); @@ -641,14 +641,14 @@ void deleteservermap(char *mapname) void getdemo(int i) { - if(i<=0) conoutf("getting demo..."); - else conoutf("getting demo %d...", i); + if(i<=0) conoutf(_("getting demo...")); + else conoutf(_("getting demo %d...", i)); addmsg(SV_GETDEMO, "ri", i); } void listdemos() { - conoutf("listing demos..."); + conoutf(_("listing demos...")); addmsg(SV_LISTDEMOS, "r"); } diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 243ac791..586b5217 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -119,8 +119,8 @@ void listignored() string pl; pl[0] = '\0'; loopv(players) if(players[i] && players[i]->ignored) s_strcatf(pl, ", %s", colorname(players[i])); - if(*pl) conoutf("ignored players: %s", pl + 2); - else conoutf("no players ignored."); + if(*pl) conoutf(_("ignored players: %s"), pl + 2); + else conoutf(_("no players ignored.")); } void clearignored(char *ccn) @@ -140,8 +140,8 @@ void listmuted() string pl; pl[0] = '\0'; loopv(players) if(players[i] && players[i]->muted) s_strcatf(pl, ", %s", colorname(players[i])); - if(*pl) conoutf("muted players: %s", pl + 2); - else conoutf("no players muted."); + if(*pl) conoutf(_("muted players: %s"), pl + 2); + else conoutf(_("no players muted.")); } void clearmuted(char *ccn) @@ -166,8 +166,8 @@ void newname(const char *name) if(!player1->name[0]) s_strcpy(player1->name, "unarmed"); updateclientname(player1); } - else conoutf("your name is: %s", player1->name); - alias("curname", player1->name); + else conoutf(_("your name is: %s"), player1->name); + alias(_("curname"), player1->name); } int teamatoi(const char *name) @@ -184,11 +184,11 @@ void newteam(char *name) { int nt = teamatoi(name); if(nt == player1->team) return; // same team - if(!team_isvalid(nt)) { conoutf("\f3\"%s\" is not a valid team name (try CLA, RVSF or SPECTATOR)", name); return; } - if(team_isspect(nt) && player1->state != CS_DEAD) { conoutf("you need to be dead to become spectator"); return; } + if(!team_isvalid(nt)) { conoutf(_("\f3\"%s\" is not a valid team name (try CLA, RVSF or SPECTATOR)"), name); return; } + if(team_isspect(nt) && player1->state != CS_DEAD) { conoutf(_("you need to be dead to become spectator")); return; } addmsg(SV_TRYTEAM, "ri", nt); } - else conoutf("your team is: %s", team_string(player1->team)); + else conoutf(_("your team is: %s"), team_string(player1->team)); } void benchme() @@ -689,15 +689,15 @@ void timeupdate(int timeremain) extern bool needsautoscreenshot; if(autoscreenshot) needsautoscreenshot = true; player1->attacking = false; - conoutf("intermission:"); - conoutf("game has ended!"); + conoutf(_("intermission:")); + conoutf(_("game has ended!")); consolescores(); showscores(true); if(identexists("start_intermission")) execute("start_intermission"); } else { - conoutf("time remaining: %d minutes", timeremain); + conoutf(_("time remaining: %d minutes"), timeremain); if(timeremain==1) { audiomgr.musicsuggest(M_LASTMINUTE1 + rnd(2), 70*1000, true); @@ -768,7 +768,7 @@ void preparectf(bool cleanonly=false) if(e.type==CTF_FLAG) { e.spawned = true; - if(e.attr2>=2) { conoutf("\f3invalid ctf-flag entity (%i)", i); e.attr2 = 0; } + if(e.attr2>=2) { conoutf(_("\f3invalid ctf-flag entity (%i)"), i); e.attr2 = 0; } flaginfo &f = flaginfos[e.attr2]; f.flagent = &e; f.pos.x = (float) e.x; @@ -839,12 +839,12 @@ void startmap(const char *name, bool reset) // called just after a map load minutesremaining = -1; arenaintermission = 0; bool noflags = (m_ctf || m_ktf) && (!numflagspawn[0] || !numflagspawn[1]); - if(*clientmap) conoutf("game mode is \"%s\"%s", modestr(gamemode, modeacronyms > 0), noflags ? " - \f2but there are no flag bases on this map" : ""); + if(*clientmap) conoutf(_("game mode is \"%s\"%s"), modestr(gamemode, modeacronyms > 0), noflags ? " - \f2but there are no flag bases on this map" : ""); if(multiplayer(false) || m_botmode) { loopv(gmdescs) if(gmdescs[i].mode == gamemode) { - conoutf("\f1%s", gmdescs[i].desc); + conoutf(_("\f1%s"), gmdescs[i].desc); } } @@ -1046,7 +1046,7 @@ void callvote(int type, char *arg1, char *arg2) enet_packet_resize(packet, p.length()); sendpackettoserv(1, packet); } - else conoutf("\f3invalid vote"); + else conoutf(_("\f3invalid vote")); } void scallvote(char *type, char *arg1, char *arg2) @@ -1067,7 +1067,7 @@ void scallvote(char *type, char *arg1, char *arg2) int vote(int v) { if(!curvote || v < 0 || v >= VOTE_NUM) return 0; - if(curvote->localplayervoted) { conoutf("\f3you voted already"); return 0; } + if(curvote->localplayervoted) { conoutf(_("\f3you voted already")); return 0; } ENetPacket *packet = enet_packet_create(NULL, MAXTRANS, ENET_PACKET_FLAG_RELIABLE); ucharbuf p(packet->data, packet->dataLength); putint(p, SV_VOTE); @@ -1086,7 +1086,7 @@ void displayvote(votedisplayinfo *v) if(!v) return; DELETEP(curvote); curvote = v; - conoutf("%s called a vote: %s", v->owner ? colorname(v->owner) : "", curvote->desc); + conoutf(_("%s called a vote: %s"), v->owner ? colorname(v->owner) : "", curvote->desc); audiomgr.playsound(S_CALLVOTE, SP_HIGHEST); curvote->localplayervoted = false; } @@ -1102,7 +1102,7 @@ void callvotesuc() void callvoteerr(int e) { if(e < 0 || e >= VOTEE_NUM) return; - conoutf("\f3could not vote: %s", voteerrorstr(e)); + conoutf(_("\f3could not vote: %s"), voteerrorstr(e)); DELETEP(calledvote); } @@ -1113,7 +1113,7 @@ void voteresult(int v) { curvote->result = v; curvote->millis = totalmillis + 5000; - conoutf("vote %s", v == VOTE_YES ? "passed" : "failed"); + conoutf(_("vote %s"), v == VOTE_YES ? _("passed") : _("failed")); if(multiplayer(false)) audiomgr.playsound(v == VOTE_YES ? S_VOTEPASS : S_VOTEFAIL, SP_HIGH); } } diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 187dae1f..943c6cd1 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -38,7 +38,7 @@ bool changemapserv(char *name, int mode, int download, int revision) // f bool revmatch = hdr.maprevision == revision || revision == 0; if(watchingdemo) { - if(!revmatch) conoutf("\f3demo was recorded on map revision %d, you have map revision %d", revision, hdr.maprevision); + if(!revmatch) conoutf(_("\f3demo was recorded on map revision %d, you have map revision %d"), revision, hdr.maprevision); } else { @@ -58,9 +58,9 @@ bool changemapserv(char *name, int mode, int download, int revision) // f } else { - if(!loaded || download < 10) conoutf("\"getmap\" to download the current map from the server"); - else conoutf("\"getmap\" to download a %s version of the current map from the server", - revision == 0 ? "different" : (revision > hdr.maprevision ? "newer" : "older")); + if(!loaded || download < 10) conoutf(_("\"getmap\" to download the current map from the server")); + else conoutf(_("\"getmap\" to download a %s version of the current map from the server"), + revision == 0 ? _("different") : (revision > hdr.maprevision ? _("newer") : _("older"))); } } } @@ -241,13 +241,13 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) int mycn = getint(p), prot = getint(p); if(prot!=CUR_PROTOCOL_VERSION && !(watchingdemo && prot == -PROTOCOL_VERSION)) { - conoutf("\f3you are using a different game protocol (you: %d, server: %d)", CUR_PROTOCOL_VERSION, prot); + conoutf(_("\f3you are using a different game protocol (you: %d, server: %d)"), CUR_PROTOCOL_VERSION, prot); disconnect(); return; } sessionid = getint(p); player1->clientnum = mycn; - if(getint(p) > 0) conoutf("INFO: this server is password protected"); + if(getint(p) > 0) conoutf(_("INFO: this server is password protected")); sendintro(); break; } @@ -355,12 +355,12 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) if(d->name[0]) // already connected { if(strcmp(d->name, text)) - conoutf("%s is now known as %s", colorname(d), colorname(d, text)); + conoutf(_("%s is now known as %s"), colorname(d), colorname(d, text)); } else // new client { c2sinit = false; // send new players my info again - conoutf("connected: %s", colorname(d, text)); + conoutf(_("connected: %s"), colorname(d, text)); } s_strncpy(d->name, text, MAXNAMELEN+1); d->setskin(TEAM_CLA, getint(p)); @@ -379,7 +379,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) int cn = getint(p); playerent *d = getclient(cn); if(!d) break; - if(d->name[0]) conoutf("player %s disconnected", colorname(d)); + if(d->name[0]) conoutf(_("player %s disconnected"), colorname(d)); zapplayer(players[cn]); break; } @@ -430,7 +430,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) if(m_arena && !localwrongmap) { closemenu(NULL); - conoutf("new round starting... fight!"); + conoutf(_("new round starting... fight!")); hudeditf(HUDMSG_TIMER, "FIGHT!"); if(m_botmode) BotManager.RespawnBots(); } @@ -494,7 +494,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) if(!p || p==player1) break; if(p->weaponsel->type != GUN_SNIPER) { - conoutf("bad scope-message for %s", p->name); + conoutf(_("bad scope-message for %s"), p->name); break; } sniperrifle *sr = (sniperrifle *)p->weaponsel; @@ -631,7 +631,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) if(size>=0) empty_world(size, true); else empty_world(-1, true); if(d && d!=player1) - conoutf(size>=0 ? "%s started a new map of size %d" : "%s enlarged the map to size %d", colorname(d), sfactor); + conoutf(size>=0 ? _("%s started a new map of size %d") : _("%s enlarged the map to size %d"), colorname(d), sfactor); break; } @@ -738,12 +738,12 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) { int acn = getint(p); playerent *alive = acn<0 ? NULL : (acn==getclientnum() ? player1 : getclient(acn)); - conoutf("the round is over! next round in 5 seconds..."); - if(m_botmode && acn==-2) hudoutf("the bots have won the round!"); - else if(!alive) hudoutf("everyone died!"); - else if(m_teammode) hudoutf("team %s has won the round!", team_string(alive->team)); - else if(alive==player1) hudoutf("you are the survivor!"); - else hudoutf("%s is the survivor!", colorname(alive)); + conoutf(_("the round is over! next round in 5 seconds...")); + if(m_botmode && acn==-2) hudoutf(_("the bots have won the round!")); + else if(!alive) hudoutf(_("everyone died!")); + else if(m_teammode) hudoutf(_("team %s has won the round!"), team_string(alive->team)); + else if(alive==player1) hudoutf(_("you are the survivor!")); + else hudoutf(_("%s is the survivor!"), colorname(alive)); arenaintermission = lastmillis; break; } @@ -799,7 +799,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) if(pl) { pl->clientrole = r; - if(pl->name[0]) conoutf("%s claimed %s status", pl == player1 ? "you" : colorname(pl), r == CR_ADMIN ? "admin" : "master"); + if(pl->name[0]) conoutf(_("%s claimed %s status"), pl == player1 ? _("you") : colorname(pl), r == CR_ADMIN ? "admin" : "master"); } } break; @@ -810,11 +810,11 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) int t = getint(p); if(m_teammode) { - if(team_isvalid(t)) conoutf("you can't change to team %s", team_string(t)); + if(team_isvalid(t)) conoutf(_("you can't change to team %s"), team_string(t)); } else { - conoutf("you can't change to %s mode", team_isspect(t) ? "spectate" : "active"); + conoutf(_("you can't change to %s mode"), team_isspect(t) ? _("spectate") : _("active")); } break; } @@ -841,10 +841,10 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) switch(ftr) { case FTR_PLAYERWISH: - conoutf("you're now in team %s", nts); + conoutf(_("you're now in team %s"), nts); break; case FTR_AUTOTEAM: - hudoutf("the server forced you to team %s", nts); + hudoutf(_("the server forced you to team %s"), nts); break; } } @@ -855,18 +855,18 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) switch(ftr) { case FTR_PLAYERWISH: - conoutf("player %s switched to team %s", pls, nts); // new message + conoutf(_("player %s switched to team %s"), pls, nts); // new message break; case FTR_AUTOTEAM: - if(watchingdemo) conoutf("the server forced %s to team %s", colorname(d), nts); - else hudoutf("the server forced %s to %s team", colorname(d), et ? "the enemy" : "your"); + if(watchingdemo) conoutf(_("the server forced %s to team %s"), colorname(d), nts); + else hudoutf(_("the server forced %s to %s team"), colorname(d), et ? _("the enemy") : _("your")); break; } } if(you && !team_isspect(d->team) && team_isspect(fnt) && d->state == CS_DEAD) spectate(SM_FLY); } } - else if(d->team != fnt && ftr == FTR_PLAYERWISH) conoutf("%s changed to active play", you ? "you" : colorname(d)); + else if(d->team != fnt && ftr == FTR_PLAYERWISH) conoutf(_("%s changed to active play"), you ? _("you") : colorname(d)); d->team = fnt; } break; @@ -935,19 +935,19 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) int cn = getint(p); playerent *pl = cn == getclientnum() ? player1 : getclient(cn); int ip = getint(p); - if((ip>>16&0xFF) > 0 && (ip>>24&0xFF) > 0) conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.%d", cn, pl ? colorname(pl) : "", ip&0xFF, ip>>8&0xFF, ip>>16&0xFF, ip>>24&0xFF); // full IP - else conoutf("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.x.x", cn, pl ? colorname(pl) : "", ip&0xFF, ip>>8&0xFF); // censored IP + if((ip>>16&0xFF) > 0 && (ip>>24&0xFF) > 0) conoutf(_("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.%d.%d"), cn, pl ? colorname(pl) : "", ip&0xFF, ip>>8&0xFF, ip>>16&0xFF, ip>>24&0xFF); // full IP + else conoutf(_("WHOIS client %d:\n\f5name\t%s\n\f5IP\t%d.%d.x.x"), cn, pl ? colorname(pl) : "", ip&0xFF, ip>>8&0xFF); // censored IP break; } case SV_SENDDEMOLIST: { int demos = getint(p); - if(!demos) conoutf("no demos available"); + if(!demos) conoutf(_("no demos available")); else loopi(demos) { getstring(text, p); - conoutf("%d. %s", i+1, text); + conoutf(_("%d. %s"), i+1, text); } break; } @@ -1007,10 +1007,10 @@ void receivefile(uchar *data, int len) FILE *demo = openfile(fname, "wb"); if(!demo) { - conoutf("failed writing to \"%s\"", fname); + conoutf(_("failed writing to \"%s\""), fname); return; } - conoutf("received demo \"%s\"", fname); + conoutf(_("received demo \"%s\""), fname); fwrite(&p.buf[p.len], 1, demosize, demo); fclose(demo); break; @@ -1019,7 +1019,7 @@ void receivefile(uchar *data, int len) case SV_RECVMAP: { getstring(text, p); - conoutf("received map \"%s\" from server, reloading..", text); + conoutf(_("received map \"%s\" from server, reloading.."), text); int mapsize = getint(p); int cfgsize = getint(p); int cfgsizegz = getint(p); diff --git a/source/src/i18n.cpp b/source/src/i18n.cpp index 8ac45e2b..b286c136 100644 --- a/source/src/i18n.cpp +++ b/source/src/i18n.cpp @@ -11,6 +11,13 @@ i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(doma textdomain(domain); printf("current locale: %s\n", locale); - - printf(_("hello world\n")); // test output } + +// export gettext to cubescript +void script_gettext(char *msgid) +{ + const char *translated = _gettext(msgid); + result(translated); +} + +COMMANDN(gettext, script_gettext, ARG_1STR); diff --git a/source/src/main.cpp b/source/src/main.cpp index 0ed536e7..125bbf93 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -647,7 +647,7 @@ int main(int argc, char **argv) gl_init(scr_w, scr_h, usedcolorbits, useddepthbits, usedfsaa); notexture = noworldtexture = textureload("packages/misc/notexture.jpg"); - if(!notexture) fatal(_("could not find core textures (hint: run AssaultCube from the parent of the bin directory)")); + if(!notexture) fatal("could not find core textures (hint: run AssaultCube from the parent of the bin directory)"); initlog("console"); persistidents = false; diff --git a/source/src/md2.h b/source/src/md2.h index 6eb2f28d..af456fa7 100644 --- a/source/src/md2.h +++ b/source/src/md2.h @@ -255,7 +255,7 @@ struct md2 : vertmodel Texture *skin; loadskin(loadname, pname, skin); loopv(mdl.meshes) mdl.meshes[i]->skin = skin; - if(skin==notexture) conoutf("could not load model skin for %s", name1); + if(skin==notexture) conoutf(_("could not load model skin for %s"), name1); loadingmd2 = this; s_sprintfd(name2)("packages/models/%s/md2.cfg", loadname); persistidents = false; diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 679e6032..de73cf39 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -158,7 +158,7 @@ struct mitemmanual : mitem virtual void render(int x, int y, int w) { mitem::render(x, y, w); - draw_text(_(text), x, y); + draw_text(text, x, y); } virtual void focus(bool on) @@ -1122,7 +1122,7 @@ void addchange(const char *desc, int type) if(!applydialog) return; if(type!=CHANGE_GFX) { - conoutf("..restart AssaultCube for this setting to take effect"); + conoutf(_("..restart AssaultCube for this setting to take effect")); return; } bool changed = false; diff --git a/source/src/physics.cpp b/source/src/physics.cpp index bf06f793..51f0788c 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -778,6 +778,6 @@ void entinmap(physent *d) // brute force but effective way to find a free spa } // leave ent at original pos, possibly stuck d->resetinterp(); - conoutf("can't find entity spawn spot! (%d, %d)", d->o.x, d->o.y); + conoutf(_("can't find entity spawn spot! (%d, %d)"), d->o.x, d->o.y); } diff --git a/source/src/serverbrowser.cpp b/source/src/serverbrowser.cpp index a91da9bf..01359d81 100644 --- a/source/src/serverbrowser.cpp +++ b/source/src/serverbrowser.cpp @@ -1152,11 +1152,11 @@ bool serverskey(void *menu, int code, bool isdown, int unicode) if(!desc) desc = ""; if(*ak) { // server was automatically added to this favourite group, don't remove - conoutf("server \"\fs%s\fr\" is in category '\fs%s\fr' because of key '%s', please remove manually", servers[j]->sdesc, desc, ak); + conoutf(_("server \"\fs%s\fr\" is in category '\fs%s\fr' because of key '%s', please remove manually"), servers[j]->sdesc, desc, ak); } else if(rest) { // remove from favourite group - conoutf("removing server \"\fs%s\fr\" from favourites category '\fs%s\fr' (rest '%s')", servers[j]->sdesc, desc, rest); + conoutf(_("removing server \"\fs%s\fr\" from favourites category '\fs%s\fr' (rest '%s')"), servers[j]->sdesc, desc, rest); alias(keyalias, rest); } else @@ -1171,7 +1171,7 @@ bool serverskey(void *menu, int code, bool isdown, int unicode) delete[] newkey; } else alias(keyalias, text); - conoutf("adding server \"\fs%s\fr\" to favourites category '\fs%s\fr' (new '%s')", servers[j]->sdesc, desc, getalias(keyalias)); + conoutf(_("adding server \"\fs%s\fr\" to favourites category '\fs%s\fr' (new '%s')"), servers[j]->sdesc, desc, getalias(keyalias)); } return true; }