using CC for i18n strings (note: replace non-CC '%c' with %s for clarity)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5357 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2010-07-13 17:17:05 +00:00
parent 7f3ea00b9f
commit 8328407439
4 changed files with 24 additions and 22 deletions
+8 -8
View File
@@ -80,10 +80,10 @@ void connectserv_(const char *servername, const char *serverport = NULL, const c
if(servername)
{
addserver(servername, serverport, "0");
conoutf(_("\f2attempting to %sconnect to \ff%s%c%s"), role==CR_DEFAULT?"":"\f8admin\f2", servername, address.port != CUBE_DEFAULT_SERVER_PORT ? ':' : 0, serverport);
conoutf(_("%c2attempting to %sconnect to %c5%s%c4%s%s%c2"), CC, role==CR_DEFAULT?"":"\f8admin\f2", CC, servername, CC, address.port != CUBE_DEFAULT_SERVER_PORT?":":"", serverport, CC);
if(!resolverwait(servername, &address))
{
conoutf(_("\f2could \f3not resolve\f2 server \ff%s"), servername);
conoutf(_("%c2could %c3not resolve%c2 server %c5%s%c2"), CC, CC, CC, CC, servername, CC);
clientpassword[0] = '\0';
connectrole = CR_DEFAULT;
return;
@@ -91,7 +91,7 @@ void connectserv_(const char *servername, const char *serverport = NULL, const c
}
else
{
conoutf(_("\f2attempting to connect over \f1LAN"));
conoutf(_("%c2attempting to connect over %c1LAN%c2"), CC, CC, CC);
address.host = ENET_HOST_BROADCAST;
}
@@ -108,7 +108,7 @@ void connectserv_(const char *servername, const char *serverport = NULL, const c
}
else
{
conoutf(_("\f2could \f3not connect\f2 to server"));
conoutf(_("%c2could %c3not connect%c2 to server"),CC,CC,CC);
clientpassword[0] = '\0';
connectrole = CR_DEFAULT;
}
@@ -499,7 +499,7 @@ void gets2c() // get updates from the server
++connattempts;
if(connattempts > 3)
{
conoutf(_("\f3could not connect to server"));
conoutf(_("%c3could not connect to server"), CC);
abortconnect();
return;
}
@@ -535,12 +535,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(_("%c3could not connect to server"), CC);
abortconnect();
}
else
{
if(!discmillis || event.data) conoutf(_("\f3server network error, disconnecting (%s) ..."), disc_reason(event.data));
if(!discmillis || event.data) conoutf(_("%c3server network error, disconnecting (%s) ..."), CC, disc_reason(event.data));
disconnect();
}
return;
@@ -562,7 +562,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(_("%c3map %s is secured, you can not send, receive or overwrite it"), CC, map);
return true;
}
return false;
+10 -8
View File
@@ -169,7 +169,8 @@ void newname(const char *name)
addmsg(SV_SWITCHNAME, "rs", player1->name);
}
else conoutf(_("your name is: %s"), player1->name);
alias(_("curname"), player1->name);
//alias(_("curname"), player1->name); // WTF? stef went crazy - this isn't something to translate either.
alias("curname", player1->name);
}
int teamatoi(const char *name)
@@ -186,7 +187,7 @@ 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_isvalid(nt)) { conoutf(_("%c3\"%s\" is not a valid team name (try CLA, RVSF or SPECTATOR)"), CC, name); return; }
if(team_isspect(nt) && player1->state != CS_DEAD) { conoutf(_("you need to be dead to become spectator")); return; }
addmsg(SV_SWITCHTEAM, "ri", nt);
}
@@ -790,7 +791,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(_("%c3invalid ctf-flag entity (%i)"), CC, i); e.attr2 = 0; }
flaginfo &f = flaginfos[e.attr2];
f.flagent = &e;
f.pos.x = (float) e.x;
@@ -866,7 +867,8 @@ void startmap(const char *name, bool reset) // called just after a map load
{
loopv(gmdescs) if(gmdescs[i].mode == gamemode)
{
conoutf(_("\f1%s"), gmdescs[i].desc);
//conoutf(_("%c1%s"), CC, gmdescs[i].desc); // 3rd useless call to translation - these should be translated inside the cube-script-definition
conoutf("\f1%s", gmdescs[i].desc);
}
}
@@ -1079,7 +1081,7 @@ void callvote(int type, char *arg1, char *arg2)
}
sendpackettoserv(1, p.finalize());
}
else conoutf(_("\f3invalid vote"));
else conoutf(_("%c3invalid vote"), CC);
}
void scallvote(char *type, char *arg1, char *arg2)
@@ -1101,7 +1103,7 @@ void scallvote(char *type, char *arg1, char *arg2)
{
if ( !arg2 || strlen(arg2) <= 3 )
{
conoutf(_("\f3invalid reason"));
conoutf(_("%c3invalid reason"), CC);
break;
}
}
@@ -1114,7 +1116,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(_("%c3you voted already"), CC); return 0; }
packetbuf p(MAXTRANS, ENET_PACKET_FLAG_RELIABLE);
putint(p, SV_VOTE);
putint(p, v);
@@ -1147,7 +1149,7 @@ void callvotesuc()
void callvoteerr(int e)
{
if(e < 0 || e >= VOTEE_NUM) return;
conoutf(_("\f3could not vote: %s"), voteerrorstr(e));
conoutf(_("%c3could not vote: %s"), CC, voteerrorstr(e));
DELETEP(calledvote);
}
+3 -3
View File
@@ -43,7 +43,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(_("%c3demo was recorded on map revision %d, you have map revision %d"), CC, revision, hdr.maprevision);
}
else
{
@@ -331,7 +331,7 @@ 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(_("%c3you are using a different game protocol (you: %d, server: %d)"), CC, CUR_PROTOCOL_VERSION, prot);
if(watchingdemo) conoutf("breaking loop : \f3this demo is using a different protocol\f5 : end it now!"); // SVN-WiP-bug: causes endless retry loop else!
else disconnect();
return;
@@ -1140,7 +1140,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
else loopi(demos)
{
getstring(text, p);
conoutf(_("%d. %s"), i+1, text);
conoutf("%d. %s", i+1, text); // i18n for this?? there's tons of other strings that NEED it, not this. (said flowtron: 2010jul13)
}
break;
}
+3 -3
View File
@@ -1149,11 +1149,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 \"%cs%s%cr\" is in category '%cs%s%cr' because of key '%s', please remove manually"), CC, servers[j]->sdesc, CC, CC, desc, CC, 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 \"%cs%s%cr\" from favourites category '%cs%s%cr' (rest '%s')"), CC, servers[j]->sdesc, CC, CC, desc, CC, rest);
alias(keyalias, rest);
}
else
@@ -1168,7 +1168,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 \"%cs%s%cr\" to favourites category '%cs%s%cr' (new '%s')"), CC, servers[j]->sdesc, CC, CC, desc, CC, getalias(keyalias));
}
return true;
}